main_2020_edit.js 2.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980
  1. if (function() {
  2. "use strict";
  3. function o(e, t) {
  4. return typeof e === t
  5. }
  6. function a(e, t) {
  7. return e instanceof t
  8. }
  9. function s(e) {
  10. return e && e.nodeType
  11. }
  12. function l(e) {
  13. return s(e) ? e : a(e, y) ? e[0] : void 0
  14. }
  15. function e(e, i, n) {
  16. return y.each(e, function(e, t) {
  17. n = i.call(t, n, e, t)
  18. }),
  19. n
  20. }
  21. function t(e, t, i) {
  22. var n, r, o;
  23. if (e === t)
  24. return !0;
  25. if (!e || !t || e.constructor !== t.constructor)
  26. return !1;
  27. for (n = 0,
  28. r = i.length; n < r; n += 1) {
  29. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  30. return !1;
  31. if (e[o] !== t[o])
  32. return !1
  33. }
  34. return !0
  35. }
  36. function c(e, t, i, n) {
  37. this.left = w(e),
  38. this.top = w(t),
  39. this.width = w(i),
  40. this.height = w(n),
  41. this.right = this.left + this.width,
  42. this.bottom = this.top + this.height
  43. }
  44. function h(e, t, i, n) {
  45. this.visible = e || 0,
  46. this.viewport = t || 0,
  47. this.possible = i || 0,
  48. this.rects = n && I({}, n) || null
  49. }
  50. function r(e, t) {
  51. this.els = e,
  52. this.viewport = t
  53. }
  54. function n(e, t) {
  55. return e.val - t.val
  56. }
  57. function u(e, t) {
  58. return t.val - e.val
  59. }
  60. function d(e) {
  61. var t = c.ofContent(e, !0)
  62. , i = c.ofViewport(e, !0)
  63. , n = t.width - i.width
  64. , r = t.height - i.height;
  65. this.content = t,
  66. this.viewport = i,
  67. this.width = n <= 0 ? null : i.left / n,
  68. this.height = r <= 0 ? null : i.top / r,
  69. this.left = i.left,
  70. this.top = i.top,
  71. this.right = t.right - i.right,
  72. this.bottom = t.bottom - i.bottom
  73. }
  74. function p(e) {
  75. this.el = e || window
  76. }
  77. function f(e, t) {
  78. this.context = e,
  79. this.viewport = t,
  80. this.init()
  81. }
  82. function g(e, t, i, n) {
  83. this.context = new r(e,t),
  84. this.property = i,
  85. this.descending = n,
  86. this.init()
  87. }
  88. function m(e) {
  89. e && e !== window && e !== document ? (this.context = e,
  90. this.$autoTarget = y(e)) : this.context = window,
  91. this.init()
  92. }
  93. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  94. v = 1,
  95. function(e) {
  96. return e ? (i[e] || (i[e] = v,
  97. v += 1),
  98. i[e]) : 0
  99. }
  100. );
  101. I(c.prototype, {
  102. equals: function(e) {
  103. return t(this, e, ["left", "top", "width", "height"])
  104. },
  105. area: function() {
  106. return this.width * this.height
  107. },
  108. relativeTo: function(e) {
  109. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  110. },
  111. intersection: function(e) {
  112. if (!a(e, c))
  113. return null;
  114. var t = _(this.left, e.left)
  115. , i = b(this.right, e.right)
  116. , n = _(this.top, e.top)
  117. , r = i - t
  118. , o = b(this.bottom, e.bottom) - n;
  119. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  120. },
  121. envelope: function(e) {
  122. if (!a(e, c))
  123. return this;
  124. var t = b(this.left, e.left)
  125. , i = _(this.right, e.right)
  126. , n = b(this.top, e.top);
  127. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  128. }
  129. }),
  130. I(c, {
  131. ofContent: function(e, t) {
  132. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  133. },
  134. ofViewport: function(e, t) {
  135. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  136. },
  137. ofElement: function(e) {
  138. var t = y(e);
  139. if (!t.is(":visible"))
  140. return null;
  141. var i = t.offset();
  142. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  143. }
  144. }),
  145. I(h.prototype, {
  146. equals: function(e) {
  147. return this.fracsEqual(e) && this.rectsEqual(e)
  148. },
  149. fracsEqual: function(e) {
  150. return t(this, e, ["visible", "viewport", "possible"])
  151. },
  152. rectsEqual: function(e) {
  153. return t(this.rects, e.rects, ["document", "element", "viewport"])
  154. }
  155. }),
  156. I(h, {
  157. of: function(e, t) {
  158. var i, n, r;
  159. return e = s(e) && c.ofElement(e) || e,
  160. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  161. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  162. r = b(e.width, t.width) * b(e.height, t.height),
  163. new h(n / e.area(),n / t.area(),n / r,{
  164. document: i,
  165. element: i.relativeTo(e),
  166. viewport: i.relativeTo(t)
  167. })) : new h
  168. }
  169. });
  170. var x = ["width", "height", "left", "right", "top", "bottom"]
  171. , S = ["possible", "visible", "viewport"];
  172. I(r.prototype, {
  173. sorted: function(t, e) {
  174. var i = this.viewport;
  175. return y.map(this.els, function(e) {
  176. return {
  177. el: e,
  178. val: function(e, t, i) {
  179. var n;
  180. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  181. n ? n[i] : 0
  182. }(e, i, t)
  183. }
  184. }).sort(e ? u : n)
  185. },
  186. best: function(e, t) {
  187. return this.els.length ? this.sorted(e, t)[0] : null
  188. }
  189. }),
  190. I(d.prototype, {
  191. equals: function(e) {
  192. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  193. }
  194. }),
  195. I(p.prototype, {
  196. equals: function(e) {
  197. return t(this, e, ["el"])
  198. },
  199. scrollState: function() {
  200. return new d(this.el)
  201. },
  202. scrollTo: function(e, t, i) {
  203. var n = y(this.el === window ? "html,body" : this.el);
  204. e = e || 0,
  205. t = t || 0,
  206. i = isNaN(i) ? 1e3 : i,
  207. n.stop(!0).animate({
  208. scrollLeft: e,
  209. scrollTop: t
  210. }, i)
  211. },
  212. scroll: function(e, t, i) {
  213. var n = this.el === window ? A : y(this.el);
  214. e = e || 0,
  215. t = t || 0,
  216. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  217. },
  218. scrollToRect: function(e, t, i, n) {
  219. t = t || 0,
  220. i = i || 0,
  221. this.scrollTo(e.left - t, e.top - i, n)
  222. },
  223. scrollToElement: function(e, t, i, n) {
  224. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  225. this.scrollToRect(r, t, i, n)
  226. }
  227. });
  228. var M = {
  229. init: function() {
  230. this.callbacks = y.Callbacks("memory unique"),
  231. this.currVal = null,
  232. this.prevVal = null,
  233. this.checkProxy = y.proxy(this.check, this),
  234. this.autoCheck()
  235. },
  236. bind: function(e) {
  237. this.callbacks.add(e)
  238. },
  239. unbind: function(e) {
  240. e ? this.callbacks.remove(e) : this.callbacks.empty()
  241. },
  242. trigger: function() {
  243. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  244. },
  245. check: function(e) {
  246. var t = this.updatedValue(e);
  247. return void 0 !== t && (this.prevVal = this.currVal,
  248. this.currVal = t,
  249. this.trigger(),
  250. !0)
  251. },
  252. $autoTarget: A,
  253. autoEvents: "load resize scroll",
  254. autoCheck: function(e) {
  255. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  256. }
  257. };
  258. I(f.prototype, M, {
  259. updatedValue: function() {
  260. var e = h.of(this.context, this.viewport);
  261. return this.currVal && this.currVal.equals(e) ? void 0 : e
  262. }
  263. }),
  264. I(g.prototype, M, {
  265. updatedValue: function() {
  266. var e = this.context.best(this.property, this.descending);
  267. return e && (e = 0 < e.val ? e.el : null,
  268. this.currVal !== e) ? e : void 0
  269. }
  270. }),
  271. I(m.prototype, M, {
  272. updatedValue: function() {
  273. var e = new d(this.context);
  274. return this.currVal && this.currVal.equals(e) ? void 0 : e
  275. }
  276. });
  277. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  278. function H(e, t, i, n) {
  279. return i = N(i) ? i.apply(e, t) : i,
  280. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  281. }
  282. R = U,
  283. P = {
  284. statics: {
  285. version: "0.15.0",
  286. Rect: c,
  287. Fractions: h,
  288. Group: r,
  289. ScrollState: d,
  290. Viewport: p,
  291. FracsCallbacks: f,
  292. GroupCallbacks: g,
  293. ScrollStateCallbacks: m,
  294. fracs: function(e, t) {
  295. return h.of(e, t)
  296. }
  297. },
  298. methods: {
  299. content: function(e) {
  300. return this.length ? c.ofContent(this[0], e) : null
  301. },
  302. envelope: function() {
  303. return e(this, function(e) {
  304. var t = c.ofElement(this);
  305. return e ? e.envelope(t) : t
  306. })
  307. },
  308. fracs: function(e, i, n) {
  309. o(e, "string") || (n = i,
  310. i = e,
  311. e = null),
  312. E(i) || (n = i,
  313. i = null),
  314. n = l(n);
  315. var r = U + ".fracs." + T(n);
  316. return "unbind" === e ? this.each(function() {
  317. var e = y(this).data(r);
  318. e && e.unbind(i)
  319. }) : "check" === e ? this.each(function() {
  320. var e = y(this).data(r);
  321. e && e.check()
  322. }) : E(i) ? this.each(function() {
  323. var e = y(this)
  324. , t = e.data(r);
  325. t || (t = new f(this,n),
  326. e.data(r, t)),
  327. t.bind(i)
  328. }) : this.length ? h.of(this[0], n) : null
  329. },
  330. intersection: function() {
  331. return e(this, function(e) {
  332. var t = c.ofElement(this);
  333. return e ? e.intersection(t) : t
  334. })
  335. },
  336. max: function(e, t, i) {
  337. return E(t) || (i = t,
  338. t = null),
  339. i = l(i),
  340. t ? (new g(this,i,e,!0).bind(t),
  341. this) : this.pushStack(new r(this,i).best(e, !0).el)
  342. },
  343. min: function(e, t, i) {
  344. return E(t) || (i = t,
  345. t = null),
  346. i = l(i),
  347. t ? (new g(this,i,e).bind(t),
  348. this) : this.pushStack(new r(this,i).best(e).el)
  349. },
  350. rect: function() {
  351. return this.length ? c.ofElement(this[0]) : null
  352. },
  353. scrollState: function(e, i) {
  354. var n = U + ".scrollState";
  355. return o(e, "string") || (i = e,
  356. e = null),
  357. "unbind" === e ? this.each(function() {
  358. var e = y(this).data(n);
  359. e && e.unbind(i)
  360. }) : "check" === e ? this.each(function() {
  361. var e = y(this).data(n);
  362. e && e.check()
  363. }) : E(i) ? this.each(function() {
  364. var e = y(this)
  365. , t = e.data(n);
  366. t || (t = new m(this),
  367. e.data(n, t)),
  368. t.bind(i)
  369. }) : this.length ? new d(this[0]) : null
  370. },
  371. scroll: function(e, t, i) {
  372. return this.each(function() {
  373. new p(this).scroll(e, t, i)
  374. })
  375. },
  376. scrollTo: function(e, t, i, n) {
  377. return y.isNumeric(e) && (n = i,
  378. i = t,
  379. t = e,
  380. e = null),
  381. e = l(e),
  382. this.each(function() {
  383. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  384. })
  385. },
  386. scrollToThis: function(e, t, i, n) {
  387. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  388. this
  389. },
  390. softLink: function(t, i, n, r) {
  391. return r = new p(l(r)),
  392. this.filter("a[href^=#]").each(function() {
  393. var e = y(this);
  394. e.on("click", function() {
  395. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  396. })
  397. })
  398. },
  399. sort: function(e, t, i) {
  400. return o(t, "boolean") || (i = t,
  401. t = null),
  402. i = l(i),
  403. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  404. return e.el
  405. }))
  406. },
  407. viewport: function(e) {
  408. return this.length ? c.ofViewport(this[0], e) : null
  409. }
  410. },
  411. defaultStatic: "fracs",
  412. defaultMethod: "fracs"
  413. },
  414. O = [].slice,
  415. L = jQuery,
  416. D = L.extend,
  417. N = L.isFunction,
  418. F = D({}, P),
  419. B = function() {
  420. return H(this, O.call(arguments), F.defaultStatic, B)
  421. }
  422. ,
  423. V = function(e) {
  424. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  425. }
  426. ,
  427. (k = function(e) {
  428. e && (D(B, e.statics),
  429. D(V, e.methods)),
  430. B.modplug = k
  431. }
  432. ).prev = {
  433. statics: L[R],
  434. methods: L.fn[R]
  435. },
  436. k(P),
  437. L[R] = B,
  438. L.fn[R] = V
  439. }(),
  440. "undefined" == typeof jQuery)
  441. throw new Error("Bootstrap's JavaScript requires jQuery");
  442. !function(m) {
  443. "use strict";
  444. function r(e, t) {
  445. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  446. this.init("tooltip", e, t)
  447. }
  448. r.VERSION = "3.2.0",
  449. r.DEFAULTS = {
  450. animation: !0,
  451. placement: "top",
  452. selector: !1,
  453. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  454. trigger: "hover focus",
  455. title: "",
  456. delay: 0,
  457. html: !1,
  458. container: !1,
  459. viewport: {
  460. selector: "body",
  461. padding: 0
  462. }
  463. },
  464. r.prototype.init = function(e, t, i) {
  465. this.enabled = !0,
  466. this.type = e,
  467. this.$element = m(t),
  468. this.options = this.getOptions(i),
  469. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  470. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  471. var o = n[r];
  472. if ("click" == o)
  473. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  474. else if ("manual" != o) {
  475. var a = "hover" == o ? "mouseenter" : "focusin"
  476. , s = "hover" == o ? "mouseleave" : "focusout";
  477. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  478. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  479. }
  480. }
  481. this.options.selector ? this._options = m.extend({}, this.options, {
  482. trigger: "manual",
  483. selector: ""
  484. }) : this.fixTitle()
  485. }
  486. ,
  487. r.prototype.getDefaults = function() {
  488. return r.DEFAULTS
  489. }
  490. ,
  491. r.prototype.getOptions = function(e) {
  492. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  493. show: e.delay,
  494. hide: e.delay
  495. }),
  496. e
  497. }
  498. ,
  499. r.prototype.getDelegateOptions = function() {
  500. var i = {}
  501. , n = this.getDefaults();
  502. return this._options && m.each(this._options, function(e, t) {
  503. n[e] != t && (i[e] = t)
  504. }),
  505. i
  506. }
  507. ,
  508. r.prototype.enter = function(e) {
  509. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  510. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  511. m(e.currentTarget).data("bs." + this.type, t)),
  512. clearTimeout(t.timeout),
  513. t.hoverState = "in",
  514. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  515. }
  516. ,
  517. r.prototype.leave = function(e) {
  518. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  519. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  520. m(e.currentTarget).data("bs." + this.type, t)),
  521. clearTimeout(t.timeout),
  522. t.hoverState = "out",
  523. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  524. "out" == t.hoverState && t.hide()
  525. }, t.options.delay.hide)) : t.hide()
  526. }
  527. ,
  528. r.prototype.show = function() {
  529. var e = m.Event("show.bs." + this.type);
  530. if (this.hasContent() && this.enabled) {
  531. this.$element.trigger(e);
  532. var t = m.contains(document.documentElement, this.$element[0]);
  533. if (e.isDefaultPrevented() || !t)
  534. return;
  535. var i = this
  536. , n = this.tip()
  537. , r = this.getUID(this.type);
  538. this.setContent(),
  539. n.attr("id", r),
  540. this.$element.attr("aria-describedby", r),
  541. this.options.animation && n.addClass("fade");
  542. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  543. , a = /\s?auto?\s?/i
  544. , s = a.test(o);
  545. s && (o = o.replace(a, "") || "top"),
  546. n.detach().css({
  547. top: 0,
  548. left: 0,
  549. display: "block"
  550. }).addClass(o).data("bs." + this.type, this),
  551. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  552. var l = this.getPosition()
  553. , c = n[0].offsetWidth
  554. , h = n[0].offsetHeight;
  555. if (s) {
  556. var u = o
  557. , d = this.$element.parent()
  558. , p = this.getPosition(d);
  559. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  560. n.removeClass(u).addClass(o)
  561. }
  562. var f = this.getCalculatedOffset(o, l, c, h);
  563. this.applyPlacement(f, o);
  564. var g = function() {
  565. i.$element.trigger("shown.bs." + i.type),
  566. i.hoverState = null
  567. };
  568. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  569. }
  570. }
  571. ,
  572. r.prototype.applyPlacement = function(e, t) {
  573. var i = this.tip()
  574. , n = i[0].offsetWidth
  575. , r = i[0].offsetHeight
  576. , o = parseInt(i.css("margin-top"), 10)
  577. , a = parseInt(i.css("margin-left"), 10);
  578. isNaN(o) && (o = 0),
  579. isNaN(a) && (a = 0),
  580. e.top = e.top + o,
  581. e.left = e.left + a,
  582. m.offset.setOffset(i[0], m.extend({
  583. using: function(e) {
  584. i.css({
  585. top: Math.round(e.top),
  586. left: Math.round(e.left)
  587. })
  588. }
  589. }, e), 0),
  590. i.addClass("in");
  591. var s = i[0].offsetWidth
  592. , l = i[0].offsetHeight;
  593. "top" == t && l != r && (e.top = e.top + r - l);
  594. var c = this.getViewportAdjustedDelta(t, e, s, l);
  595. c.left ? e.left += c.left : e.top += c.top;
  596. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  597. , u = c.left ? "left" : "top"
  598. , d = c.left ? "offsetWidth" : "offsetHeight";
  599. i.offset(e),
  600. this.replaceArrow(h, i[0][d], u)
  601. }
  602. ,
  603. r.prototype.replaceArrow = function(e, t, i) {
  604. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  605. }
  606. ,
  607. r.prototype.setContent = function() {
  608. var e = this.tip()
  609. , t = this.getTitle();
  610. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  611. e.removeClass("fade in top bottom left right")
  612. }
  613. ,
  614. r.prototype.hide = function() {
  615. function e() {
  616. "in" != t.hoverState && i.detach(),
  617. t.$element.trigger("hidden.bs." + t.type)
  618. }
  619. var t = this
  620. , i = this.tip()
  621. , n = m.Event("hide.bs." + this.type);
  622. if (this.$element.removeAttr("aria-describedby"),
  623. this.$element.trigger(n),
  624. !n.isDefaultPrevented())
  625. return i.removeClass("in"),
  626. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  627. this.hoverState = null,
  628. this
  629. }
  630. ,
  631. r.prototype.fixTitle = function() {
  632. var e = this.$element;
  633. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  634. }
  635. ,
  636. r.prototype.hasContent = function() {
  637. return this.getTitle()
  638. }
  639. ,
  640. r.prototype.getPosition = function(e) {
  641. var t = (e = e || this.$element)[0]
  642. , i = "BODY" == t.tagName;
  643. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  644. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  645. width: i ? m(window).width() : e.outerWidth(),
  646. height: i ? m(window).height() : e.outerHeight()
  647. }, i ? {
  648. top: 0,
  649. left: 0
  650. } : e.offset())
  651. }
  652. ,
  653. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  654. return "bottom" == e ? {
  655. top: t.top + t.height,
  656. left: t.left + t.width / 2 - i / 2
  657. } : "top" == e ? {
  658. top: t.top - n,
  659. left: t.left + t.width / 2 - i / 2
  660. } : "left" == e ? {
  661. top: t.top + t.height / 2 - n / 2,
  662. left: t.left - i
  663. } : {
  664. top: t.top + t.height / 2 - n / 2,
  665. left: t.left + t.width
  666. }
  667. }
  668. ,
  669. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  670. var r = {
  671. top: 0,
  672. left: 0
  673. };
  674. if (!this.$viewport)
  675. return r;
  676. var o = this.options.viewport && this.options.viewport.padding || 0
  677. , a = this.getPosition(this.$viewport);
  678. if (/right|left/.test(e)) {
  679. var s = t.top - o - a.scroll
  680. , l = t.top + o - a.scroll + n;
  681. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  682. } else {
  683. var c = t.left - o
  684. , h = t.left + o + i;
  685. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  686. }
  687. return r
  688. }
  689. ,
  690. r.prototype.getTitle = function() {
  691. var e = this.$element
  692. , t = this.options;
  693. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  694. }
  695. ,
  696. r.prototype.getUID = function(e) {
  697. for (; e += ~~(1e6 * Math.random()),
  698. document.getElementById(e); )
  699. ;
  700. return e
  701. }
  702. ,
  703. r.prototype.tip = function() {
  704. return this.$tip = this.$tip || m(this.options.template)
  705. }
  706. ,
  707. r.prototype.arrow = function() {
  708. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  709. }
  710. ,
  711. r.prototype.validate = function() {
  712. this.$element[0].parentNode || (this.hide(),
  713. this.$element = null,
  714. this.options = null)
  715. }
  716. ,
  717. r.prototype.enable = function() {
  718. this.enabled = !0
  719. }
  720. ,
  721. r.prototype.disable = function() {
  722. this.enabled = !1
  723. }
  724. ,
  725. r.prototype.toggleEnabled = function() {
  726. this.enabled = !this.enabled
  727. }
  728. ,
  729. r.prototype.toggle = function(e) {
  730. var t = this;
  731. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  732. m(e.currentTarget).data("bs." + this.type, t))),
  733. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  734. }
  735. ,
  736. r.prototype.destroy = function() {
  737. clearTimeout(this.timeout),
  738. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  739. }
  740. ;
  741. var e = m.fn.tooltip;
  742. m.fn.tooltip = function(n) {
  743. return this.each(function() {
  744. var e = m(this)
  745. , t = e.data("bs.tooltip")
  746. , i = "object" == typeof n && n;
  747. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  748. "string" == typeof n && t[n]())
  749. })
  750. }
  751. ,
  752. m.fn.tooltip.Constructor = r,
  753. m.fn.tooltip.noConflict = function() {
  754. return m.fn.tooltip = e,
  755. this
  756. }
  757. }(jQuery),
  758. function(e, t, i) {
  759. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  760. }(0, this, function() {
  761. "use strict";
  762. function Keen() {
  763. return _init.apply(this, arguments)
  764. }
  765. function _init(e) {
  766. if (_isUndefined(e))
  767. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  768. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  769. throw new Error("Please provide a projectId");
  770. this.configure(e)
  771. }
  772. function _extend(e) {
  773. for (var t = 1; t < arguments.length; t++)
  774. for (var i in arguments[t])
  775. e[i] = arguments[t][i];
  776. return e
  777. }
  778. function _isUndefined(e) {
  779. return void 0 === e
  780. }
  781. function _type(e) {
  782. var t = e && e.constructor ? e.constructor.toString() : void 0;
  783. return t ? t.match(/function (.*)\(/)[1] : "Null"
  784. }
  785. function _each(e, t, i) {
  786. var n;
  787. if (!e)
  788. return 0;
  789. if (i = i || e,
  790. "array" === _type(e)) {
  791. for (n = 0; n < e.length; n++)
  792. if (!1 === t.call(i, e[n], n, e))
  793. return 0
  794. } else
  795. for (n in e)
  796. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  797. return 0;
  798. return 1
  799. }
  800. function _parse_params(e) {
  801. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  802. return decodeURIComponent(e.replace(n, " "))
  803. }, a = e.split("?")[1]; t = r.exec(a); )
  804. i[o(t[1])] = o(t[2]);
  805. return i
  806. }
  807. function _set_protocol(e) {
  808. switch (e) {
  809. case "http":
  810. return "http";
  811. case "auto":
  812. return location.protocol.replace(/:/g, "");
  813. case "https":
  814. case void 0:
  815. default:
  816. return "https"
  817. }
  818. }
  819. function _set_request_type(e) {
  820. var t = e || "jsonp"
  821. , i = !1;
  822. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  823. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  824. }
  825. function _build_url(e) {
  826. return this.client.endpoint + "/projects/" + this.client.projectId + e
  827. }
  828. function _uploadEvent(e, t, i, n, r) {
  829. var o = _build_url.apply(this, ["/events/" + e])
  830. , a = {};
  831. for (var s in i = !1 !== i,
  832. this.client.globalProperties && (a = this.client.globalProperties(e)),
  833. t)
  834. t.hasOwnProperty(s) && (a[s] = t[s]);
  835. switch (this.client.requestType) {
  836. case "xhr":
  837. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  838. break;
  839. case "jsonp":
  840. var l = JSON.stringify(a)
  841. , c = Keen.Base64.encode(l);
  842. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  843. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  844. break;
  845. case "beacon":
  846. l = JSON.stringify(a),
  847. c = Keen.Base64.encode(l);
  848. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  849. o += "&c=clv1",
  850. _request.beacon.apply(this, [o, null, n, r])
  851. }
  852. }
  853. Keen.prototype.configure = function(e) {
  854. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  855. e.protocol = _set_protocol(e.protocol),
  856. e.requestType = _set_request_type(e.requestType),
  857. this.client = {
  858. projectId: e.projectId,
  859. writeKey: e.writeKey,
  860. readKey: e.readKey,
  861. globalProperties: null,
  862. endpoint: e.protocol + "://" + e.host,
  863. requestType: e.requestType
  864. },
  865. Keen.trigger("client", this, e),
  866. this.trigger("ready"),
  867. this
  868. }
  869. ;
  870. var _request = {
  871. xhr: function(e, t, i, n, r, o, a, s) {
  872. if (!r)
  873. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  874. var l = new XMLHttpRequest;
  875. if (l.onreadystatechange = function() {
  876. if (4 == l.readyState)
  877. if (200 <= l.status && l.status < 300) {
  878. var e;
  879. try {
  880. e = JSON.parse(l.responseText)
  881. } catch (e) {
  882. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  883. s && s(l, e)
  884. }
  885. a && e && a(e)
  886. } else
  887. Keen.log("HTTP request failed."),
  888. s && s(l, null)
  889. }
  890. ,
  891. l.open(e, t, o),
  892. r && l.setRequestHeader("Authorization", r),
  893. n && l.setRequestHeader("Content-Type", "application/json"),
  894. i)
  895. for (var c in i)
  896. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  897. var h = n ? JSON.stringify(n) : null;
  898. l.send(h)
  899. },
  900. jsonp: function(e, t, i, n) {
  901. if (!t)
  902. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  903. if (t && e.indexOf("api_key") < 0) {
  904. var r = 0 < e.indexOf("?") ? "&" : "?";
  905. e = e + r + "api_key=" + t
  906. }
  907. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  908. o += "a";
  909. var a = !1;
  910. window[o] = function(e) {
  911. a = !0,
  912. i && e && i(e),
  913. window[o] = void 0
  914. }
  915. ,
  916. e = e + "&jsonp=" + o;
  917. var s = document.createElement("script");
  918. s.id = "keen-jsonp",
  919. s.src = e,
  920. document.getElementsByTagName("head")[0].appendChild(s),
  921. s.onreadystatechange = function() {
  922. !1 === a && "loaded" === this.readyState && (a = !0,
  923. n && n())
  924. }
  925. ,
  926. s.onerror = function() {
  927. !1 === a && (a = !0,
  928. n && n())
  929. }
  930. },
  931. beacon: function(e, t, i, n) {
  932. if (t && e.indexOf("api_key") < 0) {
  933. var r = 0 < e.indexOf("?") ? "&" : "?";
  934. e = e + r + "api_key=" + t
  935. }
  936. var o = document.createElement("img");
  937. o.onload = function() {
  938. if (!0,
  939. "naturalHeight"in this) {
  940. if (this.naturalHeight + this.naturalWidth === 0)
  941. return void this.onerror()
  942. } else if (this.width + this.height === 0)
  943. return void this.onerror();
  944. i && i({
  945. created: !0
  946. })
  947. }
  948. ,
  949. o.onerror = function() {
  950. !0,
  951. n && n()
  952. }
  953. ,
  954. o.src = e
  955. }
  956. }
  957. , Events = Keen.Events = {
  958. on: function(e, t) {
  959. return this.listeners || (this.listeners = {}),
  960. (this.listeners[e] || (this.listeners[e] = [])).push({
  961. callback: t
  962. }),
  963. this
  964. },
  965. off: function(e, t) {
  966. if (!e && !t)
  967. return this.listeners = void 0,
  968. delete this.listeners,
  969. this;
  970. for (var i = this.listeners[e] || [], n = i.length; n--; )
  971. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  972. t && 0 != i.length || (this.listeners[e] = void 0,
  973. delete this.listeners[e]);
  974. return this
  975. },
  976. trigger: function(e) {
  977. if (!this.listeners)
  978. return this;
  979. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  980. i[n].callback.apply(this, t);
  981. return this
  982. }
  983. };
  984. _extend(Keen.prototype, Events),
  985. _extend(Keen, Events),
  986. Keen.loaded = !0,
  987. Keen.utils = {
  988. each: _each,
  989. extend: _extend,
  990. parseParams: _parse_params
  991. },
  992. Keen.ready = function(e) {
  993. Keen.loaded ? e() : Keen.on("ready", e)
  994. }
  995. ,
  996. Keen.log = function(e) {
  997. "object" == typeof console && console.log("[Keen IO]", e)
  998. }
  999. ;
  1000. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1001. Keen.prototype.addEvent = function() {
  1002. _uploadEvent.apply(this, arguments)
  1003. }
  1004. ,
  1005. Keen.prototype.addEventSync = function(e, t, i, n) {
  1006. _uploadEvent.apply(this, [e, t, !1, i, n])
  1007. }
  1008. ,
  1009. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1010. var o = e
  1011. , a = o.metaKey
  1012. , s = o.target
  1013. , l = !1
  1014. , c = function() {};
  1015. return void 0 === n && (n = 500),
  1016. "A" === s.nodeName ? c = function() {
  1017. a || l || (l = !0,
  1018. window.location = s.href)
  1019. }
  1020. : "FORM" === s.nodeName && (c = function() {
  1021. l || (l = !0,
  1022. s.submit())
  1023. }
  1024. ),
  1025. r && (c = function() {
  1026. l || (l = !0,
  1027. r())
  1028. }
  1029. ),
  1030. _uploadEvent.call(this, t, i, c, c),
  1031. setTimeout(function() {
  1032. c()
  1033. }, n),
  1034. !!a && void 0
  1035. }
  1036. ,
  1037. Keen.prototype.setGlobalProperties = function(e) {
  1038. if (!this.client)
  1039. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1040. if (!e || "function" != typeof e)
  1041. throw new Error("Invalid value for global properties: " + e);
  1042. this.client.globalProperties = e
  1043. }
  1044. ,
  1045. Keen.Base64 = {
  1046. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1047. encode: function(e) {
  1048. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1049. for (e = this.utf8.encode(e); c < e.length; )
  1050. t = e.charCodeAt(c++),
  1051. i = e.charCodeAt(c++),
  1052. n = e.charCodeAt(c++),
  1053. r = t >> 2,
  1054. o = (3 & t) << 4 | i >> 4,
  1055. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1056. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1057. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1058. return l
  1059. },
  1060. decode: function(e) {
  1061. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1062. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1063. t = c.indexOf(e.charAt(l++)),
  1064. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1065. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1066. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1067. return this.utf8.decode(s)
  1068. },
  1069. utf8: {
  1070. encode: function(e) {
  1071. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1072. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1073. return i
  1074. },
  1075. decode: function(e) {
  1076. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1077. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1078. return i
  1079. }
  1080. }
  1081. },
  1082. "object" != typeof JSON && (JSON = {}),
  1083. function() {
  1084. function f(e) {
  1085. return e < 10 ? "0" + e : e
  1086. }
  1087. function quote(e) {
  1088. return escapable.lastIndex = 0,
  1089. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1090. var t = meta[e];
  1091. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1092. }) + '"' : '"' + e + '"'
  1093. }
  1094. function str(e, t) {
  1095. var i, n, r, o, a, s = gap, l = t[e];
  1096. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1097. "function" == typeof rep && (l = rep.call(t, e, l)),
  1098. typeof l) {
  1099. case "string":
  1100. return quote(l);
  1101. case "number":
  1102. return isFinite(l) ? String(l) : "null";
  1103. case "boolean":
  1104. case "null":
  1105. return String(l);
  1106. case "object":
  1107. if (!l)
  1108. return "null";
  1109. if (gap += indent,
  1110. a = [],
  1111. "[object Array]" === Object.prototype.toString.apply(l)) {
  1112. for (o = l.length,
  1113. i = 0; i < o; i += 1)
  1114. a[i] = str(i, l) || "null";
  1115. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1116. gap = s,
  1117. r
  1118. }
  1119. if (rep && "object" == typeof rep)
  1120. for (o = rep.length,
  1121. i = 0; i < o; i += 1)
  1122. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1123. else
  1124. for (n in l)
  1125. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1126. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1127. gap = s,
  1128. r
  1129. }
  1130. }
  1131. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1132. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1133. }
  1134. ,
  1135. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1136. return this.valueOf()
  1137. }
  1138. );
  1139. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1140. "\b": "\\b",
  1141. "\t": "\\t",
  1142. "\n": "\\n",
  1143. "\f": "\\f",
  1144. "\r": "\\r",
  1145. '"': '\\"',
  1146. "\\": "\\\\"
  1147. }, rep;
  1148. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1149. var n;
  1150. if (indent = gap = "",
  1151. "number" == typeof i)
  1152. for (n = 0; n < i; n += 1)
  1153. indent += " ";
  1154. else
  1155. "string" == typeof i && (indent = i);
  1156. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1157. throw new Error("JSON.stringify");
  1158. return str("", {
  1159. "": e
  1160. })
  1161. }
  1162. ),
  1163. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1164. function walk(e, t) {
  1165. var i, n, r = e[t];
  1166. if (r && "object" == typeof r)
  1167. for (i in r)
  1168. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1169. return reviver.call(e, t, r)
  1170. }
  1171. var j;
  1172. if (text = String(text),
  1173. cx.lastIndex = 0,
  1174. cx.test(text) && (text = text.replace(cx, function(e) {
  1175. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1176. })),
  1177. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1178. return j = eval("(" + text + ")"),
  1179. "function" == typeof reviver ? walk({
  1180. "": j
  1181. }, "") : j;
  1182. throw new SyntaxError("JSON.parse")
  1183. }
  1184. )
  1185. }(),
  1186. Hh = Keen.utils,
  1187. Ih = function(i) {
  1188. function e(e) {
  1189. for (u = 1; e = n.shift(); )
  1190. e()
  1191. }
  1192. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1193. return r[l] && r[l](s, t = function() {
  1194. r.removeEventListener(s, t, !1),
  1195. e()
  1196. }
  1197. , !1),
  1198. a && r.attachEvent(c, t = function() {
  1199. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1200. e())
  1201. }
  1202. ),
  1203. i = a ? function(t) {
  1204. self != top ? u ? t() : n.push(t) : function() {
  1205. try {
  1206. o.doScroll("left")
  1207. } catch (e) {
  1208. return setTimeout(function() {
  1209. i(t)
  1210. }, 50)
  1211. }
  1212. t()
  1213. }()
  1214. }
  1215. : function(e) {
  1216. u ? e() : n.push(e)
  1217. }
  1218. }
  1219. ,
  1220. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1221. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1222. if (loaded && cached) {
  1223. for (var instance in clients = cached.clients || {},
  1224. ready = cached.ready || [],
  1225. clients)
  1226. if (clients.hasOwnProperty(instance)) {
  1227. var client = clients[instance];
  1228. for (var method in Keen.prototype)
  1229. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1230. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1231. ,
  1232. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1233. ,
  1234. client._config && (client.configure.call(client, client._config),
  1235. delete client._config),
  1236. client._setGlobalProperties) {
  1237. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1238. client.setGlobalProperties.apply(client, globals[i]);
  1239. delete client._setGlobalProperties
  1240. }
  1241. if (client._addEvent) {
  1242. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1243. client.addEvent.apply(client, queue[i]);
  1244. delete client._addEvent
  1245. }
  1246. var callback = client._on || [];
  1247. if (client._on) {
  1248. for (var i = 0; i < callback.length; i++)
  1249. client.on.apply(client, callback[i]);
  1250. client.trigger("ready"),
  1251. delete client._on
  1252. }
  1253. }
  1254. for (var i = 0; i < ready.length; i++) {
  1255. var callback = ready[i];
  1256. Keen.on("ready", function() {
  1257. callback()
  1258. })
  1259. }
  1260. }
  1261. return Keen.loaded && setTimeout(function() {
  1262. Keen.utils.domready(function() {
  1263. Keen.trigger("ready")
  1264. })
  1265. }, 0),
  1266. Keen
  1267. }),
  1268. function() {
  1269. var i = window.analytics = window.analytics || [];
  1270. if (!i.initialize) {
  1271. if (i.invoked)
  1272. return window.console && console.error && console.error("Segment snippet included twice.");
  1273. i.invoked = !0,
  1274. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1275. i.factory = function(t) {
  1276. return function() {
  1277. var e = Array.prototype.slice.call(arguments);
  1278. return e.unshift(t),
  1279. i.push(e),
  1280. i
  1281. }
  1282. }
  1283. ;
  1284. for (var e = 0; e < i.methods.length; e++) {
  1285. var t = i.methods[e];
  1286. i[t] = i.factory(t)
  1287. }
  1288. i.load = function(e) {
  1289. var t = document.createElement("script");
  1290. t.type = "text/javascript",
  1291. t.async = !0,
  1292. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1293. var i = document.getElementsByTagName("script")[0];
  1294. i.parentNode.insertBefore(t, i)
  1295. }
  1296. ,
  1297. i.SNIPPET_VERSION = "4.0.0"
  1298. }
  1299. }(),
  1300. function(i, u) {
  1301. "use strict";
  1302. var d = "function"
  1303. , p = "undefined"
  1304. , f = "object"
  1305. , e = "major"
  1306. , t = "model"
  1307. , n = "name"
  1308. , r = "type"
  1309. , o = "vendor"
  1310. , a = "version"
  1311. , s = "architecture"
  1312. , l = "console"
  1313. , c = "mobile"
  1314. , h = "tablet"
  1315. , g = {
  1316. has: function(e, t) {
  1317. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1318. },
  1319. lowerize: function(e) {
  1320. return e.toLowerCase()
  1321. }
  1322. }
  1323. , m = {
  1324. rgx: function() {
  1325. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1326. var c = l[s]
  1327. , h = l[s + 1];
  1328. if (typeof e == p)
  1329. for (n in e = {},
  1330. h)
  1331. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1332. for (t = i = 0; t < c.length; t++)
  1333. if (o = c[t].exec(this.getUA())) {
  1334. for (n = 0; n < h.length; n++)
  1335. a = o[++i],
  1336. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1337. break
  1338. }
  1339. if (o)
  1340. break
  1341. }
  1342. return e
  1343. },
  1344. str: function(e, t) {
  1345. for (var i in t)
  1346. if (typeof t[i] == f && 0 < t[i].length) {
  1347. for (var n = 0; n < t[i].length; n++)
  1348. if (g.has(t[i][n], e))
  1349. return "?" === i ? u : i
  1350. } else if (g.has(t[i], e))
  1351. return "?" === i ? u : i;
  1352. return e
  1353. }
  1354. }
  1355. , v = {
  1356. browser: {
  1357. oldsafari: {
  1358. major: {
  1359. 1: ["/8", "/1", "/3"],
  1360. 2: "/4",
  1361. "?": "/"
  1362. },
  1363. version: {
  1364. "1.0": "/8",
  1365. 1.2: "/1",
  1366. 1.3: "/3",
  1367. "2.0": "/412",
  1368. "2.0.2": "/416",
  1369. "2.0.3": "/417",
  1370. "2.0.4": "/419",
  1371. "?": "/"
  1372. }
  1373. }
  1374. },
  1375. device: {
  1376. sprint: {
  1377. model: {
  1378. "Evo Shift 4G": "7373KT"
  1379. },
  1380. vendor: {
  1381. HTC: "APA",
  1382. Sprint: "Sprint"
  1383. }
  1384. }
  1385. },
  1386. os: {
  1387. windows: {
  1388. version: {
  1389. ME: "4.90",
  1390. "NT 3.11": "NT3.51",
  1391. "NT 4.0": "NT4.0",
  1392. 2e3: "NT 5.0",
  1393. XP: ["NT 5.1", "NT 5.2"],
  1394. Vista: "NT 6.0",
  1395. 7: "NT 6.1",
  1396. 8: "NT 6.2",
  1397. 8.1: "NT 6.3",
  1398. RT: "ARM"
  1399. }
  1400. }
  1401. }
  1402. }
  1403. , y = {
  1404. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1405. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1406. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1407. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1408. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [n, a]]
  1409. }
  1410. , A = function(e) {
  1411. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1412. return this instanceof A ? (this.getBrowser = function() {
  1413. return m.rgx.apply(this, y.browser)
  1414. }
  1415. ,
  1416. this.getCPU = function() {
  1417. return m.rgx.apply(this, y.cpu)
  1418. }
  1419. ,
  1420. this.getDevice = function() {
  1421. return m.rgx.apply(this, y.device)
  1422. }
  1423. ,
  1424. this.getEngine = function() {
  1425. return m.rgx.apply(this, y.engine)
  1426. }
  1427. ,
  1428. this.getOS = function() {
  1429. return m.rgx.apply(this, y.os)
  1430. }
  1431. ,
  1432. this.getResult = function() {
  1433. return {
  1434. ua: this.getUA(),
  1435. browser: this.getBrowser(),
  1436. engine: this.getEngine(),
  1437. os: this.getOS(),
  1438. device: this.getDevice(),
  1439. cpu: this.getCPU()
  1440. }
  1441. }
  1442. ,
  1443. this.getUA = function() {
  1444. return t
  1445. }
  1446. ,
  1447. this.setUA = function(e) {
  1448. return t = e,
  1449. this
  1450. }
  1451. ,
  1452. void this.setUA(t)) : new A(e).getResult()
  1453. };
  1454. if (typeof exports != p)
  1455. typeof module != p && module.exports && (exports = module.exports = A),
  1456. exports.UAParser = A;
  1457. else if (i.UAParser = A,
  1458. typeof define == d && define.amd && define(function() {
  1459. return A
  1460. }),
  1461. typeof i.jQuery != p) {
  1462. var C = i.jQuery
  1463. , I = new A;
  1464. C.ua = I.getResult(),
  1465. C.ua.get = function() {
  1466. return I.getUA()
  1467. }
  1468. ,
  1469. C.ua.set = function(e) {
  1470. I.setUA(e);
  1471. var t = I.getResult();
  1472. for (var i in t)
  1473. C.ua[i] = t[i]
  1474. }
  1475. }
  1476. }(this),
  1477. window.Modernizr = function(e, t) {
  1478. function i(e, t) {
  1479. return typeof e === t
  1480. }
  1481. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1482. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1483. return t in e && i(e.constructor.prototype[t], "undefined")
  1484. }
  1485. : function(e, t) {
  1486. return p.call(e, t)
  1487. }
  1488. ,
  1489. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1490. var r = this;
  1491. if ("function" != typeof r)
  1492. throw new TypeError;
  1493. var o = d.call(arguments, 1)
  1494. , a = function() {
  1495. if (this instanceof a) {
  1496. function e() {}
  1497. e.prototype = r.prototype;
  1498. var t = new e
  1499. , i = r.apply(t, o.concat(d.call(arguments)));
  1500. return Object(i) === i ? i : t
  1501. }
  1502. return r.apply(n, o.concat(d.call(arguments)))
  1503. };
  1504. return a
  1505. }
  1506. ),
  1507. h.webgl = function() {
  1508. return !!e.WebGLRenderingContext
  1509. }
  1510. ,
  1511. h)
  1512. r(h, f) && (n = f.toLowerCase(),
  1513. a[n] = h[f](),
  1514. u.push((a[n] ? "" : "no-") + n));
  1515. return a.addTest = function(e, t) {
  1516. if ("object" == typeof e)
  1517. for (var i in e)
  1518. r(e, i) && a.addTest(i, e[i]);
  1519. else {
  1520. if (e = e.toLowerCase(),
  1521. void 0 !== a[e])
  1522. return a;
  1523. t = "function" == typeof t ? t() : t,
  1524. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1525. a[e] = t
  1526. }
  1527. return a
  1528. }
  1529. ,
  1530. o = "",
  1531. c.cssText = o,
  1532. l = null,
  1533. a._version = "2.8.2",
  1534. a
  1535. }(this, this.document),
  1536. function(xe, e, Se) {
  1537. "use strict";
  1538. function Me(s, e, n) {
  1539. function a(e) {
  1540. var t = Q.length;
  1541. if (G.old = xe.extend({}, G),
  1542. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1543. Y = W[F.horizontal ? "width" : "height"](),
  1544. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1545. Q.length = 0,
  1546. G.start = 0,
  1547. G.end = nt(z - H, 0),
  1548. le) {
  1549. $.length,
  1550. J = U.children(F.itemSelector),
  1551. $.length = 0;
  1552. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1553. z = 0,
  1554. J.each(function(e, t) {
  1555. var i = xe(t)
  1556. , n = t.getBoundingClientRect()
  1557. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1558. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1559. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1560. , s = r + o + a
  1561. , l = !o || !a
  1562. , c = {};
  1563. c.el = t,
  1564. c.size = l ? r : s,
  1565. c.half = c.size / 2,
  1566. c.start = z + (l ? o : 0),
  1567. c.center = c.start - it(H / 2 - c.size / 2),
  1568. c.end = c.start - H + c.size,
  1569. e || (z += u),
  1570. z += s,
  1571. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1572. e === g && (c.end += d,
  1573. z += d,
  1574. f = l ? a : 0),
  1575. $.push(c),
  1576. h = c
  1577. }),
  1578. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1579. z -= f,
  1580. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1581. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1582. }
  1583. if (G.center = it(G.end / 2 + G.start / 2),
  1584. v(),
  1585. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1586. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1587. X.end = Y - q,
  1588. _e || c()),
  1589. !V && 0 < H) {
  1590. var n = G.start
  1591. , r = "";
  1592. if (le)
  1593. xe.each($, function(e, t) {
  1594. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1595. Q.push(n),
  1596. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1597. });
  1598. else
  1599. for (; n - H < G.end; )
  1600. Q.push(n),
  1601. n += H;
  1602. if (Z[0] && t !== Q.length) {
  1603. for (var o = 0; o < Q.length; o++)
  1604. r += F.pageBuilder.call(B, o);
  1605. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1606. }
  1607. }
  1608. if (ee.slideeSize = z,
  1609. ee.frameSize = H,
  1610. ee.sbSize = Y,
  1611. ee.handleSize = q,
  1612. le) {
  1613. e && null != F.startAt && (m(F.startAt),
  1614. B[se ? "toCenter" : "toStart"](F.startAt));
  1615. var a = $[ee.activeItem];
  1616. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1617. } else
  1618. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1619. L("load")
  1620. }
  1621. function l(e, t, i) {
  1622. if (le && Ie.released && !i) {
  1623. var n = d(e)
  1624. , r = e > G.start && e < G.end;
  1625. se ? (r && (e = $[n.centerItem].center),
  1626. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1627. }
  1628. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1629. Ae.start = +new Date,
  1630. Ae.time = 0,
  1631. Ae.from = G.cur,
  1632. Ae.to = e,
  1633. Ae.delta = e - G.cur,
  1634. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1635. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1636. Ie.tweese = 0,
  1637. e !== G.dest && (G.dest = e,
  1638. L("change"),
  1639. _e || o()),
  1640. g(),
  1641. v(),
  1642. p(),
  1643. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1644. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1645. L("activePage", ye.page))
  1646. }
  1647. function o() {
  1648. if (B.initialized) {
  1649. if (!_e)
  1650. return _e = Ge(o),
  1651. void (Ie.released && L("moveStart"));
  1652. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1653. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1654. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1655. Ae.to === G.cur ? (G.cur = Ae.to,
  1656. Ie.tweese = _e = 0) : _e = Ge(o),
  1657. L("move"),
  1658. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1659. !_e && Ie.released && L("moveEnd"),
  1660. c()
  1661. }
  1662. }
  1663. function c() {
  1664. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1665. X.cur = Fe(it(X.cur), X.start, X.end),
  1666. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1667. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1668. }
  1669. function t() {
  1670. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1671. Te = Ie.init ? Ge(t) : 0,
  1672. Ce.now = +new Date,
  1673. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1674. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1675. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1676. Ce.lastTime = Ce.now
  1677. }
  1678. function i(e, t, i) {
  1679. if ("boolean" === Re(t) && (i = t,
  1680. t = Se),
  1681. t === Se)
  1682. l(G[e], i);
  1683. else {
  1684. if (se && "center" !== e)
  1685. return;
  1686. var n = B.getPos(t);
  1687. n && l(n[e], i, !se)
  1688. }
  1689. }
  1690. function h(e) {
  1691. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1692. }
  1693. function u(e) {
  1694. return h(De(e) && e < 0 ? e + $.length : e)
  1695. }
  1696. function m(e, t) {
  1697. var i = h(e);
  1698. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1699. J.eq(i).addClass(F.activeClass),
  1700. ye.active = ee.activeItem = i,
  1701. p(),
  1702. L("active", i)),
  1703. i)
  1704. }
  1705. function d(e) {
  1706. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1707. var t = {}
  1708. , i = ae ? 0 : H / 2;
  1709. if (!V)
  1710. for (var n = 0, r = Q.length; n < r; n++) {
  1711. if (e >= G.end || n === Q.length - 1) {
  1712. t.activePage = Q.length - 1;
  1713. break
  1714. }
  1715. if (e <= Q[n] + i) {
  1716. t.activePage = n;
  1717. break
  1718. }
  1719. }
  1720. if (le) {
  1721. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1722. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1723. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1724. l === c - 1 || e <= $[l].end + $[l].half) {
  1725. a = l;
  1726. break
  1727. }
  1728. t.firstItem = De(o) ? o : 0,
  1729. t.centerItem = De(s) ? s : t.firstItem,
  1730. t.lastItem = De(a) ? a : t.centerItem
  1731. }
  1732. return t
  1733. }
  1734. function v(e) {
  1735. xe.extend(ee, d(e))
  1736. }
  1737. function p() {
  1738. var e = G.dest <= G.start
  1739. , t = G.dest >= G.end
  1740. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1741. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1742. ge.is("button,input") && ge.prop("disabled", e),
  1743. me.is("button,input") && me.prop("disabled", t),
  1744. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1745. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1746. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1747. de.is("button,input") && de.prop("disabled", e),
  1748. ue.is("button,input") && ue.prop("disabled", t)),
  1749. le && null != ee.activeItem) {
  1750. var n = 0 === ee.activeItem
  1751. , r = ee.activeItem >= $.length - 1
  1752. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1753. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1754. pe.is("button,input") && pe.prop("disabled", n),
  1755. fe.is("button,input") && fe.prop("disabled", r),
  1756. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1757. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1758. }
  1759. }
  1760. function r(e, t, i) {
  1761. if (e = u(e),
  1762. t = u(t),
  1763. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1764. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1765. var n = e < t ? e : i ? t : t - 1
  1766. , r = t < e ? e : i ? t + 1 : t
  1767. , o = t < e;
  1768. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1769. a()
  1770. }
  1771. }
  1772. function f(e, t) {
  1773. for (var i = 0, n = ve[e].length; i < n; i++)
  1774. if (ve[e][i] === t)
  1775. return i;
  1776. return -1
  1777. }
  1778. function g() {
  1779. Ie.released && !B.isPaused && B.resume()
  1780. }
  1781. function y(e) {
  1782. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1783. }
  1784. function A() {
  1785. Ie.history[0] = Ie.history[1],
  1786. Ie.history[1] = Ie.history[2],
  1787. Ie.history[2] = Ie.history[3],
  1788. Ie.history[3] = Ie.delta
  1789. }
  1790. function C(e) {
  1791. Ie.released = 0,
  1792. Ie.source = e,
  1793. Ie.slidee = "slidee" === e
  1794. }
  1795. function I(e) {
  1796. var t = "touchstart" === e.type
  1797. , i = e.data.source
  1798. , n = "slidee" === i;
  1799. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1800. C(i),
  1801. Ie.init = 0,
  1802. Ie.$source = xe(e.target),
  1803. Ie.touch = t,
  1804. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1805. Ie.initX = Ie.pointer.pageX,
  1806. Ie.initY = Ie.pointer.pageY,
  1807. Ie.initPos = n ? G.cur : X.cur,
  1808. Ie.start = +new Date,
  1809. Ie.time = 0,
  1810. Ie.path = 0,
  1811. Ie.delta = 0,
  1812. Ie.locked = 0,
  1813. Ie.history = [0, 0, 0, 0],
  1814. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1815. We.on(t ? qe : Ye, E),
  1816. B.pause(1),
  1817. (n ? U : j).addClass(F.draggedClass),
  1818. L("moveStart"),
  1819. n && (be = setInterval(A, 10)))
  1820. }
  1821. function E(e) {
  1822. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1823. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1824. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1825. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1826. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1827. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1828. Ie.released || !(Ie.path < 1)) {
  1829. if (!Ie.init) {
  1830. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1831. return _();
  1832. Ie.init = 1
  1833. }
  1834. Pe(e),
  1835. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1836. Ie.$source.on(Ze, Oe)),
  1837. Ie.released && (_(),
  1838. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1839. Ie.delta += Ie.swing,
  1840. Ie.tweese = 10 < $e(Ie.swing))),
  1841. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1842. }
  1843. }
  1844. function _() {
  1845. clearInterval(be),
  1846. Ie.released = !0,
  1847. We.off(Ie.touch ? qe : Ye, E),
  1848. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1849. setTimeout(function() {
  1850. Ie.$source.off(Ze, Oe)
  1851. }),
  1852. G.cur === G.dest && Ie.init && L("moveEnd"),
  1853. B.resume(1),
  1854. Ie.init = 0
  1855. }
  1856. function b(e) {
  1857. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1858. }
  1859. function w() {
  1860. B.stop(),
  1861. We.off("mouseup", w)
  1862. }
  1863. function T(e) {
  1864. switch (Pe(e),
  1865. this) {
  1866. case ue[0]:
  1867. case de[0]:
  1868. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1869. We.on("mouseup", w);
  1870. break;
  1871. case pe[0]:
  1872. B.prev();
  1873. break;
  1874. case fe[0]:
  1875. B.next();
  1876. break;
  1877. case ge[0]:
  1878. B.prevPage();
  1879. break;
  1880. case me[0]:
  1881. B.nextPage()
  1882. }
  1883. }
  1884. function x(e) {
  1885. e.originalEvent[He] = B;
  1886. var t = +new Date;
  1887. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1888. ot = t;
  1889. else if (F.scrollBy && G.start !== G.end) {
  1890. var i = function(e) {
  1891. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1892. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1893. le ? (Ue = +new Date,
  1894. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1895. Ee.last = Ue,
  1896. Ee.delta += Ee.curDelta,
  1897. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1898. Ee.delta %= 1),
  1899. Ee.finalDelta) : Ee.curDelta
  1900. }(e.originalEvent);
  1901. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1902. B.slideBy(F.scrollBy * i)
  1903. }
  1904. }
  1905. function S(e) {
  1906. F.clickBar && e.target === W[0] && (Pe(e),
  1907. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1908. }
  1909. function M(e) {
  1910. if (F.keyboardNavBy)
  1911. switch (e.which) {
  1912. case F.horizontal ? 37 : 38:
  1913. Pe(e),
  1914. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1915. break;
  1916. case F.horizontal ? 39 : 40:
  1917. Pe(e),
  1918. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1919. }
  1920. }
  1921. function R(e) {
  1922. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1923. }
  1924. function P() {
  1925. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1926. }
  1927. function O(e) {
  1928. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1929. }
  1930. function L(e, t) {
  1931. if (ve[e]) {
  1932. for (N = ve[e].length,
  1933. Je.length = 0,
  1934. D = 0; D < N; D++)
  1935. Je.push(ve[e][D]);
  1936. for (D = 0; D < N; D++)
  1937. Je[D].call(B, e, t)
  1938. }
  1939. }
  1940. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  1941. start: 0,
  1942. center: 0,
  1943. end: 0,
  1944. cur: 0,
  1945. dest: 0
  1946. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1947. start: 0,
  1948. end: 0,
  1949. cur: 0
  1950. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1951. firstItem: 0,
  1952. lastItem: 0,
  1953. centerItem: 0,
  1954. activeItem: null,
  1955. activePage: 0
  1956. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  1957. released: 1
  1958. }, Ee = {
  1959. last: 0,
  1960. delta: 0,
  1961. resetTime: 200
  1962. }, _e = 0, be = 0, we = 0, Te = 0;
  1963. V || (s = k[0]),
  1964. B.initialized = 0,
  1965. B.frame = s,
  1966. B.slidee = U[0],
  1967. B.pos = G,
  1968. B.rel = ee,
  1969. B.items = $,
  1970. B.pages = Q,
  1971. B.isPaused = 0,
  1972. B.options = F,
  1973. B.dragging = Ie,
  1974. B.reload = function() {
  1975. a()
  1976. }
  1977. ,
  1978. B.getPos = function(e) {
  1979. if (le) {
  1980. var t = h(e);
  1981. return -1 !== t && $[t]
  1982. }
  1983. var i = U.find(e).eq(0);
  1984. if (i[0]) {
  1985. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1986. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1987. return {
  1988. start: n,
  1989. center: n - H / 2 + r / 2,
  1990. end: n - H + r,
  1991. size: r
  1992. }
  1993. }
  1994. return !1
  1995. }
  1996. ,
  1997. B.moveBy = function(e) {
  1998. Ce.speed = e,
  1999. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2000. Ce.startPos = G.cur,
  2001. C("button"),
  2002. Ie.init = 1,
  2003. L("moveStart"),
  2004. ze(Te),
  2005. t())
  2006. }
  2007. ,
  2008. B.stop = function() {
  2009. "button" === Ie.source && (Ie.init = 0,
  2010. Ie.released = 1)
  2011. }
  2012. ,
  2013. B.prev = function() {
  2014. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2015. }
  2016. ,
  2017. B.next = function() {
  2018. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2019. }
  2020. ,
  2021. B.prevPage = function() {
  2022. B.activatePage(ee.activePage - 1)
  2023. }
  2024. ,
  2025. B.nextPage = function() {
  2026. B.activatePage(ee.activePage + 1)
  2027. }
  2028. ,
  2029. B.slideBy = function(e, t) {
  2030. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2031. }
  2032. ,
  2033. B.slideTo = function(e, t) {
  2034. l(e, t)
  2035. }
  2036. ,
  2037. B.toStart = function(e, t) {
  2038. i("start", e, t)
  2039. }
  2040. ,
  2041. B.toEnd = function(e, t) {
  2042. i("end", e, t)
  2043. }
  2044. ,
  2045. B.toCenter = function(e, t) {
  2046. i("center", e, t)
  2047. }
  2048. ,
  2049. B.getIndex = h,
  2050. B.activate = function(e, t) {
  2051. var i = m(e);
  2052. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2053. }
  2054. ,
  2055. B.activatePage = function(e, t) {
  2056. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2057. }
  2058. ,
  2059. B.resume = function(e) {
  2060. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2061. we ? we = clearTimeout(we) : L("resume"),
  2062. we = setTimeout(function() {
  2063. switch (L("cycle"),
  2064. F.cycleBy) {
  2065. case "items":
  2066. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2067. break;
  2068. case "pages":
  2069. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2070. }
  2071. }, F.cycleInterval))
  2072. }
  2073. ,
  2074. B.pause = function(e) {
  2075. e < B.isPaused || (B.isPaused = e || 100,
  2076. we && (we = clearTimeout(we),
  2077. L("pause")))
  2078. }
  2079. ,
  2080. B.toggle = function() {
  2081. B[we ? "pause" : "resume"]()
  2082. }
  2083. ,
  2084. B.set = function(e, t) {
  2085. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2086. }
  2087. ,
  2088. B.add = function(e, t) {
  2089. var i = xe(e);
  2090. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2091. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2092. a()
  2093. }
  2094. ,
  2095. B.remove = function(e) {
  2096. if (le) {
  2097. var t = u(e);
  2098. if (-1 < t) {
  2099. J.eq(t).remove();
  2100. var i = t === ee.activeItem;
  2101. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2102. a(),
  2103. i && (ye.active = null,
  2104. B.activate(ee.activeItem))
  2105. }
  2106. } else
  2107. xe(e).remove(),
  2108. a()
  2109. }
  2110. ,
  2111. B.moveAfter = function(e, t) {
  2112. r(e, t, 1)
  2113. }
  2114. ,
  2115. B.moveBefore = function(e, t) {
  2116. r(e, t)
  2117. }
  2118. ,
  2119. B.on = function(e, t) {
  2120. if ("object" === Re(e))
  2121. for (var i in e)
  2122. e.hasOwnProperty(i) && B.on(i, e[i]);
  2123. else if ("function" === Re(t))
  2124. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2125. ve[n[r]] = ve[n[r]] || [],
  2126. -1 === f(n[r], t) && ve[n[r]].push(t);
  2127. else if ("array" === Re(t))
  2128. for (var a = 0, s = t.length; a < s; a++)
  2129. B.on(e, t[a])
  2130. }
  2131. ,
  2132. B.one = function(t, i) {
  2133. B.on(t, function e() {
  2134. i.apply(B, arguments),
  2135. B.off(t, e)
  2136. })
  2137. }
  2138. ,
  2139. B.off = function(e, t) {
  2140. if (t instanceof Array)
  2141. for (var i = 0, n = t.length; i < n; i++)
  2142. B.off(e, t[i]);
  2143. else
  2144. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2145. if (ve[r[o]] = ve[r[o]] || [],
  2146. null == t)
  2147. ve[r[o]].length = 0;
  2148. else {
  2149. var s = f(r[o], t);
  2150. -1 !== s && ve[r[o]].splice(s, 1)
  2151. }
  2152. }
  2153. ,
  2154. B.destroy = function() {
  2155. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2156. We.off("keydown", M),
  2157. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2158. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2159. Z.empty(),
  2160. V || (k.off("." + He),
  2161. te.restore(),
  2162. ie.restore(),
  2163. ne.restore(),
  2164. re.restore(),
  2165. xe.removeData(s, He)),
  2166. $.length = Q.length = 0,
  2167. ye = {},
  2168. B.initialized = 0,
  2169. B
  2170. }
  2171. ,
  2172. B.init = function() {
  2173. if (!B.initialized) {
  2174. B.on(n);
  2175. var e = ["overflow", "position"]
  2176. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2177. te.save.apply(te, e),
  2178. ne.save.apply(ne, e),
  2179. ie.save.apply(ie, t),
  2180. re.save.apply(re, t);
  2181. var i = j;
  2182. return V || (i = i.add(U),
  2183. k.css("overflow", "hidden"),
  2184. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2185. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2186. i.css({
  2187. position: "absolute"
  2188. })),
  2189. F.forward && ue.on(Ke, T),
  2190. F.backward && de.on(Ke, T),
  2191. F.prev && pe.on(Ze, T),
  2192. F.next && fe.on(Ze, T),
  2193. F.prevPage && ge.on(Ze, T),
  2194. F.nextPage && me.on(Ze, T),
  2195. ce.on(Xe, x),
  2196. W[0] && W.on(Ze, S),
  2197. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2198. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2199. he.on(je, {
  2200. source: "slidee"
  2201. }, I),
  2202. j && j.on(je, {
  2203. source: "handle"
  2204. }, I),
  2205. We.on("keydown", M),
  2206. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2207. k.on("scroll." + He, Le)),
  2208. B.initialized = 1,
  2209. a(!0),
  2210. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2211. B
  2212. }
  2213. }
  2214. }
  2215. function Re(e) {
  2216. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2217. }
  2218. function Pe(e, t) {
  2219. e.preventDefault(),
  2220. t && e.stopPropagation()
  2221. }
  2222. function Oe(e) {
  2223. Pe(e, 1),
  2224. xe(this).off(e.type, Oe)
  2225. }
  2226. function Le() {
  2227. this.scrollLeft = 0,
  2228. this.scrollTop = 0
  2229. }
  2230. function De(e) {
  2231. return !isNaN(parseFloat(e)) && isFinite(e)
  2232. }
  2233. function Ne(e, t) {
  2234. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2235. }
  2236. function Fe(e, t, i) {
  2237. return e < t ? t : i < e ? i : e
  2238. }
  2239. function Be(t) {
  2240. var i = {
  2241. style: {},
  2242. save: function() {
  2243. if (t && t.nodeType) {
  2244. for (var e = 0; e < arguments.length; e++)
  2245. i.style[arguments[e]] = t.style[arguments[e]];
  2246. return i
  2247. }
  2248. },
  2249. restore: function() {
  2250. if (t && t.nodeType) {
  2251. for (var e in i.style)
  2252. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2253. return i
  2254. }
  2255. }
  2256. };
  2257. return i
  2258. }
  2259. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2260. function t(e) {
  2261. for (var t = 0, i = r.length; t < i; t++) {
  2262. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2263. if (null != o.style[n])
  2264. return n
  2265. }
  2266. }
  2267. We.on(Xe, function(e) {
  2268. var t = e.originalEvent[He]
  2269. , i = +new Date;
  2270. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2271. }),
  2272. function(t) {
  2273. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2274. var t = (new Date).getTime()
  2275. , i = Math.max(0, 16 - (t - r))
  2276. , n = setTimeout(e, i);
  2277. return r = t,
  2278. n
  2279. }
  2280. ;
  2281. var r = (new Date).getTime()
  2282. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2283. ze = function(e) {
  2284. i.call(t, e)
  2285. }
  2286. }(window),
  2287. r = ["", "webkit", "moz", "ms", "o"],
  2288. o = document.createElement("div"),
  2289. Ve = t("transform"),
  2290. ke = t("perspective") ? "translateZ(0) " : "",
  2291. e.Sly = Me,
  2292. xe.fn.sly = function(n, r) {
  2293. var o, a;
  2294. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2295. a = Array.prototype.slice.call(arguments, 1)),
  2296. n = {}),
  2297. this.each(function(e, t) {
  2298. var i = xe.data(t, He);
  2299. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2300. })
  2301. }
  2302. ,
  2303. Me.defaults = {
  2304. slidee: null,
  2305. horizontal: !1,
  2306. itemNav: null,
  2307. itemSelector: null,
  2308. smart: !1,
  2309. activateOn: null,
  2310. activateMiddle: !1,
  2311. scrollSource: null,
  2312. scrollBy: 0,
  2313. scrollHijack: 300,
  2314. scrollTrap: !1,
  2315. dragSource: null,
  2316. mouseDragging: !1,
  2317. touchDragging: !1,
  2318. releaseSwing: !1,
  2319. swingSpeed: .2,
  2320. elasticBounds: !1,
  2321. interactive: null,
  2322. scrollBar: null,
  2323. dragHandle: !1,
  2324. dynamicHandle: !1,
  2325. minHandleSize: 50,
  2326. clickBar: !1,
  2327. syncSpeed: .5,
  2328. pagesBar: null,
  2329. activatePageOn: null,
  2330. pageBuilder: function(e) {
  2331. return "<li>" + (e + 1) + "</li>"
  2332. },
  2333. forward: null,
  2334. backward: null,
  2335. prev: null,
  2336. next: null,
  2337. prevPage: null,
  2338. nextPage: null,
  2339. cycleBy: null,
  2340. cycleInterval: 5e3,
  2341. pauseOnHover: !1,
  2342. startPaused: !1,
  2343. moveBy: 300,
  2344. speed: 0,
  2345. easing: "swing",
  2346. startAt: null,
  2347. keyboardNavBy: null,
  2348. draggedClass: "dragged",
  2349. activeClass: "active",
  2350. disabledClass: "disabled"
  2351. }
  2352. }(jQuery, window),
  2353. function o(a, s, l) {
  2354. function c(i, e) {
  2355. if (!s[i]) {
  2356. if (!a[i]) {
  2357. var t = "function" == typeof require && require;
  2358. if (!e && t)
  2359. return t(i, !0);
  2360. if (h)
  2361. return h(i, !0);
  2362. var n = new Error("Cannot find module '" + i + "'");
  2363. throw n.code = "MODULE_NOT_FOUND",
  2364. n
  2365. }
  2366. var r = s[i] = {
  2367. exports: {}
  2368. };
  2369. a[i][0].call(r.exports, function(e) {
  2370. var t = a[i][1][e];
  2371. return c(t || e)
  2372. }, r, r.exports, o, a, s, l)
  2373. }
  2374. return s[i].exports
  2375. }
  2376. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2377. c(l[e]);
  2378. return c
  2379. }({
  2380. 1: [function(p, f, e) {
  2381. (function(e) {
  2382. "use strict";
  2383. function t(e) {
  2384. this.player = null,
  2385. this.director = null,
  2386. this.modelManager = null,
  2387. this.container = null,
  2388. this.tagManager = null,
  2389. this.fadeInSpeed = e,
  2390. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2391. }
  2392. var r = p("three")
  2393. , i = p("./util/logger")
  2394. , n = (p("./util/common"),
  2395. p("./enum/PlayerEvents"))
  2396. , o = p("./enum/DirectorEvents")
  2397. , a = p("./settings")
  2398. , s = p("./enum/Viewmode")
  2399. , l = (p("./enum/WarpStyle"),
  2400. p("./enum/BlackoutStyle"),
  2401. p("./enum/ModelManagerEvents"))
  2402. , c = p("./enum/tagEvents")
  2403. , h = p("./util/transitions")
  2404. , u = p("./util/lerp")
  2405. , d = new i(e);
  2406. t.prototype.init = function(e, t, i, n, r) {
  2407. (window.app = this).player = t,
  2408. this.director = e,
  2409. this.modelManager = i,
  2410. this.tagManager = n,
  2411. this.container = r,
  2412. this.updateModel(),
  2413. this.bindEvents()
  2414. }
  2415. ,
  2416. t.prototype.bindEvents = function() {
  2417. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2418. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2419. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2420. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2421. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2422. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2423. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2424. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2425. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2426. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2427. }
  2428. ,
  2429. t.prototype.updateModel = function() {
  2430. this.model = this.modelManager.getActiveModel()
  2431. }
  2432. ,
  2433. t.prototype.handleWarpStarted = function() {
  2434. this.hidePlayerReticule()
  2435. }
  2436. ,
  2437. t.prototype.ontagActivated = function() {
  2438. this.hidePlayerReticule()
  2439. }
  2440. ,
  2441. t.prototype.onNavigationTotag = function() {
  2442. this.hidePlayerReticule()
  2443. }
  2444. ,
  2445. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2446. var n = this.modelManager.getActiveModel()
  2447. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2448. n.fadePanoMarkers(r),
  2449. n.setMode(t)
  2450. }
  2451. ,
  2452. t.prototype.handlePlayerModeChanged = function(e, t) {
  2453. var i = this.modelManager.getActiveModel()
  2454. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2455. i.setSide(n),
  2456. i.setMode(t)
  2457. }
  2458. ,
  2459. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2460. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2461. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2462. }
  2463. ,
  2464. t.prototype.handleActionInterruption = function() {}
  2465. ,
  2466. t.prototype.handleStartInside = function(e) {
  2467. var t = a[this.player.mode]
  2468. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2469. this.fadeIn(this.fadeInSpeed),
  2470. this.model.alpha = 0,
  2471. this.model.skybox.material.uniforms.opacity.value = 1,
  2472. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2473. var n = this.player.reticule;
  2474. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2475. }
  2476. ,
  2477. t.prototype.handleStartOutside = function(e) {
  2478. this.fadeIn(e)
  2479. }
  2480. ,
  2481. t.prototype.fadeIn = function(e) {
  2482. null != e || (e = 2e3,
  2483. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2484. $(this.container).fadeIn(e)
  2485. }
  2486. ,
  2487. t.prototype.hidePlayerReticule = function() {
  2488. this.player.reticule.hide()
  2489. }
  2490. ,
  2491. f.exports = t
  2492. }
  2493. ).call(this, "/js/DisplayController.js")
  2494. }
  2495. , {
  2496. "./enum/BlackoutStyle": 18,
  2497. "./enum/DirectorEvents": 23,
  2498. "./enum/tagEvents": 32,
  2499. "./enum/ModelManagerEvents": 33,
  2500. "./enum/PlayerEvents": 40,
  2501. "./enum/Viewmode": 51,
  2502. "./enum/WarpStyle": 52,
  2503. "./settings": 166,
  2504. "./util/common": 185,
  2505. "./util/lerp": 188,
  2506. "./util/logger": 189,
  2507. "./util/transitions": 195,
  2508. three: 217
  2509. }],
  2510. 2: [function(e, t, i) {
  2511. "use strict";
  2512. function n() {
  2513. this.baseStartTime = performance.timing.navigationStart,
  2514. this.loadingStartTime = null,
  2515. this.waitingStartTime = null,
  2516. this.appReadyTime = null
  2517. }
  2518. n.prototype.setBaseStartTime = function(e) {
  2519. this.baseStartTime = e || Date.now()
  2520. }
  2521. ,
  2522. n.prototype.setWaitingStartTime = function(e) {
  2523. this.waitingStartTime = e || Date.now()
  2524. }
  2525. ,
  2526. n.prototype.setLoadingStartTime = function(e) {
  2527. this.loadingStartTime = e || Date.now()
  2528. }
  2529. ,
  2530. n.prototype.setAppReadyTime = function(e) {
  2531. this.appReadyTime = e || Date.now()
  2532. }
  2533. ,
  2534. n.prototype.calcFullLoadingTime = function() {
  2535. var e = this.appReadyTime - this.baseStartTime;
  2536. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2537. e
  2538. }
  2539. ,
  2540. t.exports = n
  2541. }
  2542. , {}],
  2543. 3: [function(i, n, e) {
  2544. (function(e) {
  2545. "use strict";
  2546. function a() {
  2547. return 100 * Math.random()
  2548. }
  2549. var t = i("./util/logger")
  2550. , s = i("./util/browser")
  2551. , l = new t(e)
  2552. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2553. initialized: !1,
  2554. init: function(e, t) {
  2555. if (t = t || {},
  2556. !this.initialized) {
  2557. for (var i in this.initialized = !0,
  2558. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2559. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2560. e) {
  2561. var n = i.match("^sc_tilegen_([0-9]+)$");
  2562. n && (c.tilegen = a() < parseInt(n[1]));
  2563. var r = i.match("^sc_imgopt_([0-9]+)$");
  2564. r && (c.imgopt = a() < parseInt(r[1]))
  2565. }
  2566. for (var o in t)
  2567. c[o] = t[o],
  2568. l.debug("A/B override:", o, c[o])
  2569. }
  2570. },
  2571. changeIfTileGenerating: function(e) {
  2572. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2573. e += ""),
  2574. e
  2575. },
  2576. changeIfImageOptimzing: function(e) {
  2577. if(e.includes("blob:http"))return e;//add
  2578. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2579. e += ""),
  2580. e
  2581. },
  2582. tilegen: !1,
  2583. imgopt: !1
  2584. };
  2585. n.exports = c
  2586. }
  2587. ).call(this, "/js/ab.js")
  2588. }
  2589. , {
  2590. "./util/browser": 182,
  2591. "./util/logger": 189
  2592. }],
  2593. 4: [function(u, d, e) {
  2594. (function(e) {
  2595. "use strict";
  2596. function r(n, e, t, i) {
  2597. function r(e) {
  2598. a[e.sid] = !0;
  2599. var t = e.billboard.media && e.billboard.media.type
  2600. , i = {
  2601. tag_id: e.sid,
  2602. tags_visited: Object.keys(a).length,
  2603. tag_count: Object.keys(n.tags).length,
  2604. tag_view_count: ++d,
  2605. has_media: !!t
  2606. };
  2607. t && (i.media_type = t),
  2608. g("tag_opened", i)
  2609. }
  2610. var o, a = {}, s = Date.now() - P, l = null;
  2611. i && (l = Date.now() - window.navigationStart);
  2612. try {
  2613. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2614. } catch (n) {
  2615. o = !1
  2616. }
  2617. var c, h = n.supportsVR;
  2618. h || (c = "VR disabled at the model/account level",
  2619. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2620. g("model_loaded", {
  2621. duration: s,
  2622. duration_from_navigation_start: l,
  2623. has_hlr: o,
  2624. has_vr: h,
  2625. vr_reason: c
  2626. });
  2627. var u = 0;
  2628. n.panos.forEach(function(e) {
  2629. e.on("enter", function() {
  2630. f("pano_viewed", {
  2631. pano_id: e.id,
  2632. pano_view_count: ++u,
  2633. alignment_type: e.alignmentType,
  2634. interaction_source: R,
  2635. navigation_source: v
  2636. })
  2637. })
  2638. });
  2639. var d = 0;
  2640. for (var p in n.tags)
  2641. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2642. e.on("tour_auto", function(e) {
  2643. v = "tour_" + e
  2644. }),
  2645. e.on("tour_manual", function(e) {
  2646. R = "gui-" + e,
  2647. v = "tour_manual"
  2648. }),
  2649. t.on(C.InteractionKey, function() {
  2650. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2651. }),
  2652. t.on(C.InteractionDirect, function() {
  2653. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2654. }),
  2655. function(t) {
  2656. I.on(T.OPENED, function() {
  2657. f("showcase_share_intent", {
  2658. pano_id: t.currentPano && t.currentPano.id
  2659. })
  2660. }),
  2661. I.on(T.LINK_CLICKED, function(e) {
  2662. f("showcase_share_action", {
  2663. channel: e.channel,
  2664. pano_id: t.currentPano && t.currentPano.id
  2665. })
  2666. }),
  2667. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2668. f("showcase_share_origin_link_clicked")
  2669. })
  2670. }(e),
  2671. function() {
  2672. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2673. gui_action: "click_vr_button"
  2674. })),
  2675. _.on(S.LAUNCH, function(e) {
  2676. f("showcase_gui", {
  2677. gui_action: "launch_vr",
  2678. vr_platform: e.vr_platform,
  2679. vr_app: e.vr_app
  2680. })
  2681. }),
  2682. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2683. gui_action: "vr_modal_prev"
  2684. })),
  2685. _.on(S.NEXT, function(e) {
  2686. f("showcase_gui", {
  2687. gui_action: e.nextAction
  2688. })
  2689. }),
  2690. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2691. gui_action: "vr_modal_close"
  2692. })),
  2693. _.on(S.falseICECHOSEN, function(e) {
  2694. f("showcase_gui", {
  2695. gui_action: e.name + " "
  2696. })
  2697. }),
  2698. _.on(S.STORE, function(e) {
  2699. f("showcase_gui", {
  2700. gui_action: "launch_store",
  2701. store: e
  2702. })
  2703. })
  2704. }()
  2705. }
  2706. function f(e, t) {
  2707. if (t = t || {},
  2708. i)
  2709. try {
  2710. window.analytics.track(e, s.extendObject(t, c), {
  2711. context: {
  2712. app: {
  2713. name: "showcase",
  2714. version: "2.25.6-0-gd87e5b1"
  2715. },
  2716. screen: {
  2717. width: window.screen.width,
  2718. height: window.screen.height,
  2719. density: window.devicePixelRatio
  2720. }
  2721. }
  2722. })
  2723. } catch (t) {
  2724. console.warn("Failed to send data to segment for " + e)
  2725. }
  2726. }
  2727. function g(e, t) {
  2728. f(e, t = t || {})
  2729. }
  2730. function m(e, t) {
  2731. R = e === C.InteractionGui ? "gui-" + t : e,
  2732. v = "self_guided"
  2733. }
  2734. var v, o, a = (u("three"),
  2735. u("./util/ajax"),
  2736. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2737. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2738. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2739. d.exports = {
  2740. report: function(e, t, i, n) {
  2741. !function(e, t) {
  2742. if (o)
  2743. try {
  2744. o.addEvent(e, s.extendObject({
  2745. host: window.location.host,
  2746. keen: {
  2747. addons: [{
  2748. name: "keen:ua_parser",
  2749. input: {
  2750. ua_string: "user_agent"
  2751. },
  2752. output: "parsed_user_agent"
  2753. }]
  2754. },
  2755. user_agent: "${keen.user_agent}",
  2756. referrer: {
  2757. url: s.normalizeUrl(document.referrer),
  2758. domain: s.domainFromUrl(document.referrer),
  2759. url_original: document.referrer
  2760. },
  2761. embedded: y.inIframe(),
  2762. is_mobile: y.isMobile(),
  2763. version: "2.25.6-0-gd87e5b1"
  2764. }, t))
  2765. } catch (e) {
  2766. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2767. }
  2768. }("Session starts", {
  2769. model: e,
  2770. status: t,
  2771. loadtime: Date.now() - (P || Date.now()),
  2772. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2773. autoplay: i,
  2774. quickstart: n,
  2775. ab_tilegen: a.tilegen,
  2776. ab_imgopt: a.imgopt
  2777. })
  2778. },
  2779. impression: function(e) {
  2780. g("impression", {
  2781. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2782. url_params: (void 0 !== e.immediate && e.immediate,
  2783. window.location.search.substr(1).split("&"))
  2784. })
  2785. },
  2786. initKeen: function(e) {
  2787. return e.token && e.appId ? void (o = new Keen({
  2788. projectId: e.appId,
  2789. writeKey: e.token,
  2790. readKey: "",
  2791. requestType: "xhr"
  2792. })) : void l.warn("no keen token/appId")
  2793. },
  2794. initSegment: function(e) {
  2795. return e.token ? (i = e.token,
  2796. window.analytics.load(e.token),
  2797. c = {
  2798. model_id: e.model,
  2799. start_source: e.startSource,
  2800. autoplay: e.autoplay,
  2801. quickstart: e.quickstart,
  2802. language_tag: t.languageTag,
  2803. is_mobile: y.isMobile(),
  2804. iframe: y.inIframe(),
  2805. aspect_ratio: y.aspectRatio(),
  2806. session_id: h,
  2807. window: {
  2808. width: $("#player").width(),
  2809. height: $("#player").height()
  2810. },
  2811. platform: {
  2812. browser: {
  2813. name: $.ua.browser.name,
  2814. major: $.ua.browser.major,
  2815. version: $.ua.browser.version
  2816. },
  2817. os: {
  2818. name: $.ua.os.name,
  2819. version: $.ua.os.version
  2820. },
  2821. device: {
  2822. vendor: $.ua.device.vendor,
  2823. model: $.ua.device.model,
  2824. type: $.ua.device.type
  2825. }
  2826. }
  2827. },
  2828. n = Math.random() < t.analytics.sessionTrackingRate,
  2829. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2830. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2831. },
  2832. sessionStart: function(e) {
  2833. l.debug("analytics user_session_start"),
  2834. f("session_started"),
  2835. P = Date.now(),
  2836. window.addEventListener("unload", function() {
  2837. !function(e, t) {
  2838. if (t = t || {},
  2839. navigator.sendBeacon && i)
  2840. try {
  2841. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2842. event: e,
  2843. anonymousId: window.analytics.user().anonymousId(),
  2844. properties: s.extendObject(t, c),
  2845. writeKey: i,
  2846. sentAt: Date.now(),
  2847. type: "track",
  2848. context: {
  2849. userAgent: y.userAgent(),
  2850. library: {
  2851. name: "showcase-beacon",
  2852. version: "2.25.6-0-gd87e5b1"
  2853. },
  2854. app: {
  2855. name: "showcase",
  2856. version: "2.25.6-0-gd87e5b1"
  2857. }
  2858. }
  2859. }))
  2860. } catch (e) {
  2861. console.warn("Failed to send async segment request")
  2862. }
  2863. }("session_ended", {
  2864. duration: Date.now() - P
  2865. })
  2866. })
  2867. },
  2868. modelLoaded: function(e, t, i, n) {
  2869. r(e, t, i, n)
  2870. },
  2871. loadComplete: function(e) {
  2872. f("load_times", {
  2873. time_to_app_start: e
  2874. })
  2875. },
  2876. track: function(e, t) {
  2877. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2878. f(e, t))
  2879. },
  2880. trackAlways: function(e, t) {
  2881. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2882. f(e, t)
  2883. },
  2884. getSessionId: function() {
  2885. return h
  2886. },
  2887. updateInteraction: m
  2888. }
  2889. }
  2890. ).call(this, "/js/analytics.js")
  2891. }
  2892. , {
  2893. "./ab": 3,
  2894. "./enum/ControlEvents": 21,
  2895. "./enum/PlayerEvents": 40,
  2896. "./enum/VROption": 47,
  2897. "./enum/VRPlatforms": 49,
  2898. "./enum/Viewmode": 51,
  2899. "./gui/sharing/ShareEvents": 76,
  2900. "./gui/sharing/modal": 77,
  2901. "./gui/title/TitleEvents": 80,
  2902. "./gui/title/titleBar": 82,
  2903. "./gui/vr/vrEvent": 85,
  2904. "./gui/vr/vrModal": 87,
  2905. "./localization/localize": 108,
  2906. "./tag/Billboard/BillboardEvent": 120,
  2907. "./settings": 166,
  2908. "./util/ajax": 181,
  2909. "./util/browser": 182,
  2910. "./util/common": 185,
  2911. "./util/logger": 189,
  2912. three: 217
  2913. }],
  2914. 5: [function(e, t, i) {
  2915. "use strict";
  2916. function n() {
  2917. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2918. this.controls = null
  2919. }
  2920. var r = e("three")
  2921. , o = e("../constants")
  2922. , a = e("../util/cameraLight");
  2923. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2924. this.aspect = e,
  2925. this.updateProjectionMatrix()
  2926. }
  2927. ,
  2928. t.exports = n
  2929. }
  2930. , {
  2931. "../constants": 8,
  2932. "../util/cameraLight": 184,
  2933. three: 217
  2934. }],
  2935. 6: [function(e, t, i) {
  2936. "use strict";
  2937. function n() {
  2938. var e = $("#player").width() / $("#player").height();
  2939. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2940. this.controls = null,
  2941. this.updateAspect(e)
  2942. }
  2943. var r = e("three")
  2944. , o = e("../constants");
  2945. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2946. this.aspect = e,
  2947. this.top = o.orthoBase / e,
  2948. this.bottom = -o.orthoBase / e,
  2949. this.updateProjectionMatrix()
  2950. }
  2951. ,
  2952. t.exports = n
  2953. }
  2954. , {
  2955. "../constants": 8,
  2956. three: 217
  2957. }],
  2958. 7: [function(e, t, i) {
  2959. "use strict";
  2960. function n() {
  2961. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2962. this.controls = null
  2963. }
  2964. var r = e("three")
  2965. , o = e("../settings")
  2966. , a = e("../util/cameraLight");
  2967. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2968. this.aspect = e,
  2969. this.updateProjectionMatrix()
  2970. }
  2971. ,
  2972. t.exports = n
  2973. }
  2974. , {
  2975. "../settings": 166,
  2976. "../util/cameraLight": 184,
  2977. three: 217
  2978. }],
  2979. 8: [function(e, t, i) {
  2980. "use strict";
  2981. t.exports = {
  2982. signedUrlDefaultExpireTime: 24e4,
  2983. signedUrlCheckInterval: 1e4,
  2984. signedUrlRefreshBuffer: 15e3,
  2985. dollhouseFOV: 70,
  2986. dollhouseNear: .1,//1,
  2987. dollhouseFar: 5e3,
  2988. insideFOV: 70,
  2989. insideFOVMax: 120,
  2990. insideNear: 0.01,//.1,
  2991. insideFar: 5e3,
  2992. insideLookSpeed: .12,
  2993. insideLookLimitUp: 40,
  2994. insideLookLimitDown: -40,
  2995. orthoNear: 1,
  2996. orthoFar: 5e3,
  2997. orthoBase: 10,
  2998. narrowLandscapeHeight: 290,
  2999. reallyNarrowLandscapeHeight: 250,
  3000. visionTilingStartDate: new Date("8/26/2016"),
  3001. visionTilingStartVersion: "1.1.407.13667",
  3002. windowHeightHighQualityThreshold: 900,
  3003. tourStepDelayDefault: 3500,
  3004. tourStepDelaySlideShow: 5e3,
  3005. workshopApsect: 9 / 16,
  3006. highQualityMaxZoom: 2,
  3007. ultraHighQualityMaxZoom: 3
  3008. }
  3009. }
  3010. , {}],
  3011. 9: [function(e, t, i) {
  3012. "use strict";
  3013. function n() {
  3014. this.activeControl = null,
  3015. this.controls = {},
  3016. this.cameras = {}
  3017. }
  3018. var a = e("./PanoramaControls")
  3019. , s = e("./DollhouseControls")
  3020. , l = e("./FloorplanControls")
  3021. , c = e("../cameras/PanoramaCamera")
  3022. , h = e("../cameras/DollhouseCamera")
  3023. , u = e("../cameras/FloorplanCamera")
  3024. , r = e("events").EventEmitter
  3025. , d = e("../enum/ControlEvents")
  3026. , o = e("../enum/ModelManagerEvents")
  3027. , p = e("../enum/Viewmode")
  3028. , f = e("../settings");
  3029. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3030. this.setUpControls(),
  3031. this.bindEvents(e, t)
  3032. }
  3033. ,
  3034. n.prototype.activateControls = function(e) {
  3035. this.activeControl && (this.activeControl.reset(),
  3036. this.activeControl.enabled = !1),
  3037. this.controls[e] && (this.controls[e].enabled = !0),
  3038. this.activeControl = this.controls[e]
  3039. }
  3040. ,
  3041. n.prototype.setUpControls = function() {
  3042. var i = {}
  3043. , n = {}
  3044. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3045. , r = [c, h, u]
  3046. , o = [a, s, l];
  3047. e.forEach(function(e, t) {
  3048. i[e] = new r[t],
  3049. n[e] = new o[t](i[e]),
  3050. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3051. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3052. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3053. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3054. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3055. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3056. }
  3057. .bind(this)),
  3058. this.controls = n,
  3059. this.cameras = i
  3060. }
  3061. ,
  3062. n.prototype.bindEvents = function(e, t) {
  3063. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3064. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3065. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3066. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3067. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3068. passive: !1
  3069. }),
  3070. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3071. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3072. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3073. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3074. e.addEventListener("contextmenu", function(e) {
  3075. e.preventDefault()
  3076. }),
  3077. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3078. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3079. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3080. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3081. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3082. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3083. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3084. t.on(o.ActiveModelChanged, function(e) {
  3085. this.setModelForControls(e.model)
  3086. }
  3087. .bind(this))
  3088. }
  3089. ,
  3090. n.prototype.setModelForControls = function(e) {
  3091. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3092. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3093. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3094. this.controls[e].setBounds(t)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.onMouseDown = function(e) {
  3100. e.preventDefault(),
  3101. this.activeControl && this.activeControl.onMouseDown(e)
  3102. }
  3103. ,
  3104. n.prototype.onMouseMove = function(e) {
  3105. e.preventDefault(),
  3106. this.activeControl && this.activeControl.onMouseMove(e)
  3107. }
  3108. ,
  3109. n.prototype.onMouseUp = function(e) {
  3110. e.preventDefault(),
  3111. this.activeControl && this.activeControl.onMouseUp(e)
  3112. }
  3113. ,
  3114. n.prototype.onMouseOver = function(e) {
  3115. e.preventDefault(),
  3116. this.activeControl && this.activeControl.onMouseOver(e)
  3117. }
  3118. ,
  3119. n.prototype.onMouseWheel = function(e) {
  3120. e.preventDefault(),
  3121. this.activeControl && this.activeControl.onMouseWheel(e)
  3122. }
  3123. ,
  3124. n.prototype.onTouchStart = function(e) {
  3125. e.preventDefault(),
  3126. this.activeControl && this.activeControl.onTouchStart(e),
  3127. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3128. $("#hotListContent ul .active").removeClass("active"),
  3129. $("#hotList")[0].classList.remove("active")
  3130. }
  3131. ,
  3132. n.prototype.onTouchMove = function(e) {
  3133. e.preventDefault(),
  3134. this.activeControl && this.activeControl.onTouchMove(e)
  3135. }
  3136. ,
  3137. n.prototype.onTouchEnd = function(e) {
  3138. e.preventDefault(),
  3139. this.activeControl && this.activeControl.onTouchEnd(e)
  3140. }
  3141. ,
  3142. n.prototype.onPointerDown = function(e) {
  3143. if (e.preventDefault(),
  3144. this.activeControl)
  3145. switch (e.pointerType) {
  3146. case "mouse":
  3147. this.activeControl.onMouseDown(e);
  3148. break;
  3149. default:
  3150. this.activeControl.onPointerDown(e)
  3151. }
  3152. }
  3153. ,
  3154. n.prototype.onPointerMove = function(e) {
  3155. if (e.preventDefault(),
  3156. this.activeControl)
  3157. switch (e.pointerType) {
  3158. case "mouse":
  3159. this.activeControl.onMouseMove(e);
  3160. break;
  3161. default:
  3162. this.activeControl.onPointerMove(e)
  3163. }
  3164. }
  3165. ,
  3166. n.prototype.onPointerUp = function(e) {
  3167. if (e.preventDefault(),
  3168. this.activeControl)
  3169. switch (e.pointerType) {
  3170. case "mouse":
  3171. this.activeControl.onMouseUp(e);
  3172. break;
  3173. default:
  3174. this.activeControl.onPointerUp(e)
  3175. }
  3176. }
  3177. ,
  3178. n.prototype.onPointerCancel = function(e) {
  3179. e.preventDefault(),
  3180. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3181. }
  3182. ,
  3183. n.prototype.onKeyDown = function(e) {
  3184. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3185. this.activeControl && this.activeControl.onKeyDown(e))
  3186. }
  3187. ,
  3188. n.prototype.onKeyUp = function(e) {
  3189. e.preventDefault(),
  3190. this.activeControl && this.activeControl.onKeyUp(e)
  3191. }
  3192. ,
  3193. t.exports = n
  3194. }
  3195. , {
  3196. "../cameras/DollhouseCamera": 5,
  3197. "../cameras/FloorplanCamera": 6,
  3198. "../cameras/PanoramaCamera": 7,
  3199. "../enum/ControlEvents": 21,
  3200. "../enum/ModelManagerEvents": 33,
  3201. "../enum/Viewmode": 51,
  3202. "../settings": 166,
  3203. "./DollhouseControls": 10,
  3204. "./FloorplanControls": 11,
  3205. "./PanoramaControls": 13,
  3206. events: 202
  3207. }],
  3208. 10: [function(e, t, i) {
  3209. "use strict";
  3210. function n(e) {
  3211. a.call(this, e),
  3212. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3213. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3214. this.minDistance = o.dollhouseDefault.minDistance,
  3215. this.maxDistance = o.dollhouseDefault.maxDistance,
  3216. this.adjustedMinDistance = this.minDistance,
  3217. this.adjustedMaxDistance = this.maxDistance
  3218. }
  3219. var r = e("three")
  3220. , o = e("../settings")
  3221. , a = e("./OutsideControls");
  3222. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3223. this.camera.updateMatrix();
  3224. var i = this.camera.position.clone().sub(this.target).length();
  3225. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3226. this.panLeft(2 * e * i / $("#player").height()),
  3227. this.panUp(-2 * t * i / $("#player").height())
  3228. }
  3229. ,
  3230. n.prototype.updateZoom = function() {
  3231. return this.offset.length() * this.scale
  3232. }
  3233. ,
  3234. n.prototype.setZoomBounds = function(e) {
  3235. var t = e.min.distanceTo(e.max);
  3236. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3237. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3238. this.minDistance = this.adjustedMinDistance,
  3239. this.maxDistance = this.adjustedMaxDistance
  3240. }
  3241. ,
  3242. n.prototype.resetRanges = function(e, t) {
  3243. e ? (this.minDistance = Math.min(e, this.minDistance),
  3244. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3245. this.maxDistance = this.adjustedMaxDistance),
  3246. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3247. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3248. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3249. }
  3250. ,
  3251. n.prototype.toJSON = function() {
  3252. return a.prototype.toJSON.call(this)
  3253. }
  3254. ,
  3255. t.exports = n
  3256. }
  3257. , {
  3258. "../settings": 166,
  3259. "./OutsideControls": 12,
  3260. three: 217
  3261. }],
  3262. 11: [function(e, t, i) {
  3263. "use strict";
  3264. function n(e) {
  3265. c.call(this, e),
  3266. this.minDistance = 15,
  3267. this.maxDistance = 50,
  3268. this.noRotateUpDown = !0,
  3269. this.minPolarAngle = 0,
  3270. this.maxPolarAngle = 0,
  3271. this.mouseActions[u.LEFT] = h.PAN,
  3272. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3273. this.mouseActions[u.RIGHT] = h.ROTATE,
  3274. this.touchActions[1] = h.PAN,
  3275. this.touchActions[2] = h.ROTATE_DOLLY,
  3276. this.absoluteScale = 1,
  3277. this.currentScale = 1
  3278. }
  3279. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3280. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3281. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3282. this.currentScale = this.absoluteScale
  3283. }
  3284. ,
  3285. /* n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3286. var t = Math.max(modelSize.x, modelSize.z)
  3287. , i = Math.min(modelSize.x, modelSize.z)
  3288. , n = Math.max(t, i * this.camera.aspect)
  3289. , r = Math.max(i, t * this.camera.aspect);
  3290. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3291. return absoluteScale
  3292. }, */
  3293. n.prototype.getDefaultAbsoluteScale = function(modelSize, ratio) {
  3294. let defaultRatio = 1.2 , absoluteScale
  3295. if(_settings.floorPlanAngle){//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3296. var angle = parseFloat(_settings.floorPlanAngle)
  3297. /* if(_settings.angleShift2d){ //怎么算都会超出,仔细想了下是无法算准的
  3298. angle += THREE.Math.degToRad(_settings.angleShift2d)
  3299. } */
  3300. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3301. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3302. var screenSize = Math.min($("#player").width(), $("#player").height())
  3303. var maxSize = 800;//模型最大占据像素
  3304. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3305. absoluteScale = n / 2 / l.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3306. }else{
  3307. var t = Math.max(modelSize.x, modelSize.z)
  3308. , i = Math.min(modelSize.x, modelSize.z)
  3309. , n = Math.max(t, i * this.camera.aspect)
  3310. , r = Math.max(i, t * this.camera.aspect);
  3311. absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * defaultRatio
  3312. }
  3313. return absoluteScale
  3314. },
  3315. n.prototype.rotateToView = function(modelSize, direction, type) {
  3316. let i = 0, n = p.aspectRatio() < 1 //是否模型尺寸显“细长”
  3317. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3318. i = parseFloat(_settings.floorPlanAngle)
  3319. }else{
  3320. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3321. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3322. {
  3323. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3324. {
  3325. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3326. }
  3327. //(第二种情况) 不做处理
  3328. }
  3329. else if(direction.x > 0)
  3330. {
  3331. i = Math.PI / 2;
  3332. }
  3333. else
  3334. {
  3335. i = -Math.PI / 2;
  3336. }
  3337. }
  3338. if(_settings.angleShift2d){
  3339. i += THREE.Math.degToRad(_settings.angleShift2d)
  3340. }
  3341. if(type == 'update'){//若不是update,只能是从其他模式刚转到floorplan
  3342. i += this.lon
  3343. }
  3344. this.rotateLeft(i);
  3345. this.update(0);
  3346. }
  3347. ,
  3348. n.prototype.updateRotate = function(angle){//add 在floorplan模式直接旋转
  3349. this.rotateToView(player.model.size, player.getDirection(),'update');
  3350. }
  3351. /* n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3352. this.rotateLeft(angle + this.lon);
  3353. this.update(0);
  3354. } */
  3355. ,
  3356. n.prototype.pan = function(e, t) {
  3357. this.camera.updateMatrix(),
  3358. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3359. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3360. }
  3361. ,
  3362. n.prototype.updateZoom = function() {
  3363. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3364. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3365. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3366. this.camera.left = -l.orthoBase * this.currentScale,
  3367. this.camera.right = l.orthoBase * this.currentScale,
  3368. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3369. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3370. this.camera.updateProjectionMatrix(),
  3371. this.offset.length()
  3372. }
  3373. ,
  3374. n.prototype.toJSON = (r = new s.Quaternion,
  3375. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3376. a = new s.Quaternion,
  3377. function() {
  3378. var e = c.prototype.toJSON.call(this);
  3379. return r.copy(e.camera_quaternion),
  3380. a.copy(o),
  3381. a.multiply(r),
  3382. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3383. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3384. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3385. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3386. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3387. e
  3388. }
  3389. ),
  3390. t.exports = n
  3391. }
  3392. , {
  3393. "../enum/ControlActions": 20,
  3394. "../enum/MouseButton": 34,
  3395. "../settings": 166,
  3396. "../util/browser": 182,
  3397. "../util/math": 190,
  3398. "./OutsideControls": 12,
  3399. three: 217
  3400. }],
  3401. 12: [function(e, t, i) {
  3402. "use strict";
  3403. function n(e) {
  3404. this.camera = e,
  3405. (this.camera.controls = this).enabled = !1,
  3406. this.target = new a.Vector3,
  3407. this.targetBounds = new a.Box3,
  3408. this.zoomSpeed = 2,//编辑时缩放快一些
  3409. this.minDistance = 0,
  3410. this.maxDistance = 1 / 0,
  3411. this.noRotateUpDown = !1,
  3412. this.rotateSpeed = 1,
  3413. this.keyboardZoomSpeed = 0,
  3414. this.keyPanSpeed = 7,
  3415. this.autoRotate = !1,
  3416. this.autoRotateSpeed = 2,
  3417. this.autoPan = !1,
  3418. this.autoPanPosition = new a.Vector3,
  3419. this.minPolarAngle = a.Math.degToRad(25),
  3420. this.maxPolarAngle = a.Math.degToRad(65),
  3421. this.rotationAcceleration = new a.Vector2,
  3422. this.rotationSpeed = new a.Vector2,
  3423. this.panAcceleration = new a.Vector2,
  3424. this.panSpeed = new a.Vector2,
  3425. this.rotateStart = new a.Vector2,
  3426. this.rotateEnd = new a.Vector2,
  3427. this.rotateDelta = new a.Vector2,
  3428. this.panStart = new a.Vector2,
  3429. this.panEnd = new a.Vector2,
  3430. this.panDelta = new a.Vector2,
  3431. this.panOffset = new a.Vector3,
  3432. this.offset = new a.Vector3,
  3433. this.dollyStart = new a.Vector2,
  3434. this.dollyEnd = new a.Vector2,
  3435. this.dollyDelta = new a.Vector2,
  3436. this.phiDelta = 0,
  3437. this.thetaDelta = 0,
  3438. this.scale = 1,
  3439. this.panVector = new a.Vector3,
  3440. this.lastPosition = new a.Vector3,
  3441. this.state = u.NONE,
  3442. this.mouseActions = {},
  3443. this.mouseActions[d.LEFT] = u.ROTATE,
  3444. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3445. this.mouseActions[d.RIGHT] = u.PAN,
  3446. this.touchActions = {},
  3447. this.touchActions[1] = u.ROTATE,
  3448. this.touchActions[2] = u.PAN_DOLLY,
  3449. this.lastMoveTime = 0,
  3450. this.pointersLimit = 2,
  3451. this.pointers = []
  3452. }
  3453. 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;
  3454. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3455. this.targetBounds = e
  3456. }
  3457. ,
  3458. n.prototype.isEngaged = function() {
  3459. return this.state !== u.NONE
  3460. }
  3461. ,
  3462. n.prototype.rotateLeft = function(e) {
  3463. void 0 === e && (e = this.getAutoRotationAngle()),
  3464. this.thetaDelta -= e
  3465. }
  3466. ,
  3467. n.prototype.rotateUp = function(e) {
  3468. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3469. this.phiDelta -= e)
  3470. }
  3471. ,
  3472. n.prototype.panLeft = function(e) {
  3473. var t = this.camera.matrix.elements;
  3474. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3475. this.panOffset.multiplyScalar(-e),
  3476. this.panVector.add(this.panOffset)
  3477. }
  3478. ,
  3479. n.prototype.panUp = function(e) {
  3480. var t = this.camera.matrix.elements;
  3481. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3482. this.panOffset.multiplyScalar(-e),
  3483. this.panVector.add(this.panOffset)
  3484. }
  3485. ,
  3486. n.prototype.startRotating = function(e, t) {
  3487. e && this.navRotationAcc("x", e),
  3488. t && this.navRotationAcc("y", t)
  3489. }
  3490. ,
  3491. n.prototype.stopRotating = function(e) {
  3492. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3493. this.navRotationAcc("x", 0),
  3494. this.navRotationAcc("y", 0)
  3495. }
  3496. ,
  3497. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3498. o = new a.Vector3,
  3499. function(e, t) {
  3500. r.copy(this.camera.position),
  3501. void 0 === e && null === e || r.setX(e),
  3502. void 0 === t && null === t || r.setZ(t);
  3503. var i = this.camera.position.distanceTo(this.target)
  3504. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3505. this.targetClamped = !1,
  3506. o.copy(r).addScaledVector(n, i),
  3507. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3508. r.copy(o).addScaledVector(n, -i),
  3509. this.targetClamped = !0),
  3510. this.autoPanPosition.x = r.x,
  3511. this.autoPanPosition.z = r.z,
  3512. this.autoPan && this.stopAutoPanning()
  3513. }
  3514. ),
  3515. n.prototype.stopAutoPanning = function() {
  3516. var e = this.autoPan;
  3517. this.autoPan = !1,
  3518. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3519. }
  3520. ,
  3521. n.prototype.dollyIn = function(e) {
  3522. void 0 === e && (e = this.getZoomScale()),
  3523. this.scale /= e
  3524. }
  3525. ,
  3526. n.prototype.dollyOut = function(e) {
  3527. void 0 === e && (e = this.getZoomScale()),
  3528. this.scale *= e
  3529. }
  3530. ,
  3531. n.prototype.updatePan = function(e) {
  3532. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3533. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3534. this.autoPan) {
  3535. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3536. t.setY(0).clampLength(0, 50 * e),
  3537. this.target.add(t),
  3538. this.camera.position.add(t),
  3539. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3540. this.stopAutoPanning())
  3541. }
  3542. }
  3543. ,
  3544. n.prototype.update = function(e) {
  3545. e = e || 1 / 60,
  3546. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3547. this.rotateLeft(-this.rotationSpeed.x),
  3548. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3549. this.updatePan(e);
  3550. var t = this.camera.position;
  3551. this.offset.copy(t).sub(this.target);
  3552. var i = Math.atan2(this.offset.x, this.offset.z)
  3553. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3554. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3555. i += this.thetaDelta,
  3556. n += this.phiDelta,
  3557. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3558. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3559. this.lon = i, this.lat = n//add
  3560. var r = this.updateZoom();
  3561. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3562. this.target.add(this.panVector),
  3563. this.targetBounds.clampPoint(this.target, this.target),
  3564. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3565. this.offset.y = r * Math.cos(n),
  3566. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3567. t.copy(this.target).add(this.offset),
  3568. this.camera.lookAt(this.target),
  3569. this.thetaDelta = 0,
  3570. this.phiDelta = 0,
  3571. this.scale = 1,
  3572. this.panVector.set(0, 0, 0),
  3573. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3574. }
  3575. ,
  3576. n.prototype.getAutoRotationAngle = function() {
  3577. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3578. }
  3579. ,
  3580. n.prototype.getZoomScale = function() {
  3581. return Math.pow(.95, this.zoomSpeed)
  3582. }
  3583. ,
  3584. n.prototype.onMouseDown = function(e) {
  3585. if (this.enabled) {
  3586. switch (e.preventDefault(),
  3587. this.stopAutoPanning(),
  3588. this.mouseDown = !0,
  3589. this.state = this.mouseActions[e.button],
  3590. this.state) {
  3591. case u.ROTATE:
  3592. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3593. this.rotationSpeed.set(0, 0);
  3594. break;
  3595. case u.DOLLY:
  3596. this.dollyStart.set(e.clientX, e.clientY);
  3597. break;
  3598. case u.PAN:
  3599. this.panStart.set(e.clientX, e.clientY)
  3600. }
  3601. this.emit(f.InputStart, "mouse")
  3602. }
  3603. }
  3604. ,
  3605. n.prototype.onMouseMove = function(e) {
  3606. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3607. switch (e.preventDefault(),
  3608. this.state) {
  3609. case u.ROTATE:
  3610. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3611. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3612. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3613. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3614. this.rotateStart.copy(this.rotateEnd);
  3615. break;
  3616. case u.DOLLY:
  3617. this.dollyEnd.set(e.clientX, e.clientY),
  3618. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3619. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3620. this.dollyStart.copy(this.dollyEnd);
  3621. break;
  3622. case u.PAN:
  3623. this.panEnd.set(e.clientX, e.clientY),
  3624. this.panDelta.subVectors(this.panEnd, this.panStart),
  3625. this.pan(this.panDelta.x, this.panDelta.y),
  3626. this.panStart.copy(this.panEnd)
  3627. }
  3628. this.emit(f.Move, "mouse"),
  3629. this.lastMoveTime = e.timeStamp,
  3630. this.update()
  3631. }
  3632. }
  3633. ,
  3634. n.prototype.onMouseUp = function(e) {
  3635. this.enabled && (this.mouseDown = !1,
  3636. this.state = u.NONE,
  3637. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3638. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3639. this.update(),
  3640. this.rotationAcceleration.set(0, 0),
  3641. this.rotateDelta.set(0, 0)))
  3642. }
  3643. ,
  3644. n.prototype.onMouseOver = function(e) {
  3645. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3646. }
  3647. ,
  3648. n.prototype.onMouseWheel = function(e) {
  3649. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3650. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3651. this.update())
  3652. }
  3653. ,
  3654. n.prototype.onKeyDown = function(e) {
  3655. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3656. this.handleKeyDown(e.which)))
  3657. }
  3658. ,
  3659. n.prototype.navRotationAcc = function(e, t) {
  3660. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3661. }
  3662. ,
  3663. n.prototype.navPanAcc = function(e, t) {
  3664. this.stopAutoPanning(),
  3665. this.panAcceleration[e] = t
  3666. }
  3667. ,
  3668. n.prototype.handleKeyDown = function(e) {
  3669. var t = !0;
  3670. switch (e) {
  3671. case p.UPARROW:
  3672. case p.I:
  3673. this.navRotationAcc("y", 1);
  3674. break;
  3675. case p.DOWNARROW:
  3676. case p.K:
  3677. this.navRotationAcc("y", -1);
  3678. break;
  3679. case p.LEFTARROW:
  3680. case p.J:
  3681. this.navRotationAcc("x", -1);
  3682. break;
  3683. case p.RIGHTARROW:
  3684. case p.L:
  3685. this.navRotationAcc("x", 1);
  3686. break;
  3687. case p.W:
  3688. this.navPanAcc("y", 1);
  3689. break;
  3690. case p.S:
  3691. this.navPanAcc("y", -1);
  3692. break;
  3693. case p.A:
  3694. this.navPanAcc("x", -1);
  3695. break;
  3696. case p.D:
  3697. this.navPanAcc("x", 1);
  3698. break;
  3699. default:
  3700. t = !1
  3701. }
  3702. t && this.emit(f.Move, "key")
  3703. }
  3704. ,
  3705. n.prototype.onKeyUp = function(e) {
  3706. this.enabled && (e.preventDefault(),
  3707. e.stopPropagation(),
  3708. this.handleKeyUp(e.which))
  3709. }
  3710. ,
  3711. n.prototype.handleKeyUp = function(e) {
  3712. switch (e) {
  3713. case p.I:
  3714. case p.K:
  3715. case p.UPARROW:
  3716. case p.DOWNARROW:
  3717. this.keyboardZoomSpeed = 0,
  3718. this.rotationAcceleration.y = 0;
  3719. break;
  3720. case p.J:
  3721. case p.L:
  3722. case p.LEFTARROW:
  3723. case p.RIGHTARROW:
  3724. this.rotationAcceleration.x = 0;
  3725. break;
  3726. case p.S:
  3727. case p.W:
  3728. this.panAcceleration.y = 0;
  3729. break;
  3730. case p.A:
  3731. case p.D:
  3732. this.panAcceleration.x = 0
  3733. }
  3734. }
  3735. ,
  3736. n.prototype.onTouchStart = function(i) {
  3737. if (this.enabled || this.state === u.NONE) {
  3738. i.preventDefault(),
  3739. i.stopPropagation(),
  3740. this.stopAutoPanning();
  3741. var e = function() {
  3742. if (2 === i.touches.length) {
  3743. var e = i.touches[0].pageX - i.touches[1].pageX
  3744. , t = i.touches[0].pageY - i.touches[1].pageY;
  3745. this.dollyStart.set(e, t)
  3746. }
  3747. }
  3748. .bind(this)
  3749. , t = function() {
  3750. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3751. }
  3752. .bind(this)
  3753. , n = function() {
  3754. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3755. }
  3756. .bind(this);
  3757. switch (this.state = this.touchActions[i.touches.length],
  3758. this.state) {
  3759. case u.PAN_DOLLY:
  3760. e();
  3761. case u.PAN:
  3762. t();
  3763. break;
  3764. case u.ROTATE_DOLLY:
  3765. e();
  3766. case u.ROTATE:
  3767. n()
  3768. }
  3769. this.rotationSpeed.set(0, 0),
  3770. this.emit(f.InputStart, "touch")
  3771. }
  3772. }
  3773. ,
  3774. n.prototype.onTouchMove = function(a) {
  3775. if (this.enabled && this.state !== u.NONE) {
  3776. a.preventDefault(),
  3777. a.stopPropagation();
  3778. var s = function() {
  3779. var e = a.touches[0].pageX - a.touches[1].pageX
  3780. , t = a.touches[0].pageY - a.touches[1].pageY;
  3781. this.dollyEnd.set(e, t);
  3782. var i = this.dollyStart.length() - this.dollyEnd.length();
  3783. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3784. this.dollyStart.copy(this.dollyEnd)
  3785. }
  3786. .bind(this)
  3787. , e = function() {
  3788. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3789. this.panDelta.subVectors(this.panEnd, this.panStart),
  3790. this.pan(this.panDelta.x, this.panDelta.y),
  3791. this.panStart.copy(this.panEnd),
  3792. this.rotateDelta.set(0, 0)
  3793. }
  3794. .bind(this)
  3795. , l = function() {
  3796. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3797. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3798. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3799. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3800. this.rotateStart.copy(this.rotateEnd)
  3801. }
  3802. .bind(this)
  3803. , t = function() {
  3804. if (2 === a.touches.length) {
  3805. var e = window.devicePixelRatio || 1
  3806. , t = a.touches[1].pageX - a.touches[0].pageX
  3807. , i = a.touches[1].pageY - a.touches[0].pageY
  3808. , n = Math.sqrt(t * t + i * i);
  3809. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3810. this.state = u.DOLLY,
  3811. s();
  3812. else {
  3813. var r = h.average(a.touches, "pageX")
  3814. , o = h.average(a.touches, "pageY");
  3815. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3816. this.rotateStart.set(r, o),
  3817. l())
  3818. }
  3819. }
  3820. }
  3821. .bind(this);
  3822. switch (this.state) {
  3823. case u.PAN_DOLLY:
  3824. s();
  3825. case u.PAN:
  3826. e();
  3827. break;
  3828. case u.ROTATE_DOLLY:
  3829. t();
  3830. break;
  3831. case u.DOLLY:
  3832. s();
  3833. break;
  3834. case u.ROTATE:
  3835. l();
  3836. break;
  3837. default:
  3838. this.state = u.NONE
  3839. }
  3840. this.lastMoveTime = a.timeStamp,
  3841. this.emit(f.Move, "touch")
  3842. }
  3843. }
  3844. ,
  3845. n.prototype.onTouchEnd = function(e) {
  3846. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3847. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3848. this.state = u.NONE,
  3849. this.update(),
  3850. this.rotationAcceleration.set(0, 0),
  3851. this.rotateDelta.set(0, 0))
  3852. }
  3853. ,
  3854. n.prototype.onPointerDown = function(e) {
  3855. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3856. id: e.pointerId,
  3857. pageX: e.pageX,
  3858. pageY: e.pageY
  3859. }),
  3860. e.touches = this.pointers,
  3861. this.onTouchStart(e)),
  3862. this.emit(f.InputStart, "pointer"))
  3863. }
  3864. ,
  3865. n.prototype.onPointerMove = function(t) {
  3866. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3867. t.pointerId === e.id && (e.pageX = t.pageX,
  3868. e.pageY = t.pageY)
  3869. }),
  3870. t.touches = this.pointers,
  3871. this.onTouchMove(t))
  3872. }
  3873. ,
  3874. n.prototype.onPointerUp = function(i) {
  3875. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3876. i.pointerId === e.id && this.pointers.splice(t, 1)
  3877. }
  3878. .bind(this)),
  3879. i.touches = this.pointers,
  3880. this.onTouchEnd(i))
  3881. }
  3882. ,
  3883. n.prototype.reset = function() {
  3884. this.state = u.NONE,
  3885. this.stopAutoPanning(),
  3886. this.rotationSpeed.set(0, 0),
  3887. this.rotationAcceleration.set(0, 0),
  3888. this.panSpeed.set(0, 0),
  3889. this.panAcceleration.set(0, 0)
  3890. }
  3891. ,
  3892. n.prototype.toJSON = function() {
  3893. return {
  3894. camera_position: {
  3895. x: s.toPrecision(this.camera.position.x, 4),
  3896. y: s.toPrecision(this.camera.position.y, 4),
  3897. z: s.toPrecision(this.camera.position.z, 4)
  3898. },
  3899. camera_quaternion: {
  3900. x: s.toPrecision(this.camera.quaternion.x, 4),
  3901. y: s.toPrecision(this.camera.quaternion.y, 4),
  3902. z: s.toPrecision(this.camera.quaternion.z, 4),
  3903. w: s.toPrecision(this.camera.quaternion.w, 4)
  3904. }
  3905. }
  3906. }
  3907. ,
  3908. t.exports = n
  3909. }
  3910. , {
  3911. "../enum/ControlActions": 20,
  3912. "../enum/ControlEvents": 21,
  3913. "../enum/Keys": 30,
  3914. "../enum/MouseButton": 34,
  3915. "../enum/Vectors": 50,
  3916. "../settings": 166,
  3917. "../util/common": 185,
  3918. "../util/math": 190,
  3919. events: 202,
  3920. three: 217
  3921. }],
  3922. 13: [function(u, d, e) {
  3923. (function(e) {
  3924. "use strict";
  3925. function t(e) {
  3926. this.camera = e,
  3927. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3928. this.lookVector = new s.Vector3,
  3929. this.lookSpeed = .05,
  3930. this.rotationAcc = new s.Vector2,
  3931. this.rotationSpeed = new s.Vector2,
  3932. this.lat = 0,
  3933. this.lon = 0,
  3934. this.phi = 0,
  3935. this.theta = 0,
  3936. this.enabled = !1,
  3937. this.locked = !1,
  3938. this.pointer = new s.Vector2(0,0),
  3939. this.rotationHistory = [],
  3940. this.rotationDifference = new s.Vector2,
  3941. this.pointerDragOn = !1,
  3942. this.pointerDragStart = new s.Vector2(0,0),
  3943. this.pinchDistance = 0,
  3944. this.moveStart = new s.Vector2,
  3945. this.moveTolerance = .01,
  3946. this.pointersLimit = 2,
  3947. this.pointers = []
  3948. //watch(this, 'enabled', this.enabled)
  3949. }
  3950. var s = u("three")
  3951. , i = u("../util/logger")
  3952. , n = u("../settings")
  3953. , r = u("../util/common")
  3954. , o = u("../util/math")
  3955. , a = (u("../enum/Vectors"),
  3956. u("../enum/MouseButton"))
  3957. , l = u("../enum/Keys")
  3958. , c = u("../enum/ControlEvents")
  3959. , h = u("events").EventEmitter;
  3960. new i(e),
  3961. (t.prototype = Object.create(h.prototype)).usable = function() {
  3962. return this.enabled && !this.locked
  3963. }
  3964. ,
  3965. /* t.prototype.lookAt = function(e) {
  3966. var t = this.camera.position.clone().sub(e)
  3967. , i = Math.atan(t.z / t.x);
  3968. i += t.x < 0 ? Math.PI : 0,
  3969. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3970. this.lon = s.Math.radToDeg(i) + 180;
  3971. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3972. , r = Math.atan(t.y / n);
  3973. this.lat = -s.Math.radToDeg(r)
  3974. } */
  3975. t.prototype.lookAt = function(aim, dir) {
  3976. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  3977. var i = Math.atan(t.z / t.x);
  3978. i += t.x < 0 ? Math.PI : 0;
  3979. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  3980. this.lon = s.Math.radToDeg(i) + 180;
  3981. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  3982. o = Math.atan(t.y / n);
  3983. this.lat = -s.Math.radToDeg(o);
  3984. }
  3985. ,
  3986. t.prototype.startRotationFrom = function(e, t) {
  3987. o.convertScreenPositionToNDC(e, t, this.pointer),
  3988. this.pointerDragOn = !0,
  3989. this.pointerDragStart.copy(this.pointer),
  3990. this.moveStart.copy(this.pointer),
  3991. this.rotationHistory = [],
  3992. this.rotationSpeed.set(0, 0)
  3993. }
  3994. ,
  3995. t.prototype.onMouseOver = function(e) {
  3996. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3997. }
  3998. ,
  3999. t.prototype.onTouchStart = function(e) {
  4000. if (this.usable()) {
  4001. switch (e.preventDefault(),
  4002. e.stopPropagation(),
  4003. e.touches.length) {
  4004. case 1:
  4005. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4006. break;
  4007. case 2:
  4008. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4009. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4010. this.pinchDistance = Math.sqrt(t * t + i * i)
  4011. }
  4012. this.emit(c.InputStart, "touch")
  4013. }
  4014. }
  4015. ,
  4016. t.prototype.onPointerDown = function(e) {
  4017. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4018. id: e.pointerId,
  4019. clientX: e.clientX,
  4020. clientY: e.clientY
  4021. }),
  4022. e.touches = this.pointers,
  4023. this.onTouchStart(e),
  4024. this.emit(c.InputStart, "pointer"))
  4025. }
  4026. ,
  4027. t.prototype.onMouseDown = function(e) {
  4028. if (this.usable()) {
  4029. switch (e.preventDefault(),
  4030. e.stopPropagation(),
  4031. e.button) {
  4032. case a.LEFT:
  4033. this.startRotationFrom(e.clientX, e.clientY)
  4034. }
  4035. this.emit(c.InputStart, "mouse")
  4036. }
  4037. }
  4038. ,
  4039. t.prototype.updateRotation = function() {
  4040. if (this.usable() && this.pointerDragOn) {
  4041. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4042. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4043. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4044. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4045. , r = Math.atan2(e.y, i)
  4046. , o = Math.atan2(t.y, n);
  4047. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4048. e.y = 0,
  4049. t.y = 0;
  4050. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4051. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4052. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4053. this.pointerDragStart.copy(this.pointer)
  4054. }
  4055. }
  4056. ,
  4057. t.prototype.onMouseMove = function(e) {
  4058. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4059. 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"))
  4060. }
  4061. ,
  4062. t.prototype.onTouchMove = function(e) {
  4063. if (this.usable())
  4064. switch (this.emit(c.Move, "touch"),
  4065. e.touches.length) {
  4066. case 1:
  4067. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4068. break;
  4069. case 2:
  4070. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4071. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4072. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4073. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4074. this.emit(c.Pinch, n),
  4075. this.pinchDistance -= n)
  4076. }
  4077. }
  4078. ,
  4079. t.prototype.onPointerMove = function(t) {
  4080. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4081. t.pointerId === e.id && (e.clientX = t.clientX,
  4082. e.clientY = t.clientY)
  4083. }),
  4084. t.touches = this.pointers,
  4085. this.onTouchMove(t))
  4086. }
  4087. ,
  4088. t.prototype.endRotation = function() {
  4089. this.pointerDragOn = !1;
  4090. var e = r.averageVectors(this.rotationHistory);
  4091. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4092. }
  4093. ,
  4094. t.prototype.onTouchEnd = function(e) {
  4095. this.usable() && (e.preventDefault(),
  4096. e.stopPropagation(),
  4097. this.endRotation())
  4098. }
  4099. ,
  4100. t.prototype.onMouseUp = function(e) {
  4101. this.usable() && (e.preventDefault(),
  4102. e.stopPropagation(),
  4103. this.endRotation())
  4104. }
  4105. ,
  4106. t.prototype.onPointerUp = function(i) {
  4107. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4108. i.pointerId === e.id && this.pointers.splice(t, 1)
  4109. }
  4110. .bind(this)),
  4111. i.touches = this.pointers,
  4112. this.onTouchEnd(i))
  4113. }
  4114. ,
  4115. t.prototype.update = function(e) {
  4116. for (this.lon,
  4117. this.lat,
  4118. this.updateRotation(),
  4119. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4120. this.rotationHistory.shift();
  4121. this.lon += this.rotationDifference.x,
  4122. this.lat += this.rotationDifference.y,
  4123. this.rotationDifference.set(0, 0),
  4124. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4125. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4126. this.lon += this.rotationSpeed.x * e,
  4127. this.lat += this.rotationSpeed.y * e
  4128. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : n.insideLookLimitDown
  4129. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : n.insideLookLimitUp
  4130. insideLookLimitDown = insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4131. insideLookLimitUp = insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4132. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4133. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4134. this.phi = s.Math.degToRad(90 - this.lat),
  4135. this.theta = s.Math.degToRad(this.lon),
  4136. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4137. this.lookVector.y = Math.cos(this.phi),
  4138. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4139. this.target.copy(this.lookVector).add(this.camera.position),
  4140. this.camera.lookAt(this.target)
  4141. }
  4142. ,
  4143. t.prototype.onMouseWheel = function(e) {
  4144. if (this.usable()) {
  4145. var t = e.wheelDelta || -e.detail;
  4146. this.emit(c.InteractionDirect),
  4147. this.emit(c.Scroll, t)
  4148. }
  4149. }
  4150. ,
  4151. t.prototype.onKeyDown = function(e) {
  4152. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4153. this.handleKeyDown(e.which)))
  4154. }
  4155. ,
  4156. t.prototype.handleKeyDown = function(e) {
  4157. var t = function(e, t) {
  4158. this.rotationAcc[e] = t
  4159. }
  4160. .bind(this);
  4161. this.emit(c.InteractionKey);
  4162. var i = !0;
  4163. switch (e) {
  4164. case l.LEFTARROW:
  4165. case l.J:
  4166. t("x", -1);
  4167. break;
  4168. case l.RIGHTARROW:
  4169. case l.L:
  4170. t("x", 1);
  4171. break;
  4172. case l.I:
  4173. t("y", 1);
  4174. break;
  4175. case l.K:
  4176. t("y", -1);
  4177. break;
  4178. default:
  4179. i = !1
  4180. }
  4181. i && this.emit(c.Move, "key")
  4182. }
  4183. ,
  4184. t.prototype.onKeyUp = function(e) {
  4185. this.usable() && (e.preventDefault(),
  4186. e.stopPropagation(),
  4187. this.handleKeyUp(e.which))
  4188. }
  4189. ,
  4190. t.prototype.handleKeyUp = function(e) {
  4191. switch (e) {
  4192. case l.LEFTARROW:
  4193. case l.J:
  4194. case l.RIGHTARROW:
  4195. case l.L:
  4196. this.rotationAcc.x = 0;
  4197. break;
  4198. case l.I:
  4199. case l.K:
  4200. this.rotationAcc.y = 0
  4201. }
  4202. }
  4203. ,
  4204. t.prototype.startRotating = function(e, t) {
  4205. e && (this.rotationAcc.x = e),
  4206. t && (this.rotationAcc.y = t)
  4207. }
  4208. ,
  4209. t.prototype.stopRotating = function(e) {
  4210. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4211. this.rotationAcc.set(0, 0)
  4212. }
  4213. ,
  4214. t.prototype.reset = function() {
  4215. this.pointerDragOn = !1,
  4216. this.rotationAcc.set(0, 0),
  4217. this.rotationSpeed.set(0, 0),
  4218. this.pointers = []
  4219. }
  4220. ,
  4221. t.prototype.toJSON = function() {
  4222. return {
  4223. camera_position: {
  4224. x: o.toPrecision(this.camera.position.x, 4),
  4225. y: o.toPrecision(this.camera.position.y, 4),
  4226. z: o.toPrecision(this.camera.position.z, 4)
  4227. },
  4228. camera_quaternion: {
  4229. x: o.toPrecision(this.camera.quaternion.x, 4),
  4230. y: o.toPrecision(this.camera.quaternion.y, 4),
  4231. z: o.toPrecision(this.camera.quaternion.z, 4),
  4232. w: o.toPrecision(this.camera.quaternion.w, 4)
  4233. }
  4234. }
  4235. }
  4236. ,
  4237. t.prototype.setStateFromJSON = function(e) {
  4238. this.camera.position.copy(e.camera_position),
  4239. this.camera.quaternion.copy(e.camera_quaternion)
  4240. }
  4241. ,
  4242. d.exports = t
  4243. }
  4244. ).call(this, "/js/controls/PanoramaControls.js")
  4245. }
  4246. , {
  4247. "../enum/ControlEvents": 21,
  4248. "../enum/Keys": 30,
  4249. "../enum/MouseButton": 34,
  4250. "../enum/Vectors": 50,
  4251. "../settings": 166,
  4252. "../util/common": 185,
  4253. "../util/logger": 189,
  4254. "../util/math": 190,
  4255. events: 202,
  4256. three: 217
  4257. }],
  4258. 14: [function(t, i, e) {
  4259. (function(e) {
  4260. "use strict";
  4261. var c = t("three")
  4262. , h = t("../enum/Viewmode")
  4263. , u = new (t("../util/logger"))(e);
  4264. i.exports = {
  4265. serialize: function(e) {
  4266. return encodeURI(JSON.stringify(e))
  4267. },
  4268. deserialize: function(e) {
  4269. function t(e) {
  4270. return e.reduce(function(e, t) {
  4271. return e && "number" == typeof t && !isNaN(t)
  4272. }, !0)
  4273. }
  4274. try {
  4275. var i = JSON.parse(decodeURI(e))
  4276. , n = {
  4277. mode: h.fromInt(i.camera_mode),
  4278. panoId: i.scan_id,
  4279. position: (new c.Vector3).copy(i.camera_position),
  4280. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4281. zoom: i.ortho_zoom,
  4282. floorVisibility: i.floor_visibility
  4283. }
  4284. , r = n.position;
  4285. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4286. var o = n.quaternion;
  4287. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4288. n
  4289. } catch (i) {
  4290. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4291. try {
  4292. var a = e.split(",")
  4293. , s = {
  4294. x: parseFloat(a[2]),
  4295. y: parseFloat(a[3]),
  4296. z: parseFloat(a[4])
  4297. }
  4298. , l = {
  4299. x: parseFloat(a[5]),
  4300. y: parseFloat(a[6]),
  4301. z: parseFloat(a[7]),
  4302. w: parseFloat(a[8])
  4303. };
  4304. return t([s.x, s.y, s.z]) || (s.x = 0,
  4305. s.y = 0,
  4306. s.z = 0),
  4307. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4308. l.y = 0,
  4309. l.z = 0,
  4310. l.w = 1),
  4311. {
  4312. mode: h.fromInt(a[0]),
  4313. panoId: a[1],
  4314. position: (new c.Vector3).copy(s),
  4315. quaternion: (new c.Quaternion).copy(l)
  4316. }
  4317. } catch (t) {
  4318. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4319. }
  4320. }
  4321. return null
  4322. }
  4323. }
  4324. }
  4325. ).call(this, "/js/controls/serializer.js")
  4326. }
  4327. , {
  4328. "../enum/Viewmode": 51,
  4329. "../util/logger": 189,
  4330. three: 217
  4331. }],
  4332. 15: [function(C, I, e) {
  4333. (function(e) {
  4334. "use strict";
  4335. function t() {
  4336. this.endlessLoop = r.warp.loop,
  4337. this.clock = new i.Clock(!0),
  4338. this.model = null,
  4339. this.player = null,
  4340. this.currentItem = null,
  4341. this.destinationItem = null,
  4342. this.tourIsPlaying = !1,
  4343. this.transitionStage = v.None,
  4344. this.nextFunc = null,
  4345. this.onTheBus = !1,
  4346. this.tourInProgress = !1,
  4347. this.reachSource = null,
  4348. this.interrupted = !1,
  4349. this.nItems = 0,
  4350. this.walkingSectionPaused = !1
  4351. }
  4352. var i = C("three")
  4353. , n = C("./util/logger")
  4354. , r = C("./settings")
  4355. , o = C("./util/transitions")
  4356. , a = C("events").EventEmitter
  4357. , s = C("./enum/Viewmode")
  4358. , l = C("./analytics")
  4359. , c = C("./enum/WarpStyle")
  4360. , h = (o = C("./util/transitions"),
  4361. C("./model/ModelManager"),
  4362. C("./enum/ModelManagerEvents"))
  4363. , u = C("./enum/DirectorEvents")
  4364. , d = C("./enum/PlayerEvents")
  4365. , p = (C("./enum/ControlEvents"),
  4366. C("./enum/BlackoutStyle"))
  4367. , f = C("./enum/PathDiscardMode")
  4368. , g = C("./enum/PathDisplayMode")
  4369. , m = (C("./player"),
  4370. new n(e))
  4371. , v = Object.freeze({
  4372. None: 0,
  4373. Moving: 1,
  4374. Aiming: 2,
  4375. Interlude: 3
  4376. })
  4377. , y = Object.freeze({
  4378. Forward: 1,
  4379. NoChange: 0,
  4380. Backwards: -1
  4381. })
  4382. , A = o.getUniqueId();
  4383. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4384. this.player = e,
  4385. this.modelManager = t,
  4386. this.updateModel(),
  4387. this.resetAll(),
  4388. this.bindEvents()
  4389. }
  4390. ,
  4391. t.prototype.resetAll = function() {
  4392. if (this.currentItem = null,
  4393. this.destinationItem = null,
  4394. this.tourIsPlaying = !1,
  4395. //this.bgmReplay(),
  4396. this.transitionStage = v.None,
  4397. this.nextFunc = null,
  4398. this.onTheBus = !1,
  4399. this.reachSource = null,
  4400. this.interrupted = !1,
  4401. this.model) {
  4402. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4403. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4404. } else
  4405. this.defaultWarpStyle = c.BLACK,
  4406. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4407. this.resetSpecialTransition()
  4408. }
  4409. ,
  4410. t.prototype.updateModel = function() {
  4411. this.model = this.modelManager.getActiveModel(),
  4412. this.nItems = this.model.heroLocations.length
  4413. }
  4414. ,
  4415. t.prototype.bindEvents = function() {
  4416. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4417. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4418. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4419. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4420. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4421. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4422. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4423. this.player.once(d.Move, function() {
  4424. o.cancelById(A)
  4425. })
  4426. }
  4427. ,
  4428. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4429. return /* e === c.WALK && ( */this.interrupt(p.NONE),
  4430. this.pauseWalkingSection(),
  4431. this.player.fastForwardActivePanoFlight(),
  4432. !0/* ) */
  4433. }
  4434. ,
  4435. t.prototype.handlePlayerMove = function(e) {
  4436. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4437. this.emit("update.controls")
  4438. }
  4439. ,
  4440. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4441. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4442. this.emit("update.controls"))
  4443. }
  4444. ,
  4445. t.prototype.handlePlayerModeChanged = function(e, t) {
  4446. this.intermediateState() || e === t || (this.onTheBus = !1,
  4447. this.emit("update.controls"))
  4448. }
  4449. ,
  4450. t.prototype.handlePlayerInputStart = function(e) {
  4451. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4452. }
  4453. ,
  4454. t.prototype.handlePlayerFlyingStarted = function() {
  4455. this.clearWalkingSectionPaused()
  4456. }
  4457. ,
  4458. t.prototype.describe = function() {
  4459. return {
  4460. nItems: this.nItems,
  4461. currentItem: this.currentItem,
  4462. destinationItem: this.destinationItem,
  4463. tourIsPlaying: this.tourIsPlaying,
  4464. onTheBus: this.onTheBus,
  4465. endlessLoop: this.endlessLoop,
  4466. viewMode: this.player.mode,
  4467. inTransition: this._inTransition(),
  4468. transitionStage: this.transitionStage,
  4469. tourInProgress: this.tourInProgress
  4470. }
  4471. }
  4472. ,
  4473. t.prototype._inTransition = function() {
  4474. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4475. }
  4476. ,
  4477. t.prototype.bounceable = function() {
  4478. var e = this.clock.getDelta();
  4479. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4480. }
  4481. ,
  4482. t.prototype.itemCompare = function(item1, item2, type){//add
  4483. if(type == 'equal'){//==
  4484. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4485. }else if(type == 'less'){//<
  4486. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4487. }
  4488. }
  4489. t.prototype.currentMoveDirection = function() {
  4490. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4491. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.itemCompare(this.destinationItem, this.currentItem,'equal') ? y.NoChange : this.itemCompare(this.currentItem, this.destinationItem,'less') ? y.Forward : y.Backwards
  4492. }
  4493. ,
  4494. t.prototype.clearPath = function() {
  4495. this._inTransition() || this.player.path.discardPathObject()
  4496. }
  4497. ,
  4498. t.prototype.allFloors = function() {
  4499. this.model.toggleAllFloors()
  4500. }
  4501. ,
  4502. t.prototype.actionComplete = function(e) {
  4503. if (this.interrupted = !1,
  4504. this.transitionStage = v.None,
  4505. this.resetSpecialTransition(),
  4506. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4507. this.tourIsPlaying || (this.player.disablePreRendering(),
  4508. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4509. this.emit("update.controls"),
  4510. this.nextFunc) {
  4511. var t = this.nextFunc;
  4512. this.nextFunc = null,
  4513. t()
  4514. }
  4515. }
  4516. ,
  4517. t.prototype.awaitCompletion = function(e, t) {
  4518. this.nextFunc = t,
  4519. e()
  4520. }
  4521. ,
  4522. t.prototype.updateSuccessFunction = function(e) {
  4523. this.nextFunc = e
  4524. }
  4525. ,
  4526. t.prototype.interrupt = function(e, t) {
  4527. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4528. this.tourIsPlaying = !1,
  4529. //this.bgmReplay(),
  4530. this.interrupted = !0,
  4531. this.nextFunc = null,
  4532. this.emit(u.ActionInterrupted),
  4533. null != e || (e = p.BEGINNING),
  4534. this.player.interruptAndFastForward(e, t),
  4535. !0)
  4536. }
  4537. ,
  4538. t.prototype.wouldInterrupt = function() {
  4539. return this.transitionStage !== v.None
  4540. }
  4541. ,
  4542. t.prototype.intermediateState = function() {
  4543. return this.transitionStage !== v.None
  4544. }
  4545. ,
  4546. t.prototype.isInterrupted = function() {
  4547. return this.interrupted
  4548. }
  4549. ,
  4550. t.prototype.pauseWalkingSection = function() {
  4551. this.walkingSectionPaused = !0
  4552. }
  4553. ,
  4554. t.prototype.clearWalkingSectionPaused = function() {
  4555. this.walkingSectionPaused = !1
  4556. }
  4557. ,
  4558. t.prototype.autoTour = function() {
  4559. var i = Date.now();
  4560. this.model.auxDataPromise.then(function() {
  4561. i = Date.now() - i;
  4562. var e = r.warp.auto
  4563. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4564. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4565. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4566. done: function() {
  4567. this.playTour()
  4568. }
  4569. .bind(this),
  4570. name: "_atr",
  4571. id: A
  4572. })
  4573. }
  4574. .bind(this))
  4575. }
  4576. ,
  4577. t.prototype.atDestinationPano = function() {
  4578. if (!this.player.currentPano || null === this.destinationItem)
  4579. return !1;
  4580. var e = this.player.currentPano.id;
  4581. if (void 0 === e)
  4582. return !1;
  4583. var t = this.model.heroLocations;
  4584. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4585. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4586. return destination && destination.panoId == e
  4587. }
  4588. ,
  4589. t.prototype.redirectToItem = function(e, t) {
  4590. if (null != e)
  4591. if (this.wouldInterrupt())
  4592. if (this.player.mode !== s.TRANSITIONING) {
  4593. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4594. var i = function() {
  4595. o.setTimeout(function() {
  4596. this.setDestinationItem(e),
  4597. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4598. }
  4599. .bind(this), 0)
  4600. }
  4601. .bind(this);
  4602. this.interrupt(p.END, 0),
  4603. this.updateSuccessFunction(i)
  4604. } else
  4605. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4606. else
  4607. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4608. else
  4609. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4610. }
  4611. ,
  4612. t.prototype.useSpecialTransition = function(e) {
  4613. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4614. this.nextWarpStyle = c.BLACK
  4615. }
  4616. ,
  4617. t.prototype.resetSpecialTransition = function() {
  4618. this.nextWarpStyle = this.defaultWarpStyle
  4619. }
  4620. ,
  4621. t.prototype.arrivedAtDestination = function(e) {
  4622. if (this.player.flying || this.player.isWarping())
  4623. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4624. else {
  4625. this.transitionStage = v.Aiming;
  4626. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4627. this.player.model.fadePanoMarkers(0),
  4628. this.awaitCompletion(function() {
  4629. this.resetSpecialTransition(),
  4630. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4631. }
  4632. .bind(this), t)
  4633. }
  4634. }
  4635. ,
  4636. t.prototype.goToDestination = function(e, t, i, n) {
  4637. //音频
  4638. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo //只有外层有音乐
  4639. if(musicInfo && musicInfo.music){
  4640. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4641. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4642. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4643. let audioSrc2 = common.getFileNameFromUrl(src)
  4644. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4645. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4646. SoundManager.play('tour',null,0) // currentTime = 0;
  4647. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4648. SoundManager.play('tour')//继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4649. }
  4650. }else{//很可能是该folder的起始
  4651. SoundManager.play('tour', manage.dealURL(src))
  4652. }
  4653. }
  4654. if (this.onTheBus = !0,
  4655. this.emit("update.controls"),
  4656. this.player.updateLastView(),
  4657. n || !this.atDestinationPano()){
  4658. if (this.player.flying || this.player.isWarping())
  4659. m.warn("Cannot go to new destination while player is flying or warping.");
  4660. else {
  4661. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4662. , s = null
  4663. , l = null;
  4664. if (a.isPano()) {
  4665. var o1 = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4666. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4667. s = this.arrivedAtDestination.bind(this, !0)
  4668. //add
  4669. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4670. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4671. }
  4672. } else{
  4673. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4674. s = this.arrivedAtDestination.bind(this, !1);
  4675. }
  4676. this.transitionStage = v.Moving,
  4677. this.model.fadePanoMarkers(0),
  4678. this.awaitCompletion(function() {
  4679. l()
  4680. }
  4681. .bind(this), s),
  4682. this.emit("update.controls")
  4683. }
  4684. }else{
  4685. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4686. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4687. if(a.zoom && a.zoom != this.player.zoomLevel){
  4688. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4689. } */
  4690. this.arrivedAtDestination(!0)
  4691. }
  4692. }
  4693. ,
  4694. t.prototype.tourInterlude = function() {
  4695. if (l.trackAlways("reach_highlight", {
  4696. reach_source: this.reachSource
  4697. }),
  4698. this.model.fadePanoMarkers(0),
  4699. this.emit("update.controls"),
  4700. this.tourIsPlaying)
  4701. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4702. this.stopTour(),
  4703. this.emit(u.TourEnd),
  4704. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4705. this.transitionStage = v.Interlude,
  4706. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4707. }
  4708. .bind(this), this.goNext.bind(this))
  4709. }
  4710. ,
  4711. t.prototype.findNearestItem = function(endToStart=true){//找到离currentPano最近的导览
  4712. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4713. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4714. } */
  4715. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4716. var result = {item:[0,0], dis:Infinity};
  4717. var compare = (location, item)=>{
  4718. if(location.panoId != void 0 && location.panoId!= "outside"){
  4719. var pano = this.model.panos.index[location.panoId];
  4720. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4721. if(dis<result.dis){
  4722. result.item = item, result.dis = dis
  4723. }else if(dis == result.dis){//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4724. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  4725. result.item = item, result.dis = dis
  4726. } */
  4727. if(this.currentItem && Math.abs(item[0]-this.currentItem[0]) < Math.abs(result.item[0]-this.currentItem[0])){
  4728. result.item = item, result.dis = dis
  4729. }
  4730. }
  4731. }
  4732. }
  4733. this.model.heroLocations.forEach((e,i)=>{
  4734. if(e.heroLocations){
  4735. /* e.heroLocations.forEach((a,j)=>{
  4736. compare(a, [i,j])
  4737. }) */
  4738. var location = e.heroLocations.find(e=>e.panoId != void 0)
  4739. location && compare(location, [i,0]) //跳到此区域开头
  4740. }else{
  4741. compare(e, [i,0])
  4742. }
  4743. })
  4744. if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4745. return [0,0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4746. }
  4747. return result.item
  4748. }
  4749. ,
  4750. t.prototype.playTour = function() {
  4751. if (!this.bounceable())
  4752. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4753. this.tourInProgress = !0,
  4754. this.reachSource = "play",
  4755. this.tourIsPlaying = !0,
  4756. this.wasZoomEnabled = this.player.zoomEnabled,
  4757. this.player.zoomEnabled = !1,
  4758. this.resetSpecialTransition(),
  4759. this.emit("update.controls"),
  4760. this.emit(u.TourStart),
  4761. this.player.enablePreRendering(),
  4762. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4763. this.goToDestination()) : /* this.goNext() */(
  4764. this.atEndOfTour() ? this.goNext() : ( this.tourAdvance(0) , this.goToDestination())) )
  4765. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4766. }
  4767. ,
  4768. t.prototype.playTourNearBy = function() {//就近导览
  4769. if (!this.bounceable()){
  4770. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4771. this.tourInProgress = !0,
  4772. this.reachSource = "play",
  4773. this.tourIsPlaying = !0,
  4774. this.wasZoomEnabled = this.player.zoomEnabled,
  4775. this.player.zoomEnabled = !1,
  4776. this.resetSpecialTransition(),
  4777. this.emit("update.controls"),
  4778. this.emit(p.TourStart),
  4779. this.player.enablePreRendering(),
  4780. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4781. this.goToDestination()) : this.goNext())) */
  4782. this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
  4783. }
  4784. },
  4785. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4786. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4787. this.tourIsPlaying = !1,
  4788. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4789. this.interrupt(),
  4790. this.clearWalkingSectionPaused(),
  4791. this.resetSpecialTransition(),
  4792. this.emit("update.controls"))
  4793. }
  4794. ,
  4795. t.prototype.endTourProgress = function() {
  4796. this.tourInProgress = !1,
  4797. this.emit("update.controls"),
  4798. this.emit(u.TourEnd)
  4799. }
  4800. ,
  4801. t.prototype.goToHighlight = function(e) {
  4802. if (this.wouldInterrupt())
  4803. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4804. else {
  4805. if (m.debug("<tour.goto " + e + ">"),
  4806. this.isInterrupted())
  4807. return;
  4808. this.clearWalkingSectionPaused(),
  4809. this.setDestinationItem(e),
  4810. this.useSpecialTransition("Hilight"),
  4811. this.goToDestination(true),//add true
  4812. l.trackAlways("reach_highlight", {
  4813. reach_source: "thumb"
  4814. })
  4815. }
  4816. }
  4817. ,
  4818. t.prototype.prevHighlight = function() {
  4819. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4820. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4821. this.reachSource = "prev",
  4822. this.goPrev()))
  4823. }
  4824. ,
  4825. t.prototype.nextHighlight = function() {
  4826. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4827. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4828. this.reachSource = "next",
  4829. this.goNext()))
  4830. }
  4831. ,
  4832. t.prototype.changeMode = function(e) {
  4833. var t = $.Deferred()
  4834. , i = t.resolve.bind(t)
  4835. , n = t.reject.bind(t);
  4836. if (this.emit(u.StartModeChange),
  4837. !function() {
  4838. return this.clearWalkingSectionPaused(),
  4839. !!this.wouldInterrupt() && (this.interrupt(),
  4840. !0)
  4841. }
  4842. .bind(this)()) {
  4843. switch (e) {
  4844. case s.PANORAMA:
  4845. 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);
  4846. break;
  4847. case s.DOLLHOUSE:
  4848. case s.FLOORPLAN:
  4849. this.player.flyToNewMode({
  4850. mode: e
  4851. }).done(i).fail(n);
  4852. break;
  4853. case s.OUTDOOR:
  4854. 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)
  4855. }
  4856. return t.promise()
  4857. }
  4858. }
  4859. ,
  4860. t.prototype.atEndOfTour = function(item) {
  4861. //return this.currentItem >= this.nItems - 1
  4862. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4863. if(end){
  4864. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4865. if(heroLocations){
  4866. end = this.currentItem[1] >= heroLocations.length - 1
  4867. }
  4868. }
  4869. return end;
  4870. }
  4871. ,
  4872. t.prototype.firstDestination = function() {
  4873. //return 0 < this.nItems ? 0 : null
  4874. return 0 < this.nItems ? [0,0]: null
  4875. }
  4876. ,
  4877. t.prototype.finalDestination = function() {
  4878. //return 0 < this.nItems ? this.nItems - 1 : null
  4879. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4880. }
  4881. ,
  4882. t.prototype.goPrev = function() {
  4883. this.tourAdvance(-1)
  4884. }
  4885. ,
  4886. t.prototype.goNext = function() {
  4887. this.tourAdvance(1)
  4888. }
  4889. ,
  4890. t.prototype.setDestinationItem = function(e) {
  4891. this.destinationItem = e,
  4892. this.emit("update.controls")
  4893. }
  4894. ,
  4895. t.prototype.setCurrentItem = function(e) {
  4896. this.currentItem = e,
  4897. this.emit("update.controls")
  4898. }
  4899. ,
  4900. t.prototype.nextItem = function(currentItem) {
  4901. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4902. if(currentItem == void 0)return this.firstDestination()
  4903. var currentLocation = this.model.heroLocations[currentItem[0]];
  4904. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4905. var item;
  4906. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4907. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4908. }else{
  4909. item = [currentItem[0] , currentItem[1]+1]
  4910. }
  4911. if(item[0] >= this.nItems ){
  4912. item = this.firstDestination()
  4913. }
  4914. return item;
  4915. //暂时不理会endlessLoop,默认为false
  4916. }
  4917. ,
  4918. t.prototype.prevItem = function(currentItem) {
  4919. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4920. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4921. var item;
  4922. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4923. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4924. else{
  4925. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4926. if(this.currentItem[1] == 0){//子目录中第一个
  4927. return [currentItem[0] - 1, lastChildNum-1]
  4928. }else{
  4929. return [currentItem[0], currentItem[1]-1]
  4930. }
  4931. }
  4932. }
  4933. ,
  4934. t.prototype.tourAdvance = function(e) {//e是1或-1或0
  4935. m.debug("tourAdvance(" + e + ")")
  4936. if(null === this.currentItem || void 0 === this.currentItem){
  4937. this.setDestinationItem(this.firstDestination())
  4938. }else{
  4939. var item = this.currentItem
  4940. if(e == 1){
  4941. item = this.nextItem(this.currentItem)
  4942. }else if(e == -1){
  4943. item = this.prevItem(this.currentItem)
  4944. }
  4945. this.setDestinationItem(item)
  4946. }
  4947. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4948. this.useSpecialTransition("reverse-looping to end")
  4949. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4950. this.useSpecialTransition("looping back to start")
  4951. }
  4952. /* if(this.destinationItem[0] < 0 ){
  4953. this.setDestinationItem(this.finalDestination())
  4954. this.useSpecialTransition("reverse-looping to end")
  4955. }else{
  4956. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4957. this.useSpecialTransition("looping back to start"))
  4958. } */
  4959. /* var momentTour = this.getMomentTour(this.destinationItem);
  4960. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4961. var i = this.player.zoomLevel;
  4962. this.player.zoomEnabled = !0;
  4963. var t = function(e, t) {
  4964. this.player.zoomTo((1 - e) * i, !0)
  4965. }
  4966. .bind(this);
  4967. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4968. } */
  4969. this.goToDestination()
  4970. }
  4971. ,
  4972. t.prototype.getMomentTour = function(destinationItem) {//add
  4973. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  4974. if(!destinationItem) return wholeMomentTour
  4975. else{
  4976. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  4977. if(currentLocation.momentTour)return currentLocation.momentTour;
  4978. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  4979. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  4980. }
  4981. }
  4982. ,
  4983. I.exports = t
  4984. }
  4985. ).call(this, "/js/director.js")
  4986. }
  4987. , {
  4988. "./analytics": 4,
  4989. "./enum/BlackoutStyle": 18,
  4990. "./enum/ControlEvents": 21,
  4991. "./enum/DirectorEvents": 23,
  4992. "./enum/ModelManagerEvents": 33,
  4993. "./enum/PathDiscardMode": 38,
  4994. "./enum/PathDisplayMode": 39,
  4995. "./enum/PlayerEvents": 40,
  4996. "./enum/Viewmode": 51,
  4997. "./enum/WarpStyle": 52,
  4998. "./model/ModelManager": 140,
  4999. "./player": 155,
  5000. "./settings": 166,
  5001. "./util/logger": 189,
  5002. "./util/transitions": 195,
  5003. events: 202,
  5004. three: 217
  5005. }],
  5006. 16: [function(e, t, i) {
  5007. "use strict";
  5008. var n = e("three")
  5009. , r = e("./enum/Viewmode")
  5010. , o = (e("./settings"),
  5011. e("./util/transitions"))
  5012. , a = e("./enum/PlayerEvents")
  5013. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5014. , l = new n.ShaderPass(n.VerticalBlurShader);
  5015. l.renderToScreen = !0;
  5016. var c = $("#player").width() / $("#player").height();
  5017. isNaN(c) && (c = 1);
  5018. //initTransitionPass(n)
  5019. var h = {
  5020. currentBlur: 0,
  5021. aspect: c,
  5022. blurStrength: 1,
  5023. hblurPass: s,
  5024. vblurPass: l,
  5025. fastTranMaskPass : new n.TransitionPass(),
  5026. bindEvents: function(e) {
  5027. e.on(a.ModeChanged, function(e, t) {
  5028. e === r.PANORAMA && (o.cancel(h.blur),
  5029. o.cancel(h.addBlur),
  5030. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5031. })
  5032. },
  5033. blur: function(e) {
  5034. var t = (h.currentBlur = e) * h.blurStrength;
  5035. l.uniforms.v.value = t / 512 * h.aspect,
  5036. s.uniforms.h.value = t / 512
  5037. },
  5038. addBlur: function(e) {
  5039. e = Math.max(e, h.currentBlur),
  5040. h.blur(e)
  5041. },
  5042. removeBlur: function(e) {
  5043. e = Math.min(1 - e, h.currentBlur),
  5044. h.blur(e)
  5045. }
  5046. };
  5047. h.blur(0),
  5048. t.exports = h
  5049. }
  5050. , {
  5051. "./enum/PlayerEvents": 40,
  5052. "./enum/Viewmode": 51,
  5053. "./settings": 166,
  5054. "./util/transitions": 195,
  5055. three: 217
  5056. }],
  5057. 17: [function(e, t, i) {
  5058. "use strict";
  5059. t.exports = {
  5060. UNKNOWN: 0,
  5061. ALIGNED: 1,
  5062. UNALIGNED: 2,
  5063. PLACED: 3
  5064. }
  5065. }
  5066. , {}],
  5067. 18: [function(e, t, i) {
  5068. "use strict";
  5069. t.exports = {
  5070. NONE: 0,
  5071. MIDDLE: 1,
  5072. END: 2,
  5073. BEGINNING: 3,
  5074. FADEIN: 4
  5075. }
  5076. }
  5077. , {}],
  5078. 19: [function(e, t, i) {
  5079. "use strict";
  5080. var r = e("three");
  5081. t.exports = {
  5082. newBlue: new r.Color(4967932),
  5083. altBlue: new r.Color(47355),
  5084. tagDefault: new r.Color(223357),
  5085. classicBlue: new r.Color(53759),
  5086. mpYellow: new r.Color(16502016),
  5087. mpOrange: new r.Color(16428055),
  5088. mpBlue: new r.Color(12096),
  5089. mpLtGrey: new r.Color(13751252),
  5090. mpDkGrey: new r.Color(10000019),
  5091. mpRed: new r.Color(12525854),
  5092. mpOrangeDesat: new r.Color(16764529),
  5093. mpBlueDesat: new r.Color(4034734),
  5094. mpRedDesat: new r.Color(14705505),
  5095. white: new r.Color(16777215),
  5096. black: new r.Color(0),
  5097. _desat: function(e, t) {
  5098. var i = t || .3
  5099. , n = (new r.Color).copy(e).getHSL();
  5100. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5101. },
  5102. _darken: function(e, t) {
  5103. var i = t || .2
  5104. , n = e.getHSL();
  5105. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5106. }
  5107. }
  5108. }
  5109. , {
  5110. three: 217
  5111. }],
  5112. 20: [function(e, t, i) {
  5113. "use strict";
  5114. t.exports = {
  5115. NONE: -1,
  5116. ROTATE: 0,
  5117. DOLLY: 1,
  5118. PAN: 2,
  5119. ROTATE_DOLLY: 3,
  5120. PAN_DOLLY: 4
  5121. }
  5122. }
  5123. , {}],
  5124. 21: [function(e, t, i) {
  5125. "use strict";
  5126. t.exports = {
  5127. Move: "move",
  5128. InteractionDirect: "interaction.direct",
  5129. InteractionKey: "interaction.key",
  5130. InteractionGui: "interaction.gui",
  5131. FlyInDirection: "fly.direction",
  5132. InputStart: "input.start",
  5133. Pinch: "input.pinch",
  5134. Scroll: "input.scroll",
  5135. AutoPanInterrupt: "autopan.interrupt",
  5136. AutoPanComplete: "autopan.complete",
  5137. AutoPanClamped: "autopan.clamped",
  5138. LongTap: "longtap"
  5139. }
  5140. }
  5141. , {}],
  5142. 22: [function(e, t, i) {
  5143. "use strict";
  5144. t.exports = Object.freeze({
  5145. FORWARD: "FORWARD",
  5146. LEFT: "LEFT",
  5147. RIGHT: "RIGHT",
  5148. BACK: "BACK",
  5149. UP: "UP",
  5150. DOWN: "DOWN"
  5151. })
  5152. }
  5153. , {}],
  5154. 23: [function(e, t, i) {
  5155. "use strict";
  5156. t.exports = {
  5157. ActionInterrupted: "action.interrupted",
  5158. TourStart: "tour.start",
  5159. TourEnd: "tour.end",
  5160. StartModeChange: "mode.startChange"
  5161. }
  5162. }
  5163. , {}],
  5164. 24: [function(e, t, i) {
  5165. "use strict";
  5166. t.exports = Object.freeze({
  5167. None: 0,
  5168. Queued: 1,
  5169. ForceQueued: 2,
  5170. Downloading: 3,
  5171. Downloaded: 4,
  5172. DownloadFailed: 5
  5173. })
  5174. }
  5175. , {}],
  5176. 25: [function(e, t, i) {
  5177. "use strict";
  5178. t.exports = {
  5179. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5180. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5181. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5182. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5183. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5184. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5185. }
  5186. }
  5187. , {}],
  5188. 26: [function(e, t, i) {
  5189. "use strict";
  5190. t.exports = {
  5191. Texture2D: 0,
  5192. TextureCube: 1
  5193. }
  5194. }
  5195. , {}],
  5196. 27: [function(e, t, i) {
  5197. "use strict";
  5198. t.exports = {
  5199. SMALL: "small",
  5200. LARGE: "large"
  5201. }
  5202. }
  5203. , {}],
  5204. 28: [function(e, t, i) {
  5205. "use strict";
  5206. var n = e("./Viewmode")
  5207. , r = {
  5208. LANDING: {},
  5209. NAVIGATION: "navigation",
  5210. MORE_HELP: "moreHelp",
  5211. TOUR_INTERACTION: {}
  5212. };
  5213. r.LANDING[n.PANORAMA] = "panorama.landing",
  5214. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5215. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5216. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5217. r.TOUR_INTERACTION.standard = "standard.tour",
  5218. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5219. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5220. t.exports = r
  5221. }
  5222. , {
  5223. "./Viewmode": 51
  5224. }],
  5225. 29: [function(e, t, i) {
  5226. "use strict";
  5227. var n = {
  5228. UP: 1,
  5229. DOWN: -1,
  5230. LEFT: "L",
  5231. RIGHT: "R",
  5232. FORWARD: "F",
  5233. BACK: "B",
  5234. reverse: {},
  5235. opposite: function(e) {
  5236. return this.reverse[e.toString()]
  5237. }
  5238. };
  5239. n.reverse[n.UP] = n.DOWN,
  5240. n.reverse[n.DOWN] = n.UP,
  5241. n.reverse[n.LEFT] = n.RIGHT,
  5242. n.reverse[n.RIGHT] = n.LEFT,
  5243. n.reverse[n.FORWARD] = n.BACK,
  5244. n.reverse[n.BACK] = n.FORWARD,
  5245. t.exports = n
  5246. }
  5247. , {}],
  5248. 30: [function(e, t, i) {
  5249. "use strict";
  5250. var n = {
  5251. ZERO: 48,
  5252. ONE: 49,
  5253. TWO: 50,
  5254. THREE: 51,
  5255. FOUR: 52,
  5256. FIVE: 53,
  5257. SIX: 54,
  5258. SEVEN: 55,
  5259. EIGHT: 56,
  5260. NINE: 57,
  5261. LEFTARROW: 37,
  5262. UPARROW: 38,
  5263. RIGHTARROW: 39,
  5264. DOWNARROW: 40,
  5265. A: 65,
  5266. B: 66,
  5267. C: 67,
  5268. D: 68,
  5269. E: 69,
  5270. F: 70,
  5271. G: 71,
  5272. H: 72,
  5273. I: 73,
  5274. J: 74,
  5275. K: 75,
  5276. L: 76,
  5277. M: 77,
  5278. N: 78,
  5279. O: 79,
  5280. P: 80,
  5281. Q: 81,
  5282. R: 82,
  5283. S: 83,
  5284. T: 84,
  5285. U: 85,
  5286. V: 86,
  5287. W: 87,
  5288. X: 88,
  5289. Y: 89,
  5290. Z: 90,
  5291. SPACE: 32,
  5292. RETURN: 13,
  5293. SEMICOLON: 186,
  5294. PLUSEQUALS: 187,
  5295. DASHUNDERSCORE: 189,
  5296. OPENBRACKET: 219
  5297. };
  5298. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5299. n.PLUSEQUALS = 61,
  5300. n.DASHUNDERSCORE = 173),
  5301. t.exports = n
  5302. }
  5303. , {
  5304. "../util/browser": 182
  5305. }],
  5306. 31: [function(e, t, i) {
  5307. "use strict";
  5308. t.exports = {
  5309. EN_US: "en-US",
  5310. ES_MX: "es-MX",
  5311. FR_FR: "fr-FR",
  5312. DE_DE: "de-DE",
  5313. RU_RU: "ru-RU",
  5314. CN_CN: "cn-CN",
  5315. JP_JP: "jp-JP"
  5316. }
  5317. }
  5318. , {}],
  5319. 32: [function(e, t, i) {
  5320. "use strict";
  5321. t.exports = {
  5322. TagActivated: "tag.activated",
  5323. TagDismissed: "tag.dismissed",
  5324. TagNavigation: "tag.navigation"
  5325. }
  5326. }
  5327. , {}],
  5328. 33: [function(e, t, i) {
  5329. "use strict";
  5330. t.exports = {
  5331. ModelAdded: "model-added",
  5332. ActiveModelChanged: "active-model-changed"
  5333. }
  5334. }
  5335. , {}],
  5336. 34: [function(e, t, i) {
  5337. "use strict";
  5338. t.exports = {
  5339. LEFT: 0,
  5340. MIDDLE: 1,
  5341. RIGHT: 2
  5342. }
  5343. }
  5344. , {}],
  5345. 35: [function(e, t, i) {
  5346. "use strict";
  5347. t.exports = {
  5348. PanoRenderComplete: "panorama.render.complete",
  5349. TileRenderFailure: "panorama.tile.render.failed",
  5350. TileRenderSuccess: "panorama.tile.render.success",
  5351. TileUploadAttempted: "panorama.tile.upload.attempted",
  5352. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5353. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5354. }
  5355. }
  5356. , {}],
  5357. 36: [function(e, t, i) {
  5358. "use strict";
  5359. t.exports = {
  5360. BASE: 1,
  5361. STANDARD: 2,
  5362. HIGH: 3,
  5363. ULTRAHIGH: 4
  5364. }
  5365. }
  5366. , {}],
  5367. 37: [function(e, t, i) {
  5368. "use strict";
  5369. t.exports = {
  5370. LoadComplete: "panorama.load.complete",
  5371. LoadFailed: "panorama.load.failed",
  5372. TileLoaded: "panorama.tile.loaded"
  5373. }
  5374. }
  5375. , {}],
  5376. 38: [function(e, t, i) {
  5377. "use strict";
  5378. t.exports = Object.freeze({
  5379. Standard: 0,
  5380. Slow: 1,
  5381. Retain: 2
  5382. })
  5383. }
  5384. , {}],
  5385. 39: [function(e, t, i) {
  5386. "use strict";
  5387. t.exports = Object.freeze({
  5388. Show: 0,
  5389. Hide: 1,
  5390. Retain: 2
  5391. })
  5392. }
  5393. , {}],
  5394. 40: [function(e, t, i) {
  5395. "use strict";
  5396. t.exports = {
  5397. Move: "move",
  5398. MoveComplete: "move.complete",
  5399. ModeChanged: "mode.changed",
  5400. ModeChanging: "mode.changing",
  5401. PanoChosen: "pano.chosen",
  5402. ClosestPanoChanging: "closest.pano.changing",
  5403. WarpStarted: "warp.started",
  5404. WarpInterrupted: "warp.interrupted",
  5405. WarpEnded: "warp.ended",
  5406. FlyinFinished: "flyin.finished",
  5407. FlyingStarted: "flying.started",
  5408. FlyingInterrupted: "flying.interrupted",
  5409. FlyingEnded: "flying.ended",
  5410. Ready: "ready",
  5411. StartInside: "start.inside",
  5412. StartOutside: "start.outside",
  5413. ViewChanged: "view.changed",
  5414. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5415. InputStart: "input.start"
  5416. }
  5417. }
  5418. , {}],
  5419. 41: [function(e, t, i) {
  5420. "use strict";
  5421. t.exports = Object.freeze({
  5422. DEFAULT: 0,
  5423. PANOMARKERS: 1,
  5424. RETICULE: 2,
  5425. TAG: 3
  5426. })
  5427. }
  5428. , {}],
  5429. 42: [function(e, t, i) {
  5430. "use strict";
  5431. t.exports = {
  5432. visibleFloor: 1,
  5433. ghostFloor: 3,
  5434. boundingSkybox: 1,
  5435. panoMarker: 2,
  5436. reticule: 3,
  5437. tagStem: 4,
  5438. tagDisc: 5,
  5439. ribbon: 100
  5440. }
  5441. }
  5442. , {}],
  5443. 43: [function(e, t, i) {
  5444. "use strict";
  5445. t.exports = {
  5446. ContextCreated: "scene-renderer-context-created",
  5447. AfterRender: "after-render",
  5448. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5449. }
  5450. }
  5451. , {}],
  5452. 44: [function(e, t, i) {
  5453. "use strict";
  5454. t.exports = {
  5455. IDLE: "idle",
  5456. BROWSE: "browse",
  5457. EXAMINE: "examine"
  5458. }
  5459. }
  5460. , {}],
  5461. 45: [function(e, t, i) {
  5462. "use strict";
  5463. t.exports = {
  5464. TileDownloadSuccess: "tiledownloader.download.success",
  5465. TileDownloadFailure: "tiledownloader.download.failure",
  5466. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5467. }
  5468. }
  5469. , {}],
  5470. 46: [function(e, t, i) {
  5471. "use strict";
  5472. t.exports = {
  5473. CardboardAndroid: "googlevr",
  5474. GearVR: "gearvr",
  5475. CardboardIOS: "googlevrios",
  5476. Cardboard: "googlevr"
  5477. }
  5478. }
  5479. , {}],
  5480. 47: [function(e, t, i) {
  5481. "use strict";
  5482. t.exports = {
  5483. NONE: 0,
  5484. CONTEXTUAL: 1,
  5485. ANDROID: 2
  5486. }
  5487. }
  5488. , {}],
  5489. 48: [function(e, t, i) {
  5490. "use strict";
  5491. var n = {
  5492. Title: 0,
  5493. Cardboard: 1
  5494. }
  5495. , r = {
  5496. Title: 0,
  5497. Cardboard: 1,
  5498. Gear: 2
  5499. };
  5500. [n, r].forEach(function(e) {
  5501. e.pageCount = Object.keys(e).length
  5502. }),
  5503. t.exports.ios = n,
  5504. t.exports.standard = r
  5505. }
  5506. , {}],
  5507. 49: [function(e, t, i) {
  5508. "use strict";
  5509. t.exports = {
  5510. Android: "android",
  5511. IOS: "ios",
  5512. Desktop: "desktop",
  5513. UnsupportedAndroid: "android-unsupported"
  5514. }
  5515. }
  5516. , {}],
  5517. 50: [function(e, t, i) {
  5518. "use strict";
  5519. var n = e("three");
  5520. t.exports = {
  5521. UP: new n.Vector3(0,1,0),
  5522. DOWN: new n.Vector3(0,-1,0),
  5523. LEFT: new n.Vector3(-1,0,0),
  5524. RIGHT: new n.Vector3(1,0,0),
  5525. FORWARD: new n.Vector3(0,0,-1),
  5526. BACK: new n.Vector3(0,0,1)
  5527. }
  5528. }
  5529. , {
  5530. three: 217
  5531. }],
  5532. 51: [function(e, t, i) {
  5533. "use strict";
  5534. var n = e("../exception/ViewmodeConvertException")
  5535. , r = e("./coreViewmodes")
  5536. , o = {
  5537. MESH: "mesh",
  5538. OUTDOOR: "outdoor",
  5539. TRANSITIONING: "transitioning",
  5540. toInt: function(e) {
  5541. switch (e) {
  5542. case this.PANORAMA:
  5543. return 1;
  5544. case this.DOLLHOUSE:
  5545. return 2;
  5546. case this.FLOORPLAN:
  5547. return 3;
  5548. case this.OUTDOOR:
  5549. return 4;
  5550. case this.TRANSITIONING:
  5551. return -1
  5552. }
  5553. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5554. },
  5555. fromInt: function(e) {
  5556. switch (e) {
  5557. case "1":
  5558. case 1:
  5559. return this.PANORAMA;
  5560. case "2":
  5561. case 2:
  5562. return this.DOLLHOUSE;
  5563. case "3":
  5564. case 3:
  5565. return this.FLOORPLAN;
  5566. case "4":
  5567. case 4:
  5568. return this.OUTDOOR
  5569. }
  5570. throw new n("No known conversion for int to viewmode for int: " + e)
  5571. },
  5572. convertWorkshopModeInt: function(e) {
  5573. switch (e) {
  5574. case "0":
  5575. case 0:
  5576. case void 0:
  5577. return this.PANORAMA;
  5578. case "1":
  5579. case 1:
  5580. return this.FLOORPLAN;
  5581. case "2":
  5582. case 2:
  5583. return this.DOLLHOUSE;
  5584. case "3":
  5585. case 3:
  5586. return this.MESH
  5587. }
  5588. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5589. }
  5590. };
  5591. e("../util/common").extendObject(o, r),
  5592. t.exports = o
  5593. }
  5594. , {
  5595. "../exception/ViewmodeConvertException": 58,
  5596. "../util/common": 185,
  5597. "./coreViewmodes": 54
  5598. }],
  5599. 52: [function(e, t, i) {
  5600. "use strict";
  5601. t.exports = {
  5602. BLACK: "black",
  5603. STD: "std",
  5604. WALK: "walk"
  5605. }
  5606. }
  5607. , {}],
  5608. 53: [function(e, t, i) {
  5609. "use strict";
  5610. t.exports = {
  5611. ZoomIn: "zoom.in",
  5612. ZoomOut: "zoom.out",
  5613. ZoomMax: "zoom.max",
  5614. ZoomMin: "zoom.min"
  5615. }
  5616. }
  5617. , {}],
  5618. 54: [function(e, t, i) {
  5619. "use strict";
  5620. t.exports = {
  5621. PANORAMA: "panorama",
  5622. DOLLHOUSE: "dollhouse",
  5623. FLOORPLAN: "floorplan"
  5624. }
  5625. }
  5626. , {}],
  5627. 55: [function(e, t, i) {
  5628. "use strict";
  5629. t.exports = function(e) {
  5630. this.message = e
  5631. }
  5632. }
  5633. , {}],
  5634. 56: [function(e, t, i) {
  5635. "use strict";
  5636. function n(e) {
  5637. r.call(this, e)
  5638. }
  5639. var r = e("./BasicException");
  5640. n.prototype = Object.create(r.prototype),
  5641. t.exports = n
  5642. }
  5643. , {
  5644. "./BasicException": 55
  5645. }],
  5646. 57: [function(e, t, i) {
  5647. "use strict";
  5648. function n(e) {
  5649. r.call(this, e)
  5650. }
  5651. var r = e("./BasicException");
  5652. n.prototype = Object.create(r.prototype),
  5653. t.exports = n
  5654. }
  5655. , {
  5656. "./BasicException": 55
  5657. }],
  5658. 58: [function(e, t, i) {
  5659. "use strict";
  5660. function n(e) {
  5661. r.call(this, e)
  5662. }
  5663. var r = e("./BasicException");
  5664. n.prototype = Object.create(r.prototype),
  5665. t.exports = n
  5666. }
  5667. , {
  5668. "./BasicException": 55
  5669. }],
  5670. 59: [function(a, s, e) {
  5671. (function(e) {
  5672. "use strict";
  5673. var i = a("./util/ajax")
  5674. , n = a("./util/showcase")
  5675. , t = a("./util/logger")
  5676. , r = new t(e)
  5677. , o = {};
  5678. s.exports = {
  5679. loadFeatureFlags: function(e) {
  5680. var t = $.Deferred();
  5681. return i.get(e.urlBase + "", {
  5682. responseType: "json",
  5683. prefetchFrom: "user",
  5684. auth: n.getAuthorizationHeader()
  5685. }).done(function(e) {
  5686. (o = function(e) {
  5687. var t = {};
  5688. if (e) {
  5689. var i = e.flags;
  5690. if (i)
  5691. for (var n in i)
  5692. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5693. return t
  5694. }
  5695. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5696. null
  5697. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5698. }).fail(function() {
  5699. r.debug("Retrieval of feature flags failed."),
  5700. t.reject("loading-failed")
  5701. }),
  5702. t.promise()
  5703. },
  5704. getFlags: function() {
  5705. return o
  5706. },
  5707. updateDependentSettings: function(e, t) {
  5708. (e = e || o).labels && (t.labels.enabled = !0),
  5709. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5710. e.showcase_sdk && (t.sdkInit = !0),
  5711. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5712. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5713. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5714. e.hide_sc_sharing && (t.share.enabled = !1)
  5715. }
  5716. }
  5717. }
  5718. ).call(this, "/js/featureflags.js")
  5719. }
  5720. , {
  5721. "./util/ajax": 181,
  5722. "./util/logger": 189,
  5723. "./util/showcase": 193
  5724. }],
  5725. 60: [function(e, t, i) {
  5726. "use strict";
  5727. var n = (e("../util/common"),
  5728. {
  5729. status: 0,
  5730. set: function(e) {
  5731. if (isNaN(e))
  5732. return !1;
  5733. var t = $(".progressbar");
  5734. e < 0 && (e = 0),
  5735. 100 < e && (e = 100);
  5736. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5737. , n = Math.round(e)
  5738. , r = parseInt(i) - 15;
  5739. t.find(".bar").css("width", i),
  5740. t.find(".label").css("left", r),
  5741. t.find(".perc").text(n + "%"),
  5742. this.status = e
  5743. },
  5744. done: function(e) {
  5745. return e || this.status ? (this.status = null,
  5746. this.set(100)) : this
  5747. }
  5748. });
  5749. t.exports.circleLoader = n
  5750. }
  5751. , {
  5752. "../util/common": 185
  5753. }],
  5754. 61: [function(e, t, i) {
  5755. "use strict";
  5756. t.exports = Object.freeze({
  5757. CLOSE: "modal.closer.close"
  5758. })
  5759. }
  5760. , {}],
  5761. 62: [function(e, t, i) {
  5762. "use strict";
  5763. function n(t, e) {
  5764. function i() {
  5765. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5766. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5767. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5768. c.classList.remove("closeByFooter")))
  5769. }
  5770. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5771. }
  5772. var r = e("../../settings")
  5773. , o = (e("../../tag/Media/MediaEvent"),
  5774. e("../../util/browser"))
  5775. , a = e("../../util/common")
  5776. , s = e("./ModalCloserEvent")
  5777. , l = e("events").EventEmitter
  5778. , c = document.getElementsByClassName("footer")[0]
  5779. , h = c.querySelectorAll(".close")[0]
  5780. , u = null
  5781. , d = null
  5782. , p = null
  5783. , f = (o.isMobile(),
  5784. {
  5785. open: function(e) {
  5786. e && (n(e),
  5787. u && h.removeEventListener("click", u, !0),
  5788. u = function(e, t) {
  5789. t && (t.stopPropagation(),
  5790. t.preventDefault()),
  5791. e && this.emit(s.CLOSE, e),
  5792. f.reset()
  5793. }
  5794. .bind(this, e.id),
  5795. h.addEventListener("click", u, !0),
  5796. d && window.removeEventListener("resize", d, !0),
  5797. d = n.bind(this, e),
  5798. window.addEventListener("resize", d, !0))
  5799. },
  5800. reset: function() {
  5801. c.classList.remove("closeByFooter"),
  5802. h.removeEventListener("click", u, !0),
  5803. window.removeEventListener("resize", d, !0),
  5804. u = d = p = null
  5805. }
  5806. });
  5807. a.extendObject(f, l.prototype),
  5808. t.exports = f
  5809. }
  5810. , {
  5811. "../../tag/Media/MediaEvent": 131,
  5812. "../../settings": 166,
  5813. "../../util/browser": 182,
  5814. "../../util/common": 185,
  5815. "./ModalCloserEvent": 61,
  5816. events: 202
  5817. }],
  5818. 63: [function(e, t, i) {
  5819. "use strict";
  5820. var A = e("../lib/dat.gui")
  5821. , C = e("three")
  5822. , I = e("../util/easing")
  5823. , E = e("../enum/Viewmode")
  5824. , _ = e("../enum/Colors")
  5825. , b = e("../enum/WarpStyle")
  5826. , w = e("../settings");
  5827. e("../tag/tag"),
  5828. A.GUI.prototype.removeFolder = function(e) {
  5829. var t = this.__folders[e];
  5830. t && (t.close(),
  5831. this.__ul.removeChild(t.domElement.parentNode),
  5832. delete this.__folders[e],
  5833. this.onResize())
  5834. }
  5835. ,
  5836. t.exports.toggle = function(t, e, i) {
  5837. var n = new A.GUI({
  5838. width: 400
  5839. })
  5840. , r = n.addFolder("Flydown from Dollhouse");
  5841. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5842. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5843. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5844. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5845. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5846. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5847. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5848. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5849. var o = n.addFolder("Transition between panos");
  5850. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5851. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5852. w.transition.flyTime = 0,
  5853. o.__controllers.forEach(function(e) {
  5854. e.updateDisplay()
  5855. })
  5856. }),
  5857. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5858. w.transition.flySpeed = 0,
  5859. o.__controllers.forEach(function(e) {
  5860. e.updateDisplay()
  5861. })
  5862. }),
  5863. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5864. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5865. o.add(w.transition, "movementEasing", Object.keys(I));
  5866. var a = n.addFolder("Path Display");
  5867. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5868. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5869. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5870. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5871. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5872. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5873. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5874. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5875. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5876. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5877. w.path.color = _[w.path.color],
  5878. w.path.colorUp = _._desat(w.path.color),
  5879. w.path.colorDown = _.darken(w.path.color)
  5880. }),
  5881. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5882. w.reticuleColor = _[w.reticuleColor]
  5883. });
  5884. var s = n.addFolder("Warping")
  5885. , l = s.addFolder("Warp/Teleport");
  5886. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5887. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5888. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5889. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5890. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5891. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5892. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5893. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5894. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5895. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5896. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5897. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5898. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5899. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5900. w.path.typ = b[w.path.typ]
  5901. }),
  5902. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5903. e.endlessLoop = w.warp.loop
  5904. }),
  5905. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5906. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5907. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5908. var c = s.addFolder("Long Warp Only");
  5909. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5910. w.warp.flySpeed = 0,
  5911. c.__controllers.forEach(function(e) {
  5912. e.updateDisplay()
  5913. })
  5914. }),
  5915. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5916. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5917. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5918. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5919. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5920. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5921. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5922. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5923. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5924. var h = n.addFolder("Warp Esoterica");
  5925. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5926. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5927. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5928. w.warp.minWarpTime = 0,
  5929. h.__controllers.forEach(function(e) {
  5930. e.updateDisplay()
  5931. })
  5932. }),
  5933. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5934. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5935. h.add(w.warp, "movementEasing", Object.keys(I));
  5936. var u = n.addFolder("Misc");
  5937. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5938. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5939. }),
  5940. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5941. i.cameras[E.PANORAMA].fov = w.insideFOV
  5942. }),
  5943. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5944. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5945. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5946. var d = n.addFolder("Navigation");
  5947. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5948. w.navigation.panoScores || t.panos.forEach(function(e) {
  5949. e.floor.remove(e.text3d),
  5950. e.text3d = null
  5951. })
  5952. }),
  5953. d.add(w.navigation, "mouseDirection"),
  5954. d.add(w.navigation, "filterStrictness", 0, 1),
  5955. d.add(w.navigation, "angleFactor", -60, 0),
  5956. d.add(w.navigation, "directionFactor", 1, 20),
  5957. d.add(w.navigation, "distanceFactor", -5, 5),
  5958. d.add(w.navigation, "optionalityFactor", .1, 10);
  5959. var p = n.addFolder("tags")
  5960. , f = p.addFolder("Tag Creation");
  5961. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5962. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5963. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5964. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5965. var g = p.addFolder("Visibility");
  5966. g.add(w.tags.visibility, "anyDistance"),
  5967. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5968. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5969. g.add(w.tags.visibility, "hideViaFloor"),
  5970. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5971. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5972. var m = p.addFolder("Disc Parameters");
  5973. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5974. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5975. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5976. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5977. }),
  5978. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5979. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5980. }),
  5981. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5982. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5983. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5984. var v = p.addFolder("Navigate");
  5985. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5986. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5987. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5988. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5989. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5990. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5991. var y = n.addFolder("Debug");
  5992. y.add(w, "wireframe").onFinishChange(function() {
  5993. t.chunks.forEach(function(e) {
  5994. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5995. e.wireframeTwin.material.depthWrite = !1,
  5996. e.wireframeTwin.material.depthTest = !1,
  5997. e.wireframeTwin.material.opacity = .5,
  5998. e.wireframeTwin.material.transparent = !0),
  5999. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6000. })
  6001. }),
  6002. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6003. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6004. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6005. t.skybox.wireframe = null)
  6006. }),
  6007. y.add(w, "showSweeps").onFinishChange(function() {
  6008. t.setSweepVisibility(w.showSweeps)
  6009. }),
  6010. y.add(w, "showMesh").onFinishChange(function() {
  6011. t.chunks.forEach(function(e) {
  6012. e.visible = w.showMesh
  6013. })
  6014. }),
  6015. y.add(w, "showFloors").onFinishChange(function() {
  6016. t.floors.forEach(function(e) {
  6017. e.collider.children.forEach(function(e) {
  6018. e.material.visible = w.showFloors
  6019. })
  6020. })
  6021. }),
  6022. y.add(w, "showSkyboxes").onFinishChange(function() {
  6023. t.panos.forEach(function(e) {
  6024. e.skyboxMesh.visible = w.showSkyboxes
  6025. })
  6026. }),
  6027. y.add(w, "showNeighbors").onChange(function() {}),
  6028. y.add(t, "alpha", 0, 1)
  6029. }
  6030. }
  6031. , {
  6032. "../enum/Colors": 19,
  6033. "../enum/Viewmode": 51,
  6034. "../enum/WarpStyle": 52,
  6035. "../lib/dat.gui": 93,
  6036. "../tag/tag": 123,
  6037. "../settings": 166,
  6038. "../util/easing": 186,
  6039. three: 217
  6040. }],
  6041. 64: [function(c, h, e) {
  6042. (function(e) {
  6043. "use strict";
  6044. function i(e, t, i, n) {
  6045. $(".gui-error .error-problem-text").text(e),
  6046. $(".gui-error .error-solution-text").text(t),
  6047. $(".gui-error .error-explanation").text(i),
  6048. $(".gui-error .error-actions").html(n),
  6049. $(window).resize(),
  6050. $(".gui-error").fadeIn(),
  6051. $("#bottom-logo").fadeIn()
  6052. }
  6053. function n(e) {
  6054. 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("");
  6055. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6056. r.isMobile() || $("[rel=tiletip]").tooltip({
  6057. placement: "bottom",
  6058. delay: {
  6059. show: 50,
  6060. hide: 0
  6061. },
  6062. trigger: "hover",
  6063. viewport: {
  6064. selector: "body",
  6065. padding: 10
  6066. }
  6067. })
  6068. }
  6069. function t() {
  6070. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6071. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6072. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6073. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6074. e.preventDefault(),
  6075. e.stopPropagation(),
  6076. n(" ")
  6077. })
  6078. }
  6079. var r = c("./../util/browser")
  6080. , o = c("./../analytics")
  6081. , a = c("./../settings")
  6082. , s = c("../localization/localize")
  6083. , l = new (c("./../util/logger"))(e);
  6084. h.exports.error = function(e) {
  6085. if ($("head title").text(a.pageTitle),
  6086. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6087. $("#gui-loading").fadeOut(250),
  6088. $("#quick-blackout").hide(),
  6089. o.track("showcase_error", {
  6090. error_key: e
  6091. }),
  6092. s.locale || s.init(),
  6093. "webgl-unsupported" === e)
  6094. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6095. else if ("webgl-ios" === e)
  6096. 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>.");
  6097. else if ("webgl-safari" === e)
  6098. 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>.");
  6099. else if ("webgl-generic" === e)
  6100. t();
  6101. else if ("missing-urls" === e)
  6102. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6103. else if ("loading-failed" === e)
  6104. 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>.");
  6105. else {
  6106. if ("loading-failed-maintenance" !== e)
  6107. return void l.error("Unhandled error: " + e);
  6108. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6109. }
  6110. }
  6111. }
  6112. ).call(this, "/js/gui/error.js")
  6113. }
  6114. , {
  6115. "../localization/localize": 108,
  6116. "./../analytics": 4,
  6117. "./../settings": 166,
  6118. "./../util/browser": 182,
  6119. "./../util/logger": 189
  6120. }],
  6121. 65: [function(Oe, Le, e) {
  6122. (function(e) {
  6123. "use strict";
  6124. function c() {
  6125. for (var e in Ce)
  6126. if (Ce.hasOwnProperty(e)) {
  6127. var t = Ce[e];
  6128. if (!t.visible)
  6129. for (var i = 0; i < t.elements.length; i++)
  6130. $(t.elements[i]).hide()
  6131. }
  6132. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6133. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6134. ge = [],
  6135. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6136. ge.push(".hideTarget", ".pinTop.right")
  6137. }
  6138. function v(e, t) {
  6139. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6140. $("#gui-zoomin").toggle(i),
  6141. $("#gui-zoomout").toggle(i)
  6142. }
  6143. function l() {
  6144. n(),
  6145. $(".pinBottom").toggleClass("open"),
  6146. $("#drawer").toggleClass("open"),
  6147. $(".footer").toggleClass("open"),
  6148. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6149. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6150. O.resetDrawer()),
  6151. setTimeout(function() {
  6152. $("#pullTab").toggleClass("opened")
  6153. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6154. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6155. }
  6156. function t(e) {
  6157. var t;
  6158. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6159. t = e.position().top + e.outerHeight(),
  6160. e.attr("style", "display: none")),
  6161. $("#player").outerHeight() - 130 < t + 25
  6162. }
  6163. function y(e) {
  6164. "touchstart" === e.type && e.preventDefault(),
  6165. e.stopPropagation()
  6166. }
  6167. function n() {
  6168. w && (w.reload(),
  6169. w.init())
  6170. }
  6171. function r() {
  6172. $("#gui-spinner").stop(!0, !0),
  6173. $("#gui-spinner").fadeOut(1e3),
  6174. !(Ae = !0)
  6175. }
  6176. function A(e, t) {
  6177. var i = e.mode
  6178. , n = t || e.currentPano;
  6179. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6180. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6181. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6182. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6183. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6184. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6185. $("#gui-modes-outside").removeClass("desktop-only")),
  6186. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6187. pe = i,
  6188. $("#gui-modes-outside").addClass("hidden"),
  6189. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6190. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6191. }
  6192. function C(t, i) {
  6193. function e() {
  6194. document.getElementById("vr").classList.remove("hidden"),
  6195. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6196. S.supportsFullscreen() ? function(e) {
  6197. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6198. Q.init(t.data, i, e, x),
  6199. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6200. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6201. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6202. $(".improper-embed").toggleClass("hidden", !1),
  6203. n())
  6204. }, function(e) {
  6205. n()
  6206. }) : n()
  6207. }
  6208. function n() {
  6209. var e;
  6210. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6211. X.init(t.data, x),
  6212. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6213. function() {
  6214. _e("vr"),
  6215. V.open(e)
  6216. }
  6217. )),
  6218. X.on(Z.CLOSED, V.reset)
  6219. }
  6220. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6221. switch (M.vr.option) {
  6222. case le.CONTEXTUAL:
  6223. e();
  6224. break;
  6225. case le.ANDROID:
  6226. S.detectAndroid() && e();
  6227. break;
  6228. case le.NONE:
  6229. }
  6230. }
  6231. function h(e, i) {
  6232. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6233. if ("372" !== getQueryVariable("m")) {
  6234. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6235. $(".gui-floor").find(".container").prepend(r)
  6236. }
  6237. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6238. n.on("click", function(e) {
  6239. y(e),
  6240. _e("floor"),
  6241. n.toggleClass("open")
  6242. }),
  6243. $(".floorChoice").on("click", function(e) {
  6244. y(e);
  6245. var t = $(this).data("index");
  6246. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6247. i.player.gotoFloor(t),
  6248. R.track("showcase_gui", {
  6249. gui_action: "click_floor_select_button",
  6250. interaction_source: "gui"
  6251. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6252. _e("move"),
  6253. i.allFloors(),
  6254. R.track("showcase_gui", {
  6255. gui_action: "click_toggle_all_floors_button",
  6256. interaction_source: "gui"
  6257. })),
  6258. n.removeClass("open")
  6259. })
  6260. }
  6261. function I(e, t) {
  6262. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6263. $(".gui-floor-icon").hide(),
  6264. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6265. $(".gui-floor-icon").show(),
  6266. $(".gui-floor-title").hide()),
  6267. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6268. $(".gui-floor-number").text(se.FLOOR_ALL),
  6269. $(".floorChoice").removeClass("active"),
  6270. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6271. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6272. $(".floorChoice").removeClass("active"),
  6273. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6274. }
  6275. function E() {
  6276. var e = $("#player").width() - 20
  6277. , t = $("#scroller")
  6278. , i = $("#drawer")
  6279. , n = $(".pinBottom");
  6280. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6281. i.addClass("noScroll"),
  6282. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6283. i.toggleClass("noScroll"),
  6284. n.toggleClass("noScroll"))
  6285. }
  6286. function _(e) {
  6287. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6288. e = e || 0,
  6289. Ae = !1,
  6290. window.setTimeout(function() {
  6291. Ae || (!0,
  6292. $("#gui-spinner").stop(!0, !0).show())
  6293. }
  6294. .bind(this), e)
  6295. }(M.modelComponentLoadSpinnerDelay)
  6296. }
  6297. function b(e, t) {
  6298. for (var i = []; e; )
  6299. i.push(e),
  6300. e = e.parentNode;
  6301. for (; t && -1 === i.indexOf(t); )
  6302. t = t.parentNode;
  6303. return t
  6304. }
  6305. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6306. Oe("../util/ajax"),
  6307. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6308. Oe("../util/camera"),
  6309. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6310. 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"),
  6311. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6312. Oe("../enum/PathDisplayMode"),
  6313. Oe("../enum/DirectorEvents"),
  6314. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6315. Oe("../enum/WarpStyle"),
  6316. Oe("../enum/AlignmentType"),
  6317. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6318. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6319. coBrand: {
  6320. visible: !0,
  6321. elements: [".co-brand", "#loaderCoBrand"]
  6322. },
  6323. help: {
  6324. visible: !0,
  6325. elements: [".nav-help", "#nav-help"]
  6326. },
  6327. tourControls: {
  6328. visible: !0,
  6329. elements: [".next", ".previous", "#play"]
  6330. },
  6331. highlight: {
  6332. visible: !0,
  6333. elements: ["#drawer", "#pullTab"]
  6334. },
  6335. share: {
  6336. visible: !0,
  6337. elements: [".socialButton", "#share"]
  6338. },
  6339. fullScreen: {
  6340. visible: !0,
  6341. elements: ["#gui-fullscreen"]
  6342. },
  6343. floors: {
  6344. visible: !0,
  6345. elements: [".gui-floor"]
  6346. }
  6347. }, Ie = (g = document.getElementById("drawer"),
  6348. function() {
  6349. $("#player").height() < 400 && g.classList.contains("open") && l()
  6350. }
  6351. ), Ee = (f = document.getElementById("meta-info"),
  6352. function() {
  6353. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6354. }
  6355. ), _e = (i = document.getElementById("meta-info"),
  6356. s = document.getElementById("interaction-modal"),
  6357. u = $("#drawer").eq(0),
  6358. d = $(".gui-floor").eq(0),
  6359. p = $(".vr-popup").eq(0),
  6360. function(e) {
  6361. switch (e) {
  6362. case "info":
  6363. we(),
  6364. Te(),
  6365. Ie(),
  6366. Me(),
  6367. Re(),
  6368. xe(),
  6369. Pe();
  6370. break;
  6371. case "terms":
  6372. be(),
  6373. Te(),
  6374. Se(),
  6375. Me(),
  6376. Re(),
  6377. xe(),
  6378. Pe();
  6379. break;
  6380. case "help":
  6381. be(),
  6382. we(),
  6383. Me(),
  6384. Re(),
  6385. xe(),
  6386. Pe();
  6387. break;
  6388. case "vr":
  6389. be(),
  6390. we(),
  6391. Me(),
  6392. Re(),
  6393. Te(),
  6394. Pe(),
  6395. t(p) && Se();
  6396. break;
  6397. case "highlights":
  6398. Ee(),
  6399. we(),
  6400. Me(),
  6401. Re();
  6402. break;
  6403. case "share":
  6404. be(),
  6405. we(),
  6406. Te(),
  6407. Re(),
  6408. xe(),
  6409. Pe();
  6410. break;
  6411. case "floor":
  6412. we(),
  6413. Me(),
  6414. xe();
  6415. break;
  6416. case "view":
  6417. Re(),
  6418. Me(),
  6419. we(),
  6420. xe();
  6421. break;
  6422. case "tour":
  6423. case "move":
  6424. we(),
  6425. Me(),
  6426. Re(),
  6427. xe();
  6428. break;
  6429. case "resize":
  6430. be(),
  6431. Ie(),
  6432. Re();
  6433. break;
  6434. case "tag":
  6435. we(),
  6436. Te(),
  6437. Me(),
  6438. Re(),
  6439. xe()
  6440. }
  6441. }
  6442. );
  6443. function be() {
  6444. i.classList.contains("expand") && z.toggleMeta(!0)
  6445. }
  6446. function we() {
  6447. W.hide()
  6448. }
  6449. function Te() {
  6450. U.close()
  6451. }
  6452. function xe() {
  6453. X.dismiss()
  6454. }
  6455. function Se() {
  6456. u.hasClass("open") && l()
  6457. }
  6458. function Me() {
  6459. K.hide()
  6460. }
  6461. function Re() {
  6462. d.hasClass("open") && d.removeClass("open")
  6463. }
  6464. function Pe() {
  6465. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6466. }
  6467. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6468. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6469. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6470. setTimeout(function() {
  6471. $(".icon:visible").hide().show(0)
  6472. }, 100)
  6473. }),
  6474. $("#gui-fullscreen").find("a").on("click", function(e) {
  6475. y(e),
  6476. S.requestFullscreen($("body")[0]),
  6477. R.track("showcase_gui", {
  6478. gui_action: "click_enter_fullscreen",
  6479. interaction_source: "gui"
  6480. })
  6481. }),
  6482. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6483. y(e),
  6484. S.exitFullscreen(),
  6485. R.track("showcase_gui", {
  6486. gui_action: "click_exit_fullscreen",
  6487. interaction_source: "gui"
  6488. })
  6489. }),
  6490. $(window).on("resize", function(e) {
  6491. var t = e.target.innerHeight
  6492. , i = e.target.innerWidth;
  6493. t === o && i === a || (Ce.highlight.visible && E(),
  6494. _e("resize"),
  6495. $(".pinTop.right").removeClass("hideUnderMeta"),
  6496. n(),
  6497. o = t,
  6498. a = i)
  6499. }).resize(),
  6500. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6501. $("#pullTab").on("click", function(e) {
  6502. y(e),
  6503. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6504. gui_action: "hide_highlight_reel"
  6505. }),
  6506. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6507. gui_action: "show_highlight_reel"
  6508. }),
  6509. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6510. l()
  6511. }),
  6512. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6513. $("#hotList").on("click", function(e) {
  6514. y(e);
  6515. var t = $("#hotListWrap")[0];
  6516. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6517. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6518. this.classList.add("active"))
  6519. }),
  6520. $("#hotListContent ul").on("mouseover", function(e) {
  6521. y(e);
  6522. var t = e.target
  6523. , i = document.getElementById("hotListWrap");
  6524. if ("SPAN" === t.tagName) {
  6525. var n = t.parentElement.parentElement;
  6526. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6527. } else if ("LI" === t.tagName) {
  6528. n = t.parentElement;
  6529. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6530. } else
  6531. i.style.width = ""
  6532. }),
  6533. $("#hotListContent ul").on("click", function(e) {
  6534. y(e),
  6535. this.preElem && this.preElem.classList.remove("active"),
  6536. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6537. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6538. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6539. e.target.hot && e.target.hot.examine(!0),
  6540. this.preElem = e.target)
  6541. }),
  6542. $("#hotListClose").on("click", function(e) {
  6543. y(e),
  6544. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6545. $("#hotListContent ul .active").removeClass("active"),
  6546. $("#hotList")[0].classList.remove("active")
  6547. })),
  6548. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6549. $("#more-menu-button").on("click", function(e) {
  6550. y(e),
  6551. $("#more-menu").toggleClass("open")
  6552. }),
  6553. Le.exports.init = function(s, l, c, e, t, i, n) {
  6554. var r;
  6555. x = n,
  6556. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6557. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6558. F.init(),
  6559. D.init(s, i),
  6560. ce.init(s, l, e),
  6561. $(".icon").on("mouseover", function() {
  6562. l.player && l.player.reticule.hide()
  6563. }),
  6564. function(e, t) {
  6565. var i = t.player;
  6566. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6567. y(e),
  6568. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6569. R.track("USER", {
  6570. event_type: "showcase_gui",
  6571. gui_action: "click_inside_mode_button"
  6572. }),
  6573. t.changeMode(ie.PANORAMA)
  6574. }),
  6575. $("#gui-modes-outside").find("a").on("click", function(e) {
  6576. y(e),
  6577. R.track("showcase_gui", {
  6578. gui_action: "click_outside_mode_button"
  6579. }),
  6580. t.changeMode(pe)
  6581. }),
  6582. $("#gui-modes-floorplan").on("click", function(e) {
  6583. y(e),
  6584. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6585. gui_action: "click_floorplan_mode_button"
  6586. }),
  6587. t.changeMode(ie.FLOORPLAN))
  6588. }),
  6589. $("#gui-modes-dollhouse").on("click", function(e) {
  6590. y(e),
  6591. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6592. gui_action: "click_dollhouse_mode_button"
  6593. }),
  6594. t.changeMode(ie.DOLLHOUSE))
  6595. })
  6596. }(0, l),
  6597. function(e, t) {
  6598. $("#play").on("mousedown touchstart", function(e) {
  6599. y(e),
  6600. _e("tour"),
  6601. q.play(),
  6602. R.trackAlways("showcase_gui", {
  6603. gui_action: "play_highlights"
  6604. })
  6605. }),
  6606. window.startAndPlay = function(e) {
  6607. _e("tour"),
  6608. q.play(),
  6609. R.trackAlways("showcase_gui", {
  6610. gui_action: "play_highlights"
  6611. })
  6612. }
  6613. ,
  6614. $("#pause").on("mousedown touchstart", function(e) {
  6615. y(e),
  6616. q.pause(),
  6617. R.trackAlways("showcase_gui", {
  6618. gui_action: "pause_highlights"
  6619. })
  6620. }),
  6621. $("#gui-zoomin").find("a").on("click", function(e) {
  6622. y(e),
  6623. t.player.zoomInIncrementally()
  6624. }),
  6625. $("#gui-zoomout").find("a").on("click", function(e) {
  6626. y(e),
  6627. t.player.zoomOutIncrementally()
  6628. })
  6629. }(0, l),
  6630. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6631. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6632. function() {
  6633. _e("share"),
  6634. V.open(r)
  6635. }
  6636. )),
  6637. K.on(ae.CLOSED, V.reset)),
  6638. 0 < s.heroLocations.length ? function(e, i, t) {
  6639. var n = 100 / (fe = e.heroLocations.length) + "%"
  6640. , r = $("#thumb-container")
  6641. , o = $("#progressBar");
  6642. $("#status").find(".totalSteps").text(fe);
  6643. for (var a = 0; a < fe; a++) {
  6644. var s = e.heroLocations[a]
  6645. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6646. if(s.heroLocations){//有子项,选第一张截图
  6647. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6648. }else{
  6649. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6650. }
  6651. if (l.attr("data-index", a),
  6652. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6653. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6654. s.name) {
  6655. var c = $('<div class="overlay"></div>').text(s.name);
  6656. l.prepend(c)
  6657. }
  6658. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6659. var h = e.panos.get(s.panoId)
  6660. , 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>';
  6661. l.prepend(u)
  6662. }
  6663. r.append(l),
  6664. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6665. }
  6666. T = 144 * fe,
  6667. 111 * fe,
  6668. $(".thumbImg").on("mouseover", function() {
  6669. !function(e) {
  6670. return e.describe().inTransition
  6671. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6672. }),
  6673. $(".thumbImg").on("mouseout", function() {
  6674. i.clearPath()
  6675. }),
  6676. $(".thumbImg").on("click", function(e) {
  6677. y(e);
  6678. var t = $(this);
  6679. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6680. R.trackAlways("showcase_gui", {
  6681. gui_action: "click_highlight"
  6682. }),
  6683. i.goToHighlight([t.data("index"),0])//改
  6684. }),
  6685. $(".previous").find("a").on("click", function(e) {
  6686. y(e),
  6687. R.trackAlways("showcase_gui", {
  6688. gui_action: "prev_highlight"
  6689. }),
  6690. i.prevHighlight()
  6691. }),
  6692. $(".next").find("a").on("click", function(e) {
  6693. y(e),
  6694. R.trackAlways("showcase_gui", {
  6695. gui_action: "next_highlight"
  6696. }),
  6697. i.nextHighlight()
  6698. }),
  6699. $("#drawer").on("mouseleave", function(t) {
  6700. var i;
  6701. y(t);
  6702. try {
  6703. i = new MouseEvent("mouseup",{
  6704. clientX: t.clientX,
  6705. clientY: t.clientY,
  6706. screenX: t.screenX,
  6707. screenY: t.screenY
  6708. })
  6709. } catch (e) {
  6710. (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)
  6711. }
  6712. document.dispatchEvent(i)
  6713. }),
  6714. (w = new Sly($("#scrollFrame"),{
  6715. horizontal: !0,
  6716. itemNav: "centered",
  6717. smart: !0,
  6718. scrollTrap: !0,
  6719. scrollBy: 1,
  6720. mouseDragging: !0,
  6721. touchDragging: !0,
  6722. speed: 300,
  6723. dragHandle: !0,
  6724. dynamicHandle: !0,
  6725. clickBar: !0,
  6726. scrollBar: $("#scroller"),
  6727. activateOn: null
  6728. }).init()).on("active", function(e, t) {
  6729. t,
  6730. _e("tour"),
  6731. $(".step").removeClass("active"),
  6732. $("#status").find(".curIdx").text(t + 1);
  6733. for (var i = 0; i <= t; i++)
  6734. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6735. }),
  6736. E()
  6737. //add :
  6738. let scrollFrame = $(w.frame)
  6739. scrollFrame.on("wheel.sly", function() {
  6740. lastMoveScrollTime = Date.now()
  6741. })
  6742. let dragstart
  6743. /* scrollFrame.on("pointerdown", function() {
  6744. dragstart = true
  6745. })
  6746. scrollFrame.on("pointerup", function() {
  6747. dragstart = false
  6748. }) */
  6749. scrollFrame.on("pointermove", function() {
  6750. //if(dragstart){
  6751. lastMoveScrollTime = Date.now()
  6752. //}
  6753. })
  6754. }(s, l, c) : (Ce.highlight.visible = !1,
  6755. Ce.tourControls.visible = !1),
  6756. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6757. function() {
  6758. var n;
  6759. document.body.addEventListener("mousedown", function(e) {
  6760. n = 0 === e.button || 1 === e.which ? e.target : null
  6761. }, !0),
  6762. document.body.addEventListener("mouseup", function(t) {
  6763. n !== t.target && (n = b(n, t.target));
  6764. var e = document.getElementById("gui-parent");
  6765. if (b(e, n) !== e && (n = null),
  6766. n) {
  6767. var i;
  6768. try {
  6769. i = new MouseEvent("click",t)
  6770. } catch (e) {
  6771. (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)
  6772. }
  6773. i.syntheticClick = !0,
  6774. n.dispatchEvent(i),
  6775. n = null
  6776. }
  6777. }, !0),
  6778. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6779. e.syntheticClick || (e.stopPropagation(),
  6780. "A" === e.target.nodeName && e.preventDefault())
  6781. }, !0)
  6782. }(),
  6783. A(c),
  6784. C(s, t),
  6785. s.on("floor.changed", I),
  6786. s.on("waiting", function(e) {
  6787. _(e)
  6788. }
  6789. .bind(this, s)),
  6790. s.on("waiting-done", function(e) {
  6791. _(e)
  6792. }
  6793. .bind(this, s)),
  6794. c.on(re.ModeChanged, function(e, t) {
  6795. A(c),
  6796. v(l, c),
  6797. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6798. U.updateMode(t)
  6799. }),
  6800. e.on(oe.Move, _e.bind(this, "move")),
  6801. c.on(re.Ready, function() {
  6802. O.init(e, c, c.tagManager, l),
  6803. c.on(re.ModeChanged, function(e, t) {
  6804. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6805. })
  6806. }),
  6807. c.on(re.PanoChosen, function(e, t) {
  6808. A(c, t),
  6809. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6810. }),
  6811. V.on(k.CLOSE, function(e) {
  6812. switch (e) {
  6813. case "vr-modal":
  6814. X.dismiss();
  6815. break;
  6816. case "share-modal":
  6817. K.hide();
  6818. break;
  6819. case "terms-modal":
  6820. W.hide()
  6821. }
  6822. });
  6823. var lastMoveScrollTime = 0;//add
  6824. 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();
  6825. l.on("update.controls", function() {
  6826. var e, t, i, n = l.describe();
  6827. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6828. u.show()),
  6829. n.tourInProgress && (d.forEach(function(e) {
  6830. e.classList.add("playing")
  6831. }),
  6832. p.addClass("playing"),
  6833. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6834. u.hide()),
  6835. n.tourInProgress || (q.stopTour(),
  6836. d.forEach(function(e) {
  6837. e.classList.remove("playing")
  6838. }),
  6839. p.removeClass("playing"),
  6840. f.removeClass("playing"))),
  6841. null !== n.currentItem) {
  6842. var r, o;
  6843. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6844. n.onTheBus ? (r = "active",
  6845. o = "recent") : (o = "active",
  6846. r = "recent");
  6847. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6848. for (e = 0; e < s.heroLocations.length; e += 1)
  6849. i = g.eq(e),
  6850. t = m.eq(e),
  6851. i.removeClass(o),
  6852. t.removeClass(o),
  6853. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6854. t.addClass(r),
  6855. // 如果一段时间内用户不拖拽滚动scroll,才focus回这个item
  6856. (Date.now() - lastMoveScrollTime > 2000) && w.activate(e)
  6857. ): n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6858. t.addClass(r)) : (i.removeClass(r),
  6859. t.removeClass(r))
  6860. } else
  6861. for (e = 0; e < s.heroLocations.length; e += 1)
  6862. i = g.eq(e),
  6863. t = m.eq(e),
  6864. i.removeClass("active recent"),
  6865. t.removeClass("active recent");
  6866. v(l, c)
  6867. }),
  6868. document.addEventListener("keydown", function(e) {
  6869. switch (R.updateInteraction(oe.InteractionKey),
  6870. e.which) {
  6871. case te.ZERO:
  6872. M.debug && s.toggleAlpha();
  6873. break;
  6874. case te.NINE:
  6875. M.debug && B.toggle();
  6876. break;
  6877. case te.ONE:
  6878. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6879. break;
  6880. case te.TWO:
  6881. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6882. break;
  6883. case te.THREE:
  6884. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6885. break;
  6886. case te.FOUR:
  6887. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6888. break;
  6889. case te.SPACE:
  6890. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6891. break;
  6892. case te.RETURN:
  6893. M.debug && s.toggleExplodeUp();
  6894. break;
  6895. case te.P:
  6896. !function(e) {
  6897. me.gui || (me.gui = function(e) {
  6898. var t = new he.GUI;
  6899. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6900. e.setSweepVisibility(M.showSweeps)
  6901. }),
  6902. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6903. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6904. M.transition.flySpeed = 0,
  6905. t.__controllers.forEach(function(e) {
  6906. e.updateDisplay()
  6907. })
  6908. }),
  6909. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6910. $(t.__closeButton).hide(),
  6911. t
  6912. }(me.model)),
  6913. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6914. }(!me.visible);
  6915. break;
  6916. case te.U:
  6917. !function(e) {
  6918. ve.gui || (ve.gui = function(t, i) {
  6919. function e() {
  6920. var e = i.toJSON();
  6921. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6922. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6923. }
  6924. var n = {}
  6925. , r = new he.GUI({
  6926. autoPlace: !0,
  6927. width: "60%"
  6928. });
  6929. return e(),
  6930. i.on(re.ViewChanged, e),
  6931. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6932. r.domElement.id = "datLinks",
  6933. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6934. if (!S.detectSafari()) {
  6935. var t = document.createElement("button");
  6936. t.classList.add("btn-deep-link"),
  6937. t.innerText = se.MENU_COPY,
  6938. e.nextSibling.appendChild(t);
  6939. var n = function() {
  6940. alert(se.LINK_ALERT_COPY),
  6941. t.hide()
  6942. };
  6943. t.addEventListener("click", function(e) {
  6944. try {
  6945. var t = e.target.parentNode.childNodes[0];
  6946. t.select();
  6947. var i = document.execCommand("copy");
  6948. t.blur(),
  6949. i || n()
  6950. } catch (e) {
  6951. n()
  6952. }
  6953. })
  6954. }
  6955. }),
  6956. $(r.__closeButton).hide(),
  6957. r
  6958. }(ve.model, ve.player)),
  6959. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6960. }(!ve.visible);
  6961. break;
  6962. case te.X:
  6963. M.debug && s.toggleExplode();
  6964. break;
  6965. case te.PLUSEQUALS:
  6966. l.player.activatePersistentZooming(!0),
  6967. O.hideUi();
  6968. break;
  6969. case te.DASHUNDERSCORE:
  6970. l.player.activatePersistentZooming(!1),
  6971. O.hideUi();
  6972. break;
  6973. case te.SEVEN:
  6974. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6975. break;
  6976. case te.EIGHT:
  6977. l.player.decreaseZoomSpeed();
  6978. break;
  6979. case te.NINE:
  6980. l.player.increaseZoomSpeed()
  6981. }
  6982. return c && c.reticule.hide(),
  6983. !0
  6984. }
  6985. .bind(this)),
  6986. document.addEventListener("keyup", function(e) {
  6987. switch (e.which) {
  6988. case te.PLUSEQUALS:
  6989. l.player.deactivatePersistentZooming();
  6990. break;
  6991. case te.DASHUNDERSCORE:
  6992. l.player.deactivatePersistentZooming()
  6993. }
  6994. }
  6995. .bind(this)),
  6996. function(e) {
  6997. me = {
  6998. gui: null,
  6999. visible: !1,
  7000. model: e
  7001. }
  7002. }(s),
  7003. function(e, t) {
  7004. ve = {
  7005. gui: null,
  7006. visible: !1,
  7007. model: e,
  7008. player: t
  7009. }
  7010. }(s, l.player),
  7011. function(e) {
  7012. function t(e, i) {
  7013. $(e).find("a").each(function(e, t) {
  7014. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7015. t.style.pointerEvents = i ? "auto" : "none"
  7016. })
  7017. }
  7018. e.on(de.ZoomMax, function() {
  7019. t("#gui-zoomin", !1),
  7020. t("#gui-zoomout", !0)
  7021. }),
  7022. e.on(de.ZoomMin, function() {
  7023. t("#gui-zoomin", !0),
  7024. t("#gui-zoomout", !1)
  7025. }),
  7026. e.on(de.ZoomIn, function() {
  7027. t("#gui-zoomout", !0)
  7028. }),
  7029. e.on(de.ZoomOut, function() {
  7030. t("#gui-zoomin", !0)
  7031. }),
  7032. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7033. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7034. }(c),
  7035. P.setAutoPlay(s.heroCount()),
  7036. U.init(c, i.mode),
  7037. U.on(H.OPENED, _e.bind(this, "help")),
  7038. W.init(),
  7039. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7040. function() {
  7041. _e("terms"),
  7042. V.open(o)
  7043. }
  7044. )),
  7045. W.on(j.CLOSED, V.reset),
  7046. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7047. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7048. M.profiling.enabled && B.show(),
  7049. q.init(l)
  7050. }
  7051. ,
  7052. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7053. function a() {
  7054. o.setLoadingStartTime(),
  7055. function() {
  7056. function e(e) {
  7057. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7058. }
  7059. $("body").css("touch-action", "none"),
  7060. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7061. var t = document.getElementById("terms-text")
  7062. , i = document.getElementById("more-help-wrapper")
  7063. , n = (document.getElementById("navigation-help-wrapper"),
  7064. document.getElementById("help-dialog"),
  7065. document.getElementById("tag-billboards"));
  7066. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7067. passive: !1
  7068. }),
  7069. document.body.addEventListener("DOMMouseScroll", e)),
  7070. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7071. e.stopPropagation()
  7072. })
  7073. }(),
  7074. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7075. l()) : function(e) {
  7076. L.show(e),
  7077. c()
  7078. }(l)
  7079. }
  7080. var s = $.Deferred()
  7081. , l = s.resolve.bind(s);
  7082. ye = !0,
  7083. _(e);
  7084. e.data.player_options && function(e) {
  7085. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7086. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7087. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7088. }(e.data.player_options),
  7089. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7090. se.localizeGUI();
  7091. !function(i) {
  7092. function e(e, t) {
  7093. return !!i.player_options[e] && i[t || e]
  7094. }
  7095. $(".model-title").text(i.name);
  7096. var t = M.pageTitle;
  7097. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7098. document.title = t,
  7099. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7100. delay: {
  7101. show: 50,
  7102. hide: 0
  7103. },
  7104. trigger: "hover",
  7105. html: !1,
  7106. viewport: {
  7107. selector: "body",
  7108. padding: 10
  7109. }
  7110. }),
  7111. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7112. z.populate({
  7113. name: e("model_name", "name"),
  7114. coBrand: e("presented_by"),
  7115. description: e("model_summary", "summary") || "暂无内容",
  7116. contactName: e("contact_name"),
  7117. address: e("address"),
  7118. phone: e("contact_phone"),
  7119. formattedPhone: i.formatted_contact_phone,
  7120. email: e("contact_email"),
  7121. url: e("external_url"),
  7122. socialSharing: i.enable_social_sharing && i.is_public
  7123. })
  7124. }(e.data);
  7125. r || $(".quick").addClass("hidden");
  7126. n ? (R.impression(),
  7127. a()) : (o.setWaitingStartTime(),
  7128. N.show(r, a))
  7129. return s
  7130. }
  7131. ,
  7132. Le.exports.endLoading = function(e, t, i) {
  7133. var n = t.player;
  7134. function r() {
  7135. i.dismissExaminedTag(),
  7136. i.disableHovering()
  7137. }
  7138. $("#gui-thumb").fadeOut(2500),
  7139. L.hide(function() {
  7140. ye = !1
  7141. }),
  7142. Y.init(e, i),
  7143. z.finishSetup(Object.keys(e.tags).length),
  7144. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7145. X.on(Z.OPENED, r),
  7146. K.on(ae.OPENED, r),
  7147. U.on(H.OPENED, r),
  7148. W.on(j.OPENED, r);
  7149. var o = i.enableHovering.bind(i);
  7150. if (X.on(Z.CLOSED, o),
  7151. K.on(ae.CLOSED, o),
  7152. U.on(H.CLOSED, o),
  7153. W.on(j.CLOSED, o),
  7154. M.labels.enabled && Object.keys(e.labels).length,
  7155. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7156. I(e.currentFloor, n.mode)),
  7157. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7158. h(e, t)),
  7159. c(),
  7160. v(t, t.player),
  7161. $("#gui").fadeIn(1500),
  7162. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7163. l(),
  7164. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7165. }, 2e3),
  7166. !S.isMobile())
  7167. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7168. $(a[s]).addClass("hasHover");
  7169. _(e),
  7170. z.setupToggling(),
  7171. window.editHotPanel && editHotPanel(),
  7172. function() {
  7173. var i = $("#pullTab")
  7174. , e = {
  7175. bottom: {
  7176. "border-bottom-left-radius": "10px",
  7177. "border-bottom-right-radius": "10px"
  7178. },
  7179. top: {
  7180. "border-top-left-radius": "10px",
  7181. "border-top-right-radius": "10px"
  7182. }
  7183. }
  7184. , t = {
  7185. bottom: {
  7186. "border-top-right-radius": "10px",
  7187. "border-bottom-right-radius": "10px"
  7188. },
  7189. top: {
  7190. "border-bottom-left-radius": "10px",
  7191. "border-top-left-radius": "10px"
  7192. }
  7193. };
  7194. function n(e, t) {
  7195. $("#gui-modes-map > div:visible:last").css(e),
  7196. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7197. }
  7198. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7199. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7200. }()
  7201. $(".toolRight a").removeClass('hasHover')
  7202. }
  7203. ,
  7204. Le.exports.onProgress = function(e) {
  7205. L.progress(e)
  7206. }
  7207. }
  7208. ).call(this, "/js/gui/gui.js")
  7209. }
  7210. , {
  7211. "../analytics": 4,
  7212. "../controls/serializer": 14,
  7213. "../enum/AlignmentType": 17,
  7214. "../enum/BlackoutStyle": 18,
  7215. "../enum/ControlEvents": 21,
  7216. "../enum/DirectorEvents": 23,
  7217. "../enum/Keys": 30,
  7218. "../enum/PathDiscardMode": 38,
  7219. "../enum/PathDisplayMode": 39,
  7220. "../enum/PlayerEvents": 40,
  7221. "../enum/VROption": 47,
  7222. "../enum/Vectors": 50,
  7223. "../enum/Viewmode": 51,
  7224. "../enum/WarpStyle": 52,
  7225. "../enum/ZoomEvents": 53,
  7226. "../lib/dat.gui": 93,
  7227. "../localization/localize": 108,
  7228. "../tag/Media/MediaEvent": 131,
  7229. "../objects/Snapshot": 153,
  7230. "../settings": 166,
  7231. "../util/ajax": 181,
  7232. "../util/browser": 182,
  7233. "../util/camera": 183,
  7234. "../util/logger": 189,
  7235. "../util/showcase": 193,
  7236. "../util/transitions": 195,
  7237. "./closer/ModalCloserEvent": 61,
  7238. "./closer/modalCloser": 62,
  7239. "./help/HelpEvent": 66,
  7240. "./help/help": 67,
  7241. "./helpManager": 68,
  7242. "./immersiveMode": 69,
  7243. "./konami": 70,
  7244. "./landingScreen": 71,
  7245. "./loadingScreen": 72,
  7246. "./memoryUsage": 73,
  7247. "./playButton": 74,
  7248. "./populateModal": 75,
  7249. "./sharing/ShareEvents": 76,
  7250. "./sharing/modal": 77,
  7251. "./terms/TermsEvent": 78,
  7252. "./terms/terms": 79,
  7253. "./title/TitleEvents": 80,
  7254. "./title/tagToggle": 81,
  7255. "./title/titleBar": 82,
  7256. "./tourInteraction": 84,
  7257. "./vr/vrEvent": 85,
  7258. "./vr/vrModal": 87,
  7259. "./webvr/WebVrEvent": 88,
  7260. "./webvr/webVRgui": 89,
  7261. three: 217
  7262. }],
  7263. 66: [function(e, t, i) {
  7264. "use strict";
  7265. t.exports = Object.freeze({
  7266. OPENED: "help.opened",
  7267. CLOSED: "help.closed"
  7268. })
  7269. }
  7270. , {}],
  7271. 67: [function(e, t, i) {
  7272. "use strict";
  7273. function n() {
  7274. p.on("click", function(e) {
  7275. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7276. setTimeout(function() {
  7277. x = !1
  7278. }, h.help.modalStayDuration),
  7279. S.emit(l.OPENED),
  7280. f.addClass("open " + T),
  7281. p.addClass("open"),
  7282. o(),
  7283. r(),
  7284. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7285. v.classList.add("fadeIn")))
  7286. }),
  7287. E.on("click", function(e) {
  7288. S.close()
  7289. }),
  7290. C.on("click", function(e) {
  7291. T && T !== a.TRANSITIONING && (o(),
  7292. r())
  7293. }),
  7294. I.on("click", function(e) {
  7295. o(),
  7296. I.addClass("underline-tab"),
  7297. c.fill(b, s.MORE_HELP),
  7298. f.addClass("more-help")
  7299. })
  7300. }
  7301. function r() {
  7302. C.addClass("underline-tab"),
  7303. c.fill(_, s.NAVIGATION, T),
  7304. f.addClass(T)
  7305. }
  7306. function o() {
  7307. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7308. A.forEach(function(e) {
  7309. e.classList.remove("underline-tab")
  7310. })
  7311. }
  7312. var a = e("../../enum/Viewmode")
  7313. , s = e("../../enum/HelpModalType")
  7314. , l = e("./HelpEvent")
  7315. , c = (e("../helpManager"),
  7316. e("./../populateModal"))
  7317. , h = e("../../settings")
  7318. , u = e("../../util/common")
  7319. , d = e("events").EventEmitter
  7320. , p = $(".footer-help").eq(0)
  7321. , f = $("#help-dialog").eq(0)
  7322. , g = document.querySelector("#quick-logo")
  7323. , m = document.querySelector("#loaderCoBrand")
  7324. , v = document.querySelector("#help-dialog")
  7325. , y = document.querySelector(".footer")
  7326. , A = $(".help-tabs").children().toArray()
  7327. , C = $(".navigation-tab").eq(0)
  7328. , I = $(".more-help-tab").eq(0)
  7329. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7330. f.find(".close").eq(0))
  7331. , _ = f.find(".interactions").toArray()
  7332. , b = f.find(".ui-instructions").toArray()
  7333. , w = a.PANORAMA
  7334. , T = a.PANORAMA
  7335. , x = !1
  7336. , S = {
  7337. init: function(e, t) {
  7338. w = T = t,
  7339. [v, m, g, y].forEach(function(e) {
  7340. e.classList.add(c.deviceType)
  7341. }),
  7342. n()
  7343. },
  7344. close: function() {
  7345. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7346. p.removeClass("open"),
  7347. f.removeClass("open"),
  7348. v.classList.contains("fadeIn"))) {
  7349. v.classList.remove("fadeIn");
  7350. var e = T === a.TRANSITIONING ? w : T;
  7351. c.clear(_, s.NAVIGATION, e)
  7352. }
  7353. },
  7354. updateMode: function(e) {
  7355. w = T,
  7356. T = e
  7357. }
  7358. };
  7359. u.extendObject(S, d.prototype),
  7360. t.exports = S
  7361. }
  7362. , {
  7363. "../../enum/HelpModalType": 28,
  7364. "../../enum/Viewmode": 51,
  7365. "../../settings": 166,
  7366. "../../util/common": 185,
  7367. "../helpManager": 68,
  7368. "./../populateModal": 75,
  7369. "./HelpEvent": 66,
  7370. events: 202
  7371. }],
  7372. 68: [function(s, l, e) {
  7373. (function(e) {
  7374. "use strict";
  7375. var t = s("../util/browser")
  7376. , i = s("./../util/logger")
  7377. , n = s("./../settings")
  7378. , r = new i(e)
  7379. , o = function() {
  7380. var t;
  7381. try {
  7382. return t = window.localStorage.getItem("visitCount") || "0",
  7383. t = (parseFloat(t) + 1).toString(),
  7384. window.localStorage.setItem("visitCount", t),
  7385. r.debug("visitCount = " + t),
  7386. t
  7387. } catch (e) {
  7388. t = "1",
  7389. r.debug("couldn't set local storage")
  7390. }
  7391. }()
  7392. , a = !1;
  7393. l.exports = {
  7394. isHelpDisabled: function() {
  7395. return "0" === t.valueFromHash("help", null) || a
  7396. },
  7397. isLargeHelpEnabled: function() {
  7398. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7399. },
  7400. isSmallHelpEnabled: function() {
  7401. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7402. },
  7403. isHelpEnabled: function() {
  7404. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7405. },
  7406. setAutoPlay: function(e) {
  7407. a = 0 <= n.warp.auto && 1 < e
  7408. }
  7409. }
  7410. }
  7411. ).call(this, "/js/gui/helpManager.js")
  7412. }
  7413. , {
  7414. "../util/browser": 182,
  7415. "./../settings": 166,
  7416. "./../util/logger": 189
  7417. }],
  7418. 69: [function(e, t, i) {
  7419. "use strict";
  7420. function r(e) {
  7421. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7422. T = !0,
  7423. h.close(),
  7424. function(e) {
  7425. !n(e) && S ? v.forEach(function(e) {
  7426. e.classList.remove("drawerOpen"),
  7427. e.classList.add("duringTour")
  7428. }) : C.hasClass("open") ? v.forEach(function(e) {
  7429. e.classList.remove("duringTour"),
  7430. e.classList.add("drawerOpen")
  7431. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7432. e.classList.add("fadeOut")
  7433. })
  7434. }(e),
  7435. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7436. C.hasClass("playing") || (y.forEach(function(e) {
  7437. e.classList.add("detectHover")
  7438. }),
  7439. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7440. }
  7441. function o() {
  7442. C.hasClass("playing") || (clearTimeout(x),
  7443. x = setTimeout(a, c.immersive.timeToShowAgain))
  7444. }
  7445. function a() {
  7446. clearTimeout(x),
  7447. T = !1,
  7448. m.forEach(function(e) {
  7449. e.classList.remove("drawerOpen")
  7450. }),
  7451. S || v.forEach(function(e) {
  7452. e.classList.remove("duringTour")
  7453. }),
  7454. y.forEach(function(e) {
  7455. e.classList.remove("detectHover")
  7456. })
  7457. }
  7458. function s() {
  7459. T ? a() : r(),
  7460. M = !0,
  7461. setTimeout(function() {
  7462. M = !1
  7463. }, c.immersive.uiStayDuration)
  7464. }
  7465. function n(e) {
  7466. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7467. }
  7468. var l = e("../util/browser")
  7469. , c = e("../settings")
  7470. , h = e("./help/help")
  7471. , u = e("../enum/tagEvents")
  7472. , d = e("../enum/ControlEvents")
  7473. , p = e("../enum/PlayerEvents")
  7474. , f = e("../enum/DirectorEvents")
  7475. , g = (p = e("../enum/PlayerEvents"),
  7476. e("../enum/Viewmode"))
  7477. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7478. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7479. , y = $("#hover-bottom, #hover-top").toArray()
  7480. , A = ($("#pullTab").eq(0),
  7481. $("#playHead").eq(0),
  7482. $(".pinBottom-container").eq(0))
  7483. , C = $("#drawer").eq(0)
  7484. , I = $("#drawer-container").eq(0)
  7485. , E = $("#meta-info").eq(0)
  7486. , _ = $(".pinTop.left").eq(0)
  7487. , b = $("#player").eq(0)
  7488. , w = document.getElementById("pullTab")
  7489. , T = !1
  7490. , x = null
  7491. , S = !1
  7492. , M = !1
  7493. , R = null
  7494. , P = !1;
  7495. t.exports.init = function(e, t, i, n) {
  7496. (function(t, i, e, n) {
  7497. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7498. t.controls[e].on(d.Move, r),
  7499. t.controls[e].on(d.LongTap, s)
  7500. }),
  7501. b.on("mousewheel DOMMouseScroll", r),
  7502. e.on(u.TagActivated, r),
  7503. e.on(u.TagNavigation, r),
  7504. i.on(p.FlyingEnded, o),
  7505. i.on(p.ModeChanging, function(e, t) {
  7506. P = t !== g.PANORAMA && e !== g.PANORAMA
  7507. }),
  7508. i.on(p.ModeChanged, function(e, t) {
  7509. R = i.mode,
  7510. t !== g.TRANSITIONING ? a() : r("modeChange")
  7511. }),
  7512. n.on(f.TourStart, function() {
  7513. S = !0,
  7514. r()
  7515. }),
  7516. n.on(f.TourEnd, function() {
  7517. S = !1,
  7518. a()
  7519. }),
  7520. n.on(f.ActionInterrupted, function() {
  7521. S = !1
  7522. }),
  7523. w.addEventListener("touchend", function() {
  7524. $("#pullTab").hasClass("opened") && !S && a()
  7525. }, !0)
  7526. }
  7527. )(e, t, i, n),
  7528. l.isMobile() ? (y.forEach(function(e) {
  7529. e.classList.add("mobile")
  7530. }),
  7531. A.click(a)) : (y.forEach(function(e) {
  7532. e.addEventListener("mouseleave", function() {
  7533. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7534. }, !0)
  7535. }),
  7536. b.mouseleave(function() {
  7537. y[0].classList.contains("detectHover") && a()
  7538. })),
  7539. R = t.mode
  7540. }
  7541. ,
  7542. t.exports.hideUi = r,
  7543. t.exports.resetDrawer = function() {
  7544. I.hasClass("duringTour") || (S = !1,
  7545. r("gui"),
  7546. a())
  7547. }
  7548. }
  7549. , {
  7550. "../enum/ControlEvents": 21,
  7551. "../enum/DirectorEvents": 23,
  7552. "../enum/tagEvents": 32,
  7553. "../enum/PlayerEvents": 40,
  7554. "../enum/Viewmode": 51,
  7555. "../settings": 166,
  7556. "../util/browser": 182,
  7557. "./help/help": 67
  7558. }],
  7559. 70: [function(i, n, e) {
  7560. (function(e) {
  7561. "use strict";
  7562. var t = i("./../util/logger")
  7563. , o = i("./../settings")
  7564. , a = i("./debug")
  7565. , s = i("./../util/common")
  7566. , l = (i("./gui"),
  7567. new t(e));
  7568. o.console && $("body").append('<div id="debug-console"></div>'),
  7569. n.exports.init = function(i, n, r) {
  7570. l.debug("konami has the modelInstance");
  7571. var t = [];
  7572. $(window).on("keydown", function(e) {
  7573. t.push(e.which),
  7574. t.length > o.secretPanelWord.length && t.shift(),
  7575. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7576. o.debug = !0)
  7577. }),
  7578. $(window).on("keydown", function e(t) {
  7579. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7580. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7581. })
  7582. }
  7583. }
  7584. ).call(this, "/js/gui/konami.js")
  7585. }
  7586. , {
  7587. "./../settings": 166,
  7588. "./../util/common": 185,
  7589. "./../util/logger": 189,
  7590. "./debug": 63,
  7591. "./gui": 65
  7592. }],
  7593. 71: [function(e, t, i) {
  7594. "use strict";
  7595. function r() {
  7596. s.clear(m, l.LANDING[v]),
  7597. g.removeClass("fadeIn")
  7598. }
  7599. var o = e("../settings")
  7600. , a = (e("./help/help"),
  7601. e("./helpManager"))
  7602. , s = e("./populateModal")
  7603. , l = e("../enum/HelpModalType")
  7604. , n = e("../enum/Viewmode")
  7605. , c = e("../enum/DirectorEvents")
  7606. , h = e("../enum/PlayerEvents")
  7607. , u = $("#quick-blackout").eq(0)
  7608. , d = $("#quick-logo").eq(0)
  7609. , p = $(".quick-brand").toArray()
  7610. , f = $("#loaderCoBrand").eq(0)
  7611. , g = $("#interaction-modal").eq(0)
  7612. , m = g.find(".interaction").toArray()
  7613. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7614. "");
  7615. t.exports.delayLanding = function(e) {
  7616. var t = $.Deferred();
  7617. e || t.resolve();
  7618. var i = o.startupFlyinDelay;
  7619. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7620. setTimeout(t.resolve.bind(t), i),
  7621. t
  7622. }
  7623. ,
  7624. t.exports.showMessage = function(e, t, i) {
  7625. var n = 0;
  7626. o.quickstart.enabled && (function(e) {
  7627. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7628. d.before(f),
  7629. p = $(".quick-brand").toArray()), */
  7630. u.addClass("fadeOut")
  7631. /* setTimeout(function() {
  7632. p.forEach(function(e) {
  7633. e.classList.add("fadeIn")
  7634. })
  7635. }, o.quickstart.showTextDelay),
  7636. setTimeout(function() {
  7637. p.forEach(function(e) {
  7638. e.classList.add("fadeOut")
  7639. })
  7640. }, o.quickstart.fadeOutDelay) */
  7641. }(i),
  7642. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7643. function(e, t) {
  7644. setTimeout(function() {
  7645. if (a.isHelpEnabled()) {
  7646. if (t(),
  7647. s.init(),
  7648. g.addClass("fadeIn landing " + s.deviceType),
  7649. a.isSmallHelpEnabled())
  7650. return void g.addClass("small");
  7651. s.fill(m, l.LANDING[v]),
  7652. g.addClass(v)
  7653. }
  7654. }, e);
  7655. var i = {
  7656. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7657. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7658. }
  7659. , n = $(".nav-icon .icon");
  7660. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7661. function r(e) {
  7662. e.on("click", function() {
  7663. var e = null;
  7664. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7665. i.length < e || e < 1)
  7666. return !1;
  7667. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7668. "data-page": e,
  7669. src: i.mobile[e - 1]
  7670. }) : n.attr({
  7671. "data-page": e,
  7672. src: i.pc[e - 1]
  7673. })
  7674. })
  7675. }
  7676. r($(".next-button")),
  7677. r($(".prev-button"))
  7678. }(n, function() {
  7679. e.once(h.Move, r),
  7680. t.once(c.TourStart, r)
  7681. })
  7682. }
  7683. ,
  7684. t.exports.init = function(e, t) {
  7685. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7686. }
  7687. ,
  7688. t.exports.dismissModal = r
  7689. }
  7690. , {
  7691. "../enum/DirectorEvents": 23,
  7692. "../enum/HelpModalType": 28,
  7693. "../enum/PlayerEvents": 40,
  7694. "../enum/Viewmode": 51,
  7695. "../settings": 166,
  7696. "./help/help": 67,
  7697. "./helpManager": 68,
  7698. "./populateModal": 75
  7699. }],
  7700. 72: [function(e, t, i) {
  7701. "use strict";
  7702. var n = e("./circleLoader").circleLoader;
  7703. t.exports = {
  7704. element: $("#gui-loading"),
  7705. hide: function(e) {
  7706. n.done(),
  7707. this.element.fadeOut(1500, e)
  7708. },
  7709. show: function(e) {
  7710. this.element.fadeIn(500, function() {
  7711. this.element.css("display", "table"),
  7712. e && e()
  7713. }
  7714. .bind(this))
  7715. },
  7716. progress: function(e) {
  7717. n.set(e)
  7718. }
  7719. }
  7720. }
  7721. , {
  7722. "./circleLoader": 60
  7723. }],
  7724. 73: [function(e, t, i) {
  7725. "use strict";
  7726. var n = e("../settings")
  7727. , r = $("#memory-info")
  7728. , o = r.find("#memory-gpu")
  7729. , a = !1;
  7730. t.exports = {
  7731. show: function() {
  7732. n.profiling.enabled && (r.show(),
  7733. a = !0)
  7734. },
  7735. hide: function() {
  7736. r.hide(),
  7737. a = !1
  7738. },
  7739. toggle: function() {
  7740. a ? this.hide() : this.show()
  7741. },
  7742. update: function(e) {
  7743. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7744. }
  7745. }
  7746. }
  7747. , {
  7748. "../settings": 166
  7749. }],
  7750. 74: [function(e, t, i) {
  7751. "use strict";
  7752. e("../util/browser"),
  7753. e("../analytics");
  7754. e("../settings"),
  7755. t.exports = {
  7756. show: function(e, t) {
  7757. $("#gui-message").fadeOut(500, function() {
  7758. t()
  7759. })
  7760. }
  7761. }
  7762. }
  7763. , {
  7764. "../analytics": 4,
  7765. "../settings": 166,
  7766. "../util/browser": 182
  7767. }],
  7768. 75: [function(e, t, i) {
  7769. "use strict";
  7770. function n(e, t, i, n) {
  7771. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7772. }
  7773. var r = e("../util/browser")
  7774. , o = e("../localization/localize")
  7775. , a = e("../enum/HelpModalType")
  7776. , s = (e("../enum/HelpModalSize"),
  7777. e("../enum/Viewmode"));
  7778. t.exports = {
  7779. init: function() {
  7780. if (!this.hasInitialized) {
  7781. this.hasInitialized = !0,
  7782. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7783. this.assets = {},
  7784. this.assets[a.LANDING[s.PANORAMA]] = {
  7785. desktop: {
  7786. left: {
  7787. "top-info": o.ROTATE,
  7788. "big-image": "images/nav_help_mouse_drag_left.png",
  7789. keyboard: "images/nav_help_keyboard_left_right.png"
  7790. },
  7791. middle: {
  7792. "top-info": o.MOVE,
  7793. "big-image": "images/nav_help_mouse_click.png",
  7794. keyboard: "images/nav_help_keyboard_up_down.png"
  7795. },
  7796. right: {
  7797. "top-info": o.ZOOM,
  7798. "big-image": "images/nav_help_mouse_zoom.png",
  7799. keyboard: "images/nav_help_zoom_keys.png"
  7800. }
  7801. },
  7802. mobile: {
  7803. left: {
  7804. "top-info": o.ROTATE,
  7805. "big-image": "images/nav_help_gesture_drag.png"
  7806. },
  7807. middle: {
  7808. "top-info": o.MOVE,
  7809. "big-image": "images/nav_help_gesture_tap.png"
  7810. },
  7811. right: {
  7812. "top-info": o.ZOOM,
  7813. "big-image": "images/nav_help_gesture_pinch.png"
  7814. }
  7815. }
  7816. },
  7817. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7818. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7819. desktop: {
  7820. left: {
  7821. "top-info": o.ROTATE,
  7822. "big-image": "images/nav_help_mouse_drag_left.png",
  7823. keyboard: "images/nav_help_keyboard_left_right.png"
  7824. },
  7825. middle: {
  7826. "top-info": o.MOVE,
  7827. "big-image": "images/nav_help_mouse_position_right.png"
  7828. }
  7829. },
  7830. mobile: {
  7831. left: {
  7832. "top-info": o.ROTATE,
  7833. "big-image": "images/nav_help_gesture_drag.png"
  7834. },
  7835. middle: {
  7836. "top-info": o.MOVE,
  7837. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7838. }
  7839. }
  7840. },
  7841. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7842. desktop: {
  7843. left: {
  7844. "top-info": o.MOVE,
  7845. "big-image": "images/nav_help_mouse_position_left.png"
  7846. },
  7847. middle: {
  7848. "top-info": o.ROTATE,
  7849. "big-image": "images/nav_help_mouse_drag_right.png",
  7850. keyboard: "images/nav_help_keyboard_left_right.png"
  7851. }
  7852. },
  7853. mobile: {
  7854. left: {
  7855. "top-info": o.MOVE,
  7856. "big-image": "images/nav_help_gesture_position.png"
  7857. },
  7858. middle: {
  7859. "top-info": o.ROTATE,
  7860. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7861. }
  7862. }
  7863. };
  7864. var e = {
  7865. "top-info": o.INSIDE,
  7866. "big-image": "images/nav_help_click_inside.png",
  7867. keyboard: "images/nav_help_inside_key.png"
  7868. };
  7869. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7870. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7871. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7872. var t = {
  7873. "top-info": o.INSIDE,
  7874. "big-image": "images/nav_help_tap_inside.png"
  7875. };
  7876. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7877. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7878. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7879. this.assets[a.NAVIGATION] = {},
  7880. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7881. desktop: {
  7882. left: {
  7883. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7884. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7885. "big-image": "images/nav_help_mouse_drag_left.png",
  7886. keyboard: "images/nav_help_keyboard_left_right.png"
  7887. },
  7888. middle: {
  7889. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7890. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7891. "big-image": "images/nav_help_mouse_click.png",
  7892. keyboard: "images/nav_help_keyboard_up_down.png"
  7893. },
  7894. right: {
  7895. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7896. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7897. "big-image": "images/nav_help_mouse_zoom.png",
  7898. keyboard: "images/nav_help_zoom_keys.png"
  7899. }
  7900. },
  7901. mobile: {
  7902. left: {
  7903. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7904. "big-image": "images/nav_help_gesture_drag.png"
  7905. },
  7906. middle: {
  7907. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7908. "big-image": "images/nav_help_gesture_tap.png"
  7909. },
  7910. right: {
  7911. "top-info": o.HELP_MOBILE_3,
  7912. "big-image": "images/nav_help_gesture_pinch.png"
  7913. }
  7914. }
  7915. },
  7916. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7917. desktop: {
  7918. left: {
  7919. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7920. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7921. "big-image": "images/nav_help_mouse_drag_left.png",
  7922. keyboard: "images/nav_help_keyboard_all.png"
  7923. },
  7924. middle: {
  7925. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7926. "big-image": "images/nav_help_mouse_position_right.png"
  7927. },
  7928. right: {
  7929. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7930. "big-image": "images/nav_help_mouse_zoom.png"
  7931. }
  7932. },
  7933. mobile: {
  7934. left: {
  7935. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7936. "big-image": "images/nav_help_gesture_drag.png"
  7937. },
  7938. middle: {
  7939. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7940. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7941. },
  7942. right: {
  7943. "top-info": o.HELP_MOBILE_3,
  7944. "big-image": "images/nav_help_gesture_pinch.png"
  7945. }
  7946. }
  7947. },
  7948. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7949. desktop: {
  7950. left: {
  7951. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7952. "big-image": "images/nav_help_mouse_position_left.png"
  7953. },
  7954. middle: {
  7955. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7956. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7957. "big-image": "images/nav_help_mouse_drag_right.png",
  7958. keyboard: "images/nav_help_keyboard_left_right.png"
  7959. },
  7960. right: {
  7961. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7962. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7963. "big-image": "images/nav_help_mouse_zoom.png",
  7964. keyboard: "images/nav_help_keyboard_up_down.png"
  7965. }
  7966. },
  7967. mobile: {
  7968. left: {
  7969. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7970. "big-image": "images/nav_help_gesture_position.png"
  7971. },
  7972. middle: {
  7973. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7974. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7975. },
  7976. right: {
  7977. "top-info": o.HELP_MOBILE_3,
  7978. "big-image": "images/nav_help_gesture_pinch.png"
  7979. }
  7980. }
  7981. },
  7982. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7983. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7984. "top-info": o.HELP_DESKTOP_360_2A,
  7985. "bottom-info": o.HELP_DESKTOP_360_2B,
  7986. "big-image": "images/nav_help_click_inside.png",
  7987. keyboard: "images/nav_help_inside_key.png"
  7988. },
  7989. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7990. "top-info": o.HELP_MOBILE_360_2,
  7991. "big-image": "images/nav_help_tap_inside.png"
  7992. },
  7993. this.assets[a.MORE_HELP] = {
  7994. desktop: {
  7995. "more-help-hlr": {
  7996. "top-info": o.HELP_MORE_HLR_A,
  7997. "big-image": "images/nav_help_expand.svg",
  7998. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7999. },
  8000. "more-help-dollhouse": {
  8001. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8002. "big-image": "images/nav_help_dollhouse.svg",
  8003. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8004. },
  8005. "more-help-floors": {
  8006. "top-info": o.HELP_MORE_FLOORS_A,
  8007. "big-image": "images/nav_help_floor picker.svg",
  8008. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8009. },
  8010. "more-help-tag": {
  8011. "top-info": o.HELP_MORE_TAG_A,
  8012. "big-image": "images/nav_help_tag.svg",
  8013. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8014. },
  8015. "more-help-zoom": {
  8016. "top-info": o.HELP_MORE_ZOOM_A,
  8017. "big-image": "images/nav_help_zoom.svg",
  8018. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8019. },
  8020. "more-help-tour": {
  8021. "top-info": o.HELP_MORE_TOUR_A,
  8022. "big-image": "images/nav_help_play.png",
  8023. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8024. },
  8025. "more-help-inside": {
  8026. "top-info": o.HELP_MORE_INSIDE_A,
  8027. "big-image": "images/nav_help_inside.svg",
  8028. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8029. },
  8030. "more-help-vr": {
  8031. "top-info": o.HELP_MORE_VR_A,
  8032. "big-image": "images/nav_help_vr.svg",
  8033. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8034. },
  8035. "more-help-360": {
  8036. "top-info": o.HELP_MORE_360_A,
  8037. "big-image": "images/nav_help_360.svg",
  8038. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8039. },
  8040. "more-help-fullscreen": {
  8041. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8042. "big-image": "images/nav_help_fullscreen.svg",
  8043. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8044. }
  8045. },
  8046. mobile: {
  8047. "more-help-hlr": {
  8048. "top-info": o.HELP_MORE_HLR_A,
  8049. "big-image": "images/nav_help_expand.svg",
  8050. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8051. },
  8052. "more-help-dollhouse": {
  8053. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8054. "big-image": "images/nav_help_dollhouse.svg",
  8055. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8056. },
  8057. "more-help-floors": {
  8058. "top-info": o.HELP_MORE_FLOORS_A,
  8059. "big-image": "images/nav_help_floor picker.svg",
  8060. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8061. },
  8062. "more-help-tag": {
  8063. "top-info": o.HELP_MORE_TAG_A,
  8064. "big-image": "images/nav_help_tag.svg",
  8065. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8066. },
  8067. "more-help-tour": {
  8068. "top-info": o.HELP_MORE_TOUR_A,
  8069. "big-image": "images/nav_help_play.png",
  8070. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8071. },
  8072. "more-help-inside": {
  8073. "top-info": o.HELP_MORE_INSIDE_A,
  8074. "big-image": "images/nav_help_inside.svg",
  8075. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8076. },
  8077. "more-help-vr": {
  8078. "top-info": o.HELP_MORE_VR_A,
  8079. "big-image": "images/webvr.svg",
  8080. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8081. },
  8082. "more-help-360": {
  8083. "top-info": o.HELP_MORE_360_A,
  8084. "big-image": "images/nav_help_360.svg",
  8085. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8086. }
  8087. }
  8088. },
  8089. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8090. desktop: {
  8091. left: {
  8092. "top-info": o.ROTATE,
  8093. "big-image": "images/nav_help_mouse_drag_left.png",
  8094. keyboard: "images/nav_help_keyboard_left_right.png"
  8095. },
  8096. middle: {
  8097. "top-info": o.MOVE,
  8098. "big-image": "images/nav_help_mouse_click.png",
  8099. keyboard: "images/nav_help_keyboard_up_down.png"
  8100. },
  8101. right: {
  8102. "top-info": o.PLAY,
  8103. "big-image": "images/Desktop-help-play-button.svg",
  8104. keyboard: "images/Desktop-help-spacebar-2.svg"
  8105. }
  8106. },
  8107. mobile: {
  8108. left: {
  8109. "top-info": o.ROTATE,
  8110. "big-image": "images/nav_help_gesture_drag.png"
  8111. },
  8112. middle: {
  8113. "top-info": o.MOVE,
  8114. "big-image": "images/nav_help_gesture_tap.png"
  8115. },
  8116. right: {
  8117. "top-info": o.PLAY,
  8118. "big-image": "images/mobile-help-play-button.svg"
  8119. }
  8120. }
  8121. },
  8122. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8123. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8124. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8125. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8126. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8127. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8128. }
  8129. },
  8130. fill: function(e, t, i) {
  8131. n.call(this, e, t, i, !0)
  8132. },
  8133. clear: function(e, t, i) {
  8134. n.call(this, e, t, i, !1)
  8135. }
  8136. }
  8137. }
  8138. , {
  8139. "../enum/HelpModalSize": 27,
  8140. "../enum/HelpModalType": 28,
  8141. "../enum/Viewmode": 51,
  8142. "../localization/localize": 108,
  8143. "../util/browser": 182
  8144. }],
  8145. 76: [function(e, t, i) {
  8146. "use strict";
  8147. t.exports = Object.freeze({
  8148. OPENED: "share.open",
  8149. CLOSED: "share.closed",
  8150. LINK_CLICKED: "share.linked"
  8151. })
  8152. }
  8153. , {}],
  8154. 77: [function(e, t, i) {
  8155. "use strict";
  8156. function n(n) {
  8157. function e(e, t) {
  8158. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8159. I.emit(l.LINK_CLICKED, {
  8160. channel: n
  8161. }),
  8162. window.open(C[n], "shareWindow", i)
  8163. }
  8164. switch (n) {
  8165. case A.FACEBOOK:
  8166. e(580, 420);
  8167. break;
  8168. case A.TWITTER:
  8169. e(550, 440);
  8170. break;
  8171. case A.MAIL:
  8172. I.emit(l.LINK_CLICKED, {
  8173. channel: "email"
  8174. }),
  8175. window.open(C[n], "_blank");
  8176. break;
  8177. case A.LINKEDIN:
  8178. }
  8179. }
  8180. function r(e) {
  8181. I.emit(l.LINK_CLICKED, {
  8182. channel: "copylink"
  8183. });
  8184. var t = document.createRange();
  8185. t.selectNodeContents(v);
  8186. var i = window.getSelection();
  8187. i.removeAllRanges(),
  8188. i.addRange(t),
  8189. document.execCommand("copy"),
  8190. y.classList.remove("hidden"),
  8191. v.classList.add("highlighted")
  8192. }
  8193. function o(e) {
  8194. e && (e.stopPropagation(),
  8195. e.target === v) || (window.getSelection().removeAllRanges(),
  8196. v.classList.remove("highlighted"),
  8197. y.classList.add("hidden"))
  8198. }
  8199. var a = e("../../util/browser")
  8200. , s = e("../../localization/localize")
  8201. , l = e("./ShareEvents")
  8202. , c = e("../../util/common")
  8203. , h = e("events").EventEmitter
  8204. , u = document.getElementById("sharing")
  8205. , d = document.getElementById("share-modal")
  8206. , p = document.getElementById("share-close")
  8207. , f = document.getElementById("facebook-share")
  8208. , g = document.getElementById("twitter-share")
  8209. , m = document.getElementById("mail-share")
  8210. , v = document.getElementById("share-url-text")
  8211. , y = document.getElementById("copy-success")
  8212. , A = Object.freeze({
  8213. FACEBOOK: "facebook",
  8214. TWITTER: "twitter",
  8215. MAIL: "mail",
  8216. LINKEDIN: "linkedin"
  8217. })
  8218. , C = {};
  8219. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8220. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8221. C[A.MAIL] = "mailto:?subject=";
  8222. var I = {
  8223. init: function(e) {
  8224. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8225. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8226. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8227. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8228. u.addEventListener("click", this.toggle.bind(this)),
  8229. p.addEventListener("click", this.hide.bind(this)),
  8230. v.addEventListener("click", r),
  8231. d.addEventListener("click", o),
  8232. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8233. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8234. m.addEventListener("click", n.bind(this, A.MAIL)),
  8235. v.textContent = window.location.href + "&utm_source=4",
  8236. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8237. u.classList.remove("hidden")
  8238. },
  8239. show: function() {
  8240. this.emit(l.OPENED),
  8241. d.classList.add("fadeIn")
  8242. },
  8243. hide: function() {
  8244. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8245. document.selection && document.selection.empty(),
  8246. window.getSelection().removeAllRanges(),
  8247. o(),
  8248. d.classList.remove("fadeIn"))
  8249. },
  8250. toggle: function() {
  8251. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8252. }
  8253. };
  8254. c.extendObject(I, h.prototype),
  8255. t.exports = I
  8256. }
  8257. , {
  8258. "../../localization/localize": 108,
  8259. "../../util/browser": 182,
  8260. "../../util/common": 185,
  8261. "./ShareEvents": 76,
  8262. events: 202
  8263. }],
  8264. 78: [function(e, t, i) {
  8265. "use strict";
  8266. t.exports = Object.freeze({
  8267. OPENED: "terms.opened",
  8268. CLOSED: "terms.closed"
  8269. })
  8270. }
  8271. , {}],
  8272. 79: [function(e, t, i) {
  8273. "use strict";
  8274. var n = e("./TermsEvent")
  8275. , r = e("../../localization/localize")
  8276. , o = e("../../analytics")
  8277. , a = e("../../util/ajax")
  8278. , s = e("../../util/common")
  8279. , l = e("events").EventEmitter
  8280. , c = document.getElementById("terms-modal")
  8281. , h = {
  8282. init: function() {
  8283. $(".footer-terms").on("click", function(e) {
  8284. e.preventDefault(),
  8285. this.show()
  8286. }
  8287. .bind(this)),
  8288. $("#terms-modal .close").on("click", this.hide.bind(this))
  8289. },
  8290. show: function() {
  8291. this.emit(n.OPENED),
  8292. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8293. var t = $("#terms-text").html(e);
  8294. o.track("showcase_gui", {
  8295. gui_action: "click_terms_button",
  8296. interaction_source: "gui"
  8297. }),
  8298. t.find("a").attr("target", "_blank")
  8299. }).fail(function() {
  8300. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8301. }),
  8302. c.classList.add("fadeIn")
  8303. },
  8304. hide: function(e) {
  8305. e && e.preventDefault(),
  8306. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8307. c.classList.remove("fadeIn")
  8308. }
  8309. };
  8310. s.extendObject(h, l.prototype),
  8311. t.exports = h
  8312. }
  8313. , {
  8314. "../../analytics": 4,
  8315. "../../localization/localize": 108,
  8316. "../../util/ajax": 181,
  8317. "../../util/common": 185,
  8318. "./TermsEvent": 78,
  8319. events: 202
  8320. }],
  8321. 80: [function(e, t, i) {
  8322. "use strict";
  8323. t.exports = Object.freeze({
  8324. OPEN_INFO: "title.open.info",
  8325. CLOSE_INFO: "title.close.info",
  8326. SHOW_INFO: "title.show.info",
  8327. HIDE_INFO: "title.hide.info",
  8328. LINK_CLICKED: "title.link.click",
  8329. CONTACT_LINK_CLICKED: "title.contact.click",
  8330. ORIGIN_LINK_CLICKED: "title.origin.click"
  8331. })
  8332. }
  8333. , {}],
  8334. 81: [function(e, t, i) {
  8335. "use strict";
  8336. var o = e("../../settings");
  8337. t.exports.init = function(e, t) {
  8338. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8339. function e(e) {
  8340. t.shouldShowtags = "show" === this.value,
  8341. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8342. }
  8343. document.getElementById("tag-toggles").classList.remove("hidden"),
  8344. document.getElementById("radio-tag-show").checked = !0;
  8345. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8346. n[r].addEventListener("change", e)
  8347. }(e, t)
  8348. }
  8349. }
  8350. , {
  8351. "../../settings": 166
  8352. }],
  8353. 82: [function(S, M, e) {
  8354. (function(e) {
  8355. "use strict";
  8356. function i(e) {
  8357. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8358. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8359. _.appendChild(function(e) {
  8360. var t = document.createElement("a");
  8361. return t.id = "url",
  8362. t.target = "_blank",
  8363. t.href = e,
  8364. t.innerText = e,
  8365. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8366. t
  8367. }(e)),
  8368. b.forEach(function(e) {
  8369. e.classList.add("share-link")
  8370. }),
  8371. 0))
  8372. }
  8373. function s(e, t) {
  8374. var i = e
  8375. , n = t;
  8376. return function(e, t) {
  8377. i.push(t || n, e)
  8378. }
  8379. }
  8380. var l = S("../../util/browser")
  8381. , t = S("../../util/common")
  8382. , n = S("../../util/logger")
  8383. , r = S("../../localization/localize")
  8384. , o = S("./titleBarSettings")
  8385. , c = S("../../settings")
  8386. , a = S("./TitleEvents")
  8387. , h = S("events").EventEmitter
  8388. , u = new n(e)
  8389. , d = document.querySelector(".pinTop.left")
  8390. , p = document.getElementsByClassName("title-container")[0]
  8391. , f = document.getElementById("title-toggle").querySelector("i")
  8392. , g = document.getElementById("meta-info-wrapper")
  8393. , m = document.getElementById("meta-info")
  8394. , v = document.getElementById("meta-description")
  8395. , y = document.getElementsByClassName("contact-info")[0]
  8396. , A = document.getElementById("contact-data")
  8397. , C = document.getElementById("addressTxt")
  8398. , I = document.getElementById("tag-toggles")
  8399. , E = document.getElementById("share-origin")
  8400. , _ = document.getElementById("share-link-wrapper")
  8401. , b = [m, g, p]
  8402. , w = !1
  8403. , T = !1
  8404. , x = {
  8405. populate: function(e) {
  8406. if (function(e, t) {
  8407. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8408. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8409. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8410. document.getElementById("gui-name").classList.add("noCoBrand"),
  8411. document.getElementById("cobrandTitle").classList.add("hidden")),
  8412. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8413. !1)
  8414. }(DATA.name, e.coBrand)) {
  8415. if (function(e) {
  8416. e ? (w = !0,
  8417. v.innerHTML = e) : v.classList.add("hidden")
  8418. }(e.description),
  8419. function(e, t, i, n) {
  8420. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8421. w = !0;
  8422. var r = []
  8423. , o = s(r, "<br>");
  8424. if (e && o('<span id="contactName">' + e + "</span>"),
  8425. t) {
  8426. var a = n || t;
  8427. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8428. }
  8429. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8430. r[0] = "",
  8431. A.innerHTML = r.join("")
  8432. } else
  8433. y.classList.add("hidden")
  8434. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8435. function(e) {
  8436. if ("string" == typeof e)
  8437. try {
  8438. e = JSON.parse(e)
  8439. } catch (e) {
  8440. return u.warn("Unable to parse address data"),
  8441. C.parentElement.classList.add("hidden")
  8442. }
  8443. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8444. w = !0;
  8445. var t = []
  8446. , i = s(t, " ");
  8447. e.address_1 && i(e.address_1),
  8448. e.address_2 && i(e.address_2),
  8449. e.city && i(e.city, ", "),
  8450. e.state && i(e.state, ", "),
  8451. e.zip && i(e.zip, e.state ? " " : ", "),
  8452. t[0] = "",
  8453. C.innerText = t.join("")
  8454. } else
  8455. C.parentElement.classList.add("hidden")
  8456. }(e.address),
  8457. w) {
  8458. var t = document.createElement("br");
  8459. I.insertBefore(t, I.firstElementChild)
  8460. }
  8461. e.socialSharing && c.share.enabled && (T = i(e.url))
  8462. }
  8463. },
  8464. finishSetup: function(e) {
  8465. w = w || !!e,
  8466. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8467. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8468. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8469. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8470. }),
  8471. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8472. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8473. contact_type: e.getAttribute("id")
  8474. }))
  8475. }),
  8476. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8477. },
  8478. toggleMeta: function(e, t) {
  8479. var i = document.getElementById("model-title");
  8480. t && t.preventDefault();
  8481. var n = m.classList.contains("expand");
  8482. e && !n || (n ? (b.forEach(function(e) {
  8483. e.classList.remove("expand")
  8484. }),
  8485. this.emit(a.CLOSE_INFO),
  8486. i.classList.remove("expand")) : (b.forEach(function(e) {
  8487. e.classList.add("expand")
  8488. }),
  8489. i.classList.add("expand"),
  8490. this.emit(a.OPEN_INFO)))
  8491. },
  8492. setupToggling: function() {
  8493. g.style.height = m.offsetHeight + "px",
  8494. m.addEventListener("transitionend", function() {
  8495. g.style.height = m.offsetHeight + "px"
  8496. })
  8497. },
  8498. toggleTitle: function(e) {
  8499. e && e.preventDefault(),
  8500. d.classList.contains("closed") ? (d.classList.add("open"),
  8501. f.classList.remove("icon-dpad-right"),
  8502. f.classList.add("icon-dpad-left"),
  8503. this.emit(a.SHOW_INFO),
  8504. setTimeout(function() {
  8505. d.classList.remove("closed"),
  8506. d.classList.remove("open")
  8507. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8508. f.classList.remove("icon-dpad-left"),
  8509. f.classList.add("icon-dpad-right"),
  8510. this.emit(a.HIDE_INFO))
  8511. }
  8512. };
  8513. t.extendObject(x, h.prototype),
  8514. M.exports = x
  8515. }
  8516. ).call(this, "/js/gui/title/titleBar.js")
  8517. }
  8518. , {
  8519. "../../localization/localize": 108,
  8520. "../../settings": 166,
  8521. "../../util/browser": 182,
  8522. "../../util/common": 185,
  8523. "../../util/logger": 189,
  8524. "./TitleEvents": 80,
  8525. "./titleBarSettings": 83,
  8526. events: 202
  8527. }],
  8528. 83: [function(e, t, i) {
  8529. "use strict";
  8530. t.exports = Object.freeze({
  8531. minTooltipCharacters: 19,
  8532. removeAnimationClasses: 500
  8533. })
  8534. }
  8535. , {}],
  8536. 84: [function(e, t, i) {
  8537. "use strict";
  8538. function n() {
  8539. settings.playTourNearBy ? v.playTourNearBy() : v.playTour()
  8540. y && clearTimeout(y),
  8541. c(),
  8542. E.removeClass("fadeIn")
  8543. }
  8544. function r() {
  8545. A.classList.contains("playing") && (v.stopTour(),
  8546. E.addClass("fadeIn"),
  8547. setTimeout(function() {
  8548. E.removeClass("fadeIn")
  8549. }, h.tourInteraction.showPauseButton),
  8550. M || (clearTimeout(y),
  8551. y = setTimeout(s, h.tourInteraction.showModal)),
  8552. setTimeout(function() {
  8553. A.classList.remove("playing")
  8554. }, h.tourInteraction.allowNextClick))
  8555. }
  8556. function o() {
  8557. v.tourInProgress && (v.stopTour(),
  8558. v.endTourProgress(),
  8559. A.classList.remove("playing"))
  8560. }
  8561. function a() {
  8562. _.is(":visible") ? n() : r()
  8563. }
  8564. function s() {//去掉导览结束时的提示
  8565. /* if (!h.tourInteraction.disabled) {
  8566. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8567. T.addClass("fadeIn tour " + p.deviceType);
  8568. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8569. if (!h.tourInteraction.smallModal)
  8570. 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,
  8571. p.fill(x, g.TOUR_INTERACTION[e]),
  8572. T.addClass(e);
  8573. T.addClass(t)
  8574. } */
  8575. }
  8576. function l(e, t) {
  8577. if (t) {
  8578. if($.contains($('.toolRight')[0],t.target))return //add 防止编辑时input 空格开始导览
  8579. var i = "keydown" === t.type
  8580. , n = t.which === u.SPACE || v.tourIsPlaying;
  8581. i && n || e || (M = !0),
  8582. v.atEndOfTour() && c(),
  8583. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8584. c(),
  8585. t.which !== u.SPACE && o()),
  8586. i && n && a()
  8587. }
  8588. }
  8589. function c() {
  8590. T.removeClass("fadeIn")
  8591. }
  8592. var h = (e("../util/browser"),
  8593. e("../settings"))
  8594. , u = e("../enum/Keys")
  8595. , d = e("../enum/Viewmode")
  8596. , p = (e("./helpManager"),
  8597. e("./populateModal"))
  8598. , f = e("../enum/DirectorEvents")
  8599. , g = e("../enum/HelpModalType")
  8600. , m = e("../enum/HelpModalSize")
  8601. , v = null
  8602. , y = null
  8603. , A = document.getElementById("pause-overlay")
  8604. , C = document.getElementById("player")
  8605. , I = document.getElementById("gui")
  8606. , E = $("#pause-icon").eq(0)
  8607. , _ = $("#play").eq(0)
  8608. , b = $("#playHead").eq(0)
  8609. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8610. , T = $("#interaction-modal").eq(0)
  8611. , x = $("#interaction-modal .interaction").toArray()
  8612. , S = ["touchstart", "mousedown", "pointerdown"]
  8613. , M = !1;
  8614. t.exports.init = function(e) {
  8615. v = e,
  8616. S.forEach(function(t) {
  8617. C.addEventListener(t, l.bind(this, !1), !0),
  8618. I.addEventListener(t, l.bind(this, !0), !0),
  8619. A.addEventListener(t, r, !0),
  8620. w.forEach(function(e) {
  8621. e.addEventListener(t, o, !0)
  8622. }),
  8623. $("#drawer img").on(t, o)
  8624. }),
  8625. document.addEventListener("keydown", l.bind(this, !1), !0),
  8626. v.on(f.TourStart, function() {
  8627. A.classList.add("playing")
  8628. })
  8629. }
  8630. ,
  8631. t.exports.play = n,
  8632. t.exports.pause = r,
  8633. t.exports.pauseWithoutCTA = o,
  8634. t.exports.togglePlay = a,
  8635. t.exports.stopTour = function() {
  8636. b.hasClass("playing") && (clearTimeout(y),
  8637. v.atEndOfTour() ? (A.classList.remove("playing"),
  8638. s()) : E.removeClass("fadeIn"))
  8639. }
  8640. ,
  8641. t.exports.dismissModal = c
  8642. }
  8643. , {
  8644. "../enum/DirectorEvents": 23,
  8645. "../enum/HelpModalSize": 27,
  8646. "../enum/HelpModalType": 28,
  8647. "../enum/Keys": 30,
  8648. "../enum/Viewmode": 51,
  8649. "../settings": 166,
  8650. "../util/browser": 182,
  8651. "./helpManager": 68,
  8652. "./populateModal": 75
  8653. }],
  8654. 85: [function(e, t, i) {
  8655. "use strict";
  8656. t.exports = Object.freeze({
  8657. OPENED: "vr.modal.opened",
  8658. LAUNCH: "vr.modal.launch",
  8659. CLOSED: "vr.modal.closed",
  8660. NEXT: "vr.modal.next",
  8661. PREV: "vr.modal.prev",
  8662. STORE: "vr.modal.store",
  8663. falseICECHOSEN: "vr.modal.device"
  8664. })
  8665. }
  8666. , {}],
  8667. 86: [function(e, t, i) {
  8668. "use strict";
  8669. var h = e("../../util/browser")
  8670. , u = e("../../enum/VRApps")
  8671. , n = e("../../enum/VRPlatforms")
  8672. , d = e("../../util/ajax")
  8673. , p = e("../../settings")
  8674. , r = {};
  8675. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8676. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8677. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8678. u) {
  8679. var a = u[o];
  8680. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8681. }
  8682. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8683. "https://" + s);
  8684. t.exports.init = function(e, t, o) {
  8685. function a(e, t, i, n) {
  8686. function r() {
  8687. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8688. }
  8689. 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()
  8690. }
  8691. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8692. , l = g + "/vr/dlist/?ret=" + s
  8693. , c = g + "/vr/show/?ret=" + s;
  8694. switch (e) {
  8695. case n.IOS:
  8696. !function(t, e, i, n) {
  8697. var r = a(t, e, i, n)
  8698. , o = {
  8699. responseType: "json",
  8700. data: {
  8701. branch_key: p.appConfig.branch_key,
  8702. data: {
  8703. m: e,
  8704. full_url: r,
  8705. $desktop_url: "",
  8706. $og_app_id: "331853976762864119",
  8707. $og_title: i,
  8708. $og_description: n,
  8709. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8710. $canonical_url: window.location.href
  8711. }
  8712. }
  8713. };
  8714. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8715. f[t] = e.url
  8716. }).fail(function(e) {
  8717. f[t] = e
  8718. }
  8719. .bind(this, r))
  8720. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8721. break;
  8722. default:
  8723. !function(e, t, i) {
  8724. for (var n in u) {
  8725. var r = u[n]
  8726. , o = a(r, e, t, i);
  8727. f[r] = o
  8728. }
  8729. }(t.sid, t.name, t.summary)
  8730. }
  8731. }
  8732. ,
  8733. t.exports.launch = function(e) {
  8734. var t = f[e];
  8735. window.open(t, "_blank")
  8736. }
  8737. ,
  8738. t.exports.launchStore = function(e) {
  8739. var t = r[e];
  8740. window.open(t, "_blank")
  8741. }
  8742. }
  8743. , {
  8744. "../../enum/VRApps": 46,
  8745. "../../enum/VRPlatforms": 49,
  8746. "../../settings": 166,
  8747. "../../util/ajax": 181,
  8748. "../../util/browser": 182
  8749. }],
  8750. 87: [function(e, t, i) {
  8751. "use strict";
  8752. function c(e) {
  8753. var t;
  8754. switch (e) {
  8755. case y.IOS:
  8756. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8757. case y.Android:
  8758. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8759. }
  8760. return !1
  8761. }
  8762. function h(e) {
  8763. switch (e) {
  8764. case y.Android:
  8765. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8766. x.filter(".gearvr").off().on("click", q.gear),
  8767. n(k, U, "logo-button", "same-line");
  8768. break;
  8769. case y.UnsupportedAndroid:
  8770. n("", H, "", "");
  8771. break;
  8772. case y.IOS:
  8773. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8774. n(k, "", "logo-button", "");
  8775. break;
  8776. case y.Desktop:
  8777. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8778. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8779. n(k, U, "logo-button", "same-line"),
  8780. Q.cardboard()
  8781. }
  8782. }
  8783. function u(e) {
  8784. $(".p1, .p2, .p3").hide(),
  8785. l.insertAfter(T),
  8786. w.removeClass("front-page"),
  8787. w.removeClass("details-page"),
  8788. w.removeClass("lastPage"),
  8789. x.removeClass("logo-button"),
  8790. x.removeClass("same-line"),
  8791. T.removeClass("headsetOptions"),
  8792. S.attr("src", ""),
  8793. S.filter(".second").removeClass("gear"),
  8794. S.css("display", "inline-block"),
  8795. S.off(),
  8796. M.filter(".second").css("display", ""),
  8797. O.css("display", "none"),
  8798. $(".p" + (e + 1) + _).show(),
  8799. S.filter(".third").insertBefore(M.filter(".third"))
  8800. }
  8801. function n(e, t, i, n) {
  8802. w.addClass("front-page"),
  8803. S.filter(".first").attr("src", e),
  8804. S.filter(".second").attr("src", t),
  8805. x.filter(".first").addClass(i),
  8806. x.filter(".second").addClass(i),
  8807. x.addClass(n),
  8808. ".show-desktop" === _ && T.insertAfter(l)
  8809. }
  8810. function r(e, t, i) {
  8811. T.addClass("headsetOptions"),
  8812. x.off(),
  8813. S.filter(".second").attr("src", t),
  8814. O.css("display", "block"),
  8815. M.filter(".second").css("display", "none"),
  8816. O.on("click", function() {
  8817. u(b.Title),
  8818. h(y.Desktop)
  8819. }),
  8820. e && (X.emit(C.falseICECHOSEN, {
  8821. name: v.GearVR
  8822. }),
  8823. S.filter(".first").attr("src", e),
  8824. S.filter(".second").addClass("gear"),
  8825. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8826. Q.gearvr()),
  8827. i && (X.emit(C.falseICECHOSEN, {
  8828. name: v.Cardboard
  8829. }),
  8830. S.filter(".third").attr("src", i),
  8831. S.filter(".third").show(),
  8832. S.filter(".third").insertAfter(S.filter(".second")),
  8833. S.filter(".third").addClass("link"),
  8834. S.filter(".second").addClass("link"),
  8835. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8836. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8837. Q.cardboard())
  8838. }
  8839. function d(e, t) {
  8840. switch (t) {
  8841. case y.IOS:
  8842. j = W,
  8843. Y = G;
  8844. break;
  8845. case y.Desktop:
  8846. e === b.Cardboard ? (j = N,
  8847. Y = B,
  8848. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8849. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8850. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8851. Y = "");
  8852. break;
  8853. default:
  8854. Y = e === b.Cardboard ? (j = H,
  8855. G) : (j = V,
  8856. z)
  8857. }
  8858. }
  8859. function p(e, t, i) {
  8860. w.find(".inner").addClass("details-page"),
  8861. w.addClass("details-page"),
  8862. S.filter(".first").attr("src", e),
  8863. S.filter(".second").attr("src", t),
  8864. S.filter(".third").attr("src", i)
  8865. }
  8866. function f() {
  8867. var e = 1 < g.aspectRatio() && g.isMobile();
  8868. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8869. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8870. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8871. }
  8872. var g = e("../../util/browser")
  8873. , m = e("./vrLink")
  8874. , v = e("../../enum/VRApps")
  8875. , y = e("../../enum/VRPlatforms")
  8876. , A = e("../../enum/VRPages")
  8877. , C = e("./vrEvent")
  8878. , o = (e("../../settings"),
  8879. e("../../constants"))
  8880. , I = e("../../localization/localize")
  8881. , a = e("../../util/common")
  8882. , s = e("events").EventEmitter
  8883. , E = 0
  8884. , _ = null
  8885. , b = A.standard
  8886. , w = $(".vr-popup")
  8887. , l = w.find(".vr-popup-body")
  8888. , T = w.find(".vr-images")
  8889. , x = w.find(".img-container")
  8890. , S = w.find(".vr-sm-image")
  8891. , M = x.find(".vr-img-caption")
  8892. , R = $(".vr-buttons").find(".prev-button")
  8893. , P = $(".vr-buttons").find(".next-button")
  8894. , O = T.find(".front-close")
  8895. , L = $(".vr-page")
  8896. , D = w.find("img")
  8897. , N = "images/apple-store.png"
  8898. , F = "images/badge-oculus.png"
  8899. , B = "images/badge-cardboard.png"
  8900. , V = "images/logo-samsung.png"
  8901. , k = "images/headset-cardboard.png"
  8902. , U = "images/headset-gearvr.png"
  8903. , H = "images/ico-android-robot.png"
  8904. , z = "images/ico-gearvr.png"
  8905. , G = "images/ico-vr.png"
  8906. , W = "images/apple-logo-white.svg"
  8907. , j = null
  8908. , Y = null
  8909. , q = {}
  8910. , X = {
  8911. init: function(e, t) {
  8912. function i(e) {
  8913. X.emit(C.STORE, {
  8914. type: e
  8915. }),
  8916. m.launchStore(e)
  8917. }
  8918. function n(e) {
  8919. switch (e !== b.pageCount && (u(e),
  8920. L.text(e + 1 + " / " + b.pageCount)),
  8921. e) {
  8922. case b.Title:
  8923. R.css("display", "none"),
  8924. P.text(a[e]),
  8925. h(r);
  8926. break;
  8927. case b.Cardboard:
  8928. R.css("display", "block"),
  8929. P.text(a[e]),
  8930. x.filter(".cardboard").off(),
  8931. x.filter(".gearvr").off(),
  8932. d(e, r),
  8933. p(k, j, Y);
  8934. break;
  8935. case b.Gear:
  8936. P.text(a[e]),
  8937. d(e, r),
  8938. w.addClass("lastPage"),
  8939. p(U, j, Y);
  8940. break;
  8941. case b.pageCount:
  8942. w.removeClass("fadeIn"),
  8943. X.emit(C.CLOSED)
  8944. }
  8945. D.filter("[src='']").hide()
  8946. }
  8947. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8948. _ = ".show-supported",
  8949. y.Android) : (w.addClass("unsupported"),
  8950. _ = ".show-unsupported",
  8951. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8952. _ = ".show-ios",
  8953. b = A.ios,
  8954. y.IOS) : (w.addClass("desktop"),
  8955. _ = ".show-desktop",
  8956. y.Desktop);
  8957. function o(e) {
  8958. X.emit(C.LAUNCH, {
  8959. vr_platform: r,
  8960. vr_app: e
  8961. }),
  8962. m.launch(e)
  8963. }
  8964. m.init(r, e, t),
  8965. r !== y.Desktop && w.addClass("mobile"),
  8966. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8967. q.gear = o.bind(this, v.GearVR),
  8968. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8969. f(),
  8970. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8971. $(_).show();
  8972. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8973. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8974. r === y.IOS && (a.splice(1, 1),
  8975. s.splice(1, 1)),
  8976. $("#vr").on("click", function(e) {
  8977. e.preventDefault(),
  8978. window.vrEnabled || (window.vrEnabled = !0,
  8979. this.classList.add("active"),
  8980. $("#gui div").not("#vrOff").addClass("vrHide"),
  8981. $("#vrOffImg").css({
  8982. display: "inline-block"
  8983. }))
  8984. }),
  8985. $("#vrOff").on("click", function() {
  8986. window.vrEnabled = !1,
  8987. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8988. $("#vrOffImg").css({
  8989. display: "none"
  8990. }),
  8991. $("#player canvas").css({
  8992. width: "",
  8993. height: ""
  8994. }),
  8995. $("#vr").removeClass("active")
  8996. });
  8997. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8998. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8999. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9000. $("span.modelLink").text(l),
  9001. R.on("click", function(e) {
  9002. X.emit(C.PREV),
  9003. n(--E)
  9004. }),
  9005. P.on("click", function(e) {
  9006. P.text(),
  9007. X.emit(C.NEXT, {
  9008. nextAction: s[E]
  9009. }),
  9010. n(++E)
  9011. }),
  9012. w.find(".close").on("click", X.dismiss)
  9013. },
  9014. dismiss: function() {
  9015. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9016. X.emit(C.CLOSED))
  9017. },
  9018. isDeviceSupported: c
  9019. };
  9020. a.extendObject(X, s.prototype),
  9021. $(window).resize(f);
  9022. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9023. K = M.filter(".first").find(".gearvr"),
  9024. {
  9025. cardboard: function() {
  9026. K.addClass("hidden"),
  9027. Z.removeClass("hidden")
  9028. },
  9029. gearvr: function() {
  9030. Z.addClass("hidden"),
  9031. K.removeClass("hidden")
  9032. }
  9033. });
  9034. t.exports = X
  9035. }
  9036. , {
  9037. "../../constants": 8,
  9038. "../../enum/VRApps": 46,
  9039. "../../enum/VRPages": 48,
  9040. "../../enum/VRPlatforms": 49,
  9041. "../../localization/localize": 108,
  9042. "../../settings": 166,
  9043. "../../util/browser": 182,
  9044. "../../util/common": 185,
  9045. "./vrEvent": 85,
  9046. "./vrLink": 86,
  9047. events: 202
  9048. }],
  9049. 88: [function(e, t, i) {
  9050. "use strict";
  9051. t.exports = Object.freeze({
  9052. OPENED: "webvr.modal.opened",
  9053. SHOW_TERMS: "webvr.footer.show.terms"
  9054. })
  9055. }
  9056. , {}],
  9057. 89: [function(B, V, e) {
  9058. (function(e) {
  9059. "use strict";
  9060. function a() {
  9061. function t() {
  9062. p.isPresenting || (r.info("exiting webVR"),
  9063. c("webvr_exit_app"),
  9064. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9065. window.removeEventListener("vrdisplaypresentchange", t))
  9066. }
  9067. r.info("Headset mounted"),
  9068. u.suspend();
  9069. var e = document.createElement("canvas");
  9070. for (e.getContext("webgl"),
  9071. e.className = "webvr-canvas",
  9072. document.bgColor = "#000",
  9073. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9074. document.body.removeChild(document.body.firstChild);
  9075. document.body.appendChild(e),
  9076. c("webvr_enter_app"),
  9077. p.requestPresent([{
  9078. source: e,
  9079. predistorted: !0
  9080. }]).catch(function(e) {
  9081. r.error("Failed to present: " + e),
  9082. c("webvr_exit_calibrate"),
  9083. t()
  9084. }),
  9085. d.then(function() {
  9086. window.dispatchEvent(new Event("vrapp-start"))
  9087. }),
  9088. window.addEventListener("vrdisplaypresentchange", t)
  9089. }
  9090. function s() {
  9091. c("webvr_modal_close"),
  9092. _.find(".enter-button").off("click", a),
  9093. E.fadeOut(g.guiAnimationSpeed, function() {
  9094. _.toggleClass("hidden", !1),
  9095. b.toggleClass("hidden", !0),
  9096. f.exitFullscreen()
  9097. }),
  9098. I.fadeIn(g.guiAnimationSpeed)
  9099. }
  9100. function t() {
  9101. M.toggleClass("hidden", !0),
  9102. S.toggleClass("hidden", !1)
  9103. }
  9104. function l() {
  9105. _.toggleClass("hidden"),
  9106. b.toggleClass("hidden")
  9107. }
  9108. function c(e) {
  9109. var t = f.isLandscape() ? "landscape" : "portrait";
  9110. i.trackAlways("showcase_gui", {
  9111. gui_action: e,
  9112. orientation: t
  9113. })
  9114. }
  9115. function h() {
  9116. var e = f.isLandscape();
  9117. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9118. }
  9119. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9120. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9121. 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 = {
  9122. init: function(e, t, i, n) {
  9123. function r(e) {
  9124. e.preventDefault(),
  9125. o(e.currentTarget.id)
  9126. }
  9127. function o(i) {
  9128. F[i](),
  9129. Object.keys(F).map(function(e, t) {
  9130. $("#" + e).toggleClass("tabs-underlined", e === i)
  9131. })
  9132. }
  9133. p = i,
  9134. u = t,
  9135. y.init(m.Android, e, n),
  9136. h(),
  9137. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9138. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9139. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9140. w.filter(".device-headset-side").attr("src", R),
  9141. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9142. $("#vr").on("click", function(e) {
  9143. e.preventDefault(),
  9144. c("click_webvr_button"),
  9145. E.is(":hidden") && (N.emit(A.OPENED),
  9146. I.fadeOut(g.guiAnimationSpeed),
  9147. E.fadeIn(g.guiAnimationSpeed),
  9148. function() {
  9149. if (!d) {
  9150. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9151. d = new Promise(function(e, t) {
  9152. var i = document.createElement("script");
  9153. i.type = "text/javascript",
  9154. i.src = n,
  9155. i.onload = e,
  9156. document.head.appendChild(i)
  9157. }
  9158. )
  9159. }
  9160. _.find(".enter-button").on("click", a)
  9161. }())
  9162. }),
  9163. $(".webvr-popup .close").on("click", function(e) {
  9164. e.preventDefault(),
  9165. _.hasClass("hidden") ? (c("webvr_help_close"),
  9166. l()) : s()
  9167. }),
  9168. $("#tabcardboard").on("click", r),
  9169. $("#tabdaydream").on("click", r),
  9170. $("#tabnative").on("click", r),
  9171. $(".webvr-popup .open-with-app").on("click", function(e) {
  9172. e.preventDefault(),
  9173. c("webvr_learn_more"),
  9174. o("tabnative"),
  9175. l()
  9176. }),
  9177. $(".webvr-popup .help").on("click", function(e) {
  9178. e.preventDefault(),
  9179. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9180. l()
  9181. }),
  9182. $(".webvr-popup .terms").on("click", function(e) {
  9183. e.preventDefault(),
  9184. c("webvr_click_terms"),
  9185. s(),
  9186. N.emit(A.SHOW_TERMS)
  9187. }),
  9188. T.on("click", function(e) {
  9189. e.preventDefault(),
  9190. c(D),
  9191. window.open(L, "_blank")
  9192. }),
  9193. x.on("click", function(e) {
  9194. e.preventDefault(),
  9195. c("webvr_phone_link"),
  9196. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9197. }),
  9198. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9199. e.preventDefault(),
  9200. c("webvr_cardboard_link"),
  9201. y.launch(v.CardboardAndroid)
  9202. }),
  9203. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9204. e.preventDefault(),
  9205. c("webvr_oculus_link"),
  9206. y.launch(v.GearVR)
  9207. })
  9208. }
  9209. }, F = {
  9210. tabcardboard: function() {
  9211. w.filter(".device-headset").attr("src", R),
  9212. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9213. L = "https://vr.google.com/cardboard/get-cardboard/",
  9214. D = "webvr_cardboard_link",
  9215. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9216. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9217. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9218. t()
  9219. },
  9220. tabdaydream: function() {
  9221. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9222. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9223. L = P,
  9224. D = O,
  9225. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9226. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9227. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9228. t()
  9229. },
  9230. tabnative: function() {
  9231. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9232. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9233. M.toggleClass("hidden", !1),
  9234. S.toggleClass("hidden", !0)
  9235. }
  9236. };
  9237. n.extendObject(N, o.prototype),
  9238. $(window).resize(h),
  9239. V.exports = N
  9240. }
  9241. ).call(this, "/js/gui/webvr/webVRgui.js")
  9242. }
  9243. , {
  9244. "../../analytics": 4,
  9245. "../../constants": 8,
  9246. "../../enum/VRApps": 46,
  9247. "../../enum/VRPlatforms": 49,
  9248. "../../localization/localize": 108,
  9249. "../../settings": 166,
  9250. "../../util/browser": 182,
  9251. "../../util/common": 185,
  9252. "../../util/logger": 189,
  9253. "./../gui": 65,
  9254. "./../vr/vrLink": 86,
  9255. "./WebVrEvent": 88,
  9256. events: 202
  9257. }],
  9258. 90: [function(e, t, i) {
  9259. "use strict";
  9260. function n(e, t, i, n, r) {
  9261. this.floorId = n || 0 === n ? n : -1,
  9262. this.roomId = r || "",
  9263. this.labelId = e,
  9264. this.position = (new o.Vector3).copy(t),
  9265. this.text = i
  9266. }
  9267. var o = e("three")
  9268. , r = e("../util/browser");
  9269. n.prototype.build = function() {
  9270. var e = window.document.createElement("div");
  9271. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9272. var t = window.document.createElement("div");
  9273. t.setAttribute("class", "gui-floorplan-label-text");
  9274. var i = window.document.createTextNode(this.text);
  9275. t.appendChild(i),
  9276. e.appendChild(t),
  9277. window.document.body.appendChild(e),
  9278. this.labelGui = e,
  9279. this.textBlock = t,
  9280. $(this.labelGui).hide();
  9281. var n = window.getComputedStyle(this.labelGui);
  9282. this.initialTransform = n.transform || n.webkitTransform
  9283. }
  9284. ,
  9285. t.exports = n
  9286. }
  9287. , {
  9288. "../util/browser": 182,
  9289. three: 217
  9290. }],
  9291. 91: [function(e, t, i) {
  9292. "use strict";
  9293. function n() {
  9294. this.player = null,
  9295. this.modelManager = null,
  9296. this.container = null
  9297. }
  9298. var c, o, r = e("three"), a = (e("../util/common"),
  9299. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9300. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9301. e("../util/transitions"),
  9302. e("../util/lerp"),
  9303. e("../util/browser"));
  9304. n.prototype.init = function(e, t, i) {
  9305. this.player = e,
  9306. this.modelManager = t,
  9307. this.container = i,
  9308. this.updateModel(),
  9309. this.bindEvents()
  9310. }
  9311. ,
  9312. n.prototype.bindEvents = function() {
  9313. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9314. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9315. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9316. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9317. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9318. }
  9319. ,
  9320. n.prototype.updateModel = function() {
  9321. this.model = this.modelManager.getActiveModel()
  9322. }
  9323. ,
  9324. n.prototype.handlePlayerViewChanged = function() {
  9325. this.updateLabelVisibility(),
  9326. this.updateLabelDisplay()
  9327. }
  9328. ,
  9329. n.prototype.getLabelsForFloor = function(t, i) {
  9330. return (i = i || []).length = 0,
  9331. this.model.labels.forEach(function(e) {
  9332. this.labelVisibleForFloor(e, t) && i.push(e)
  9333. }
  9334. .bind(this)),
  9335. i
  9336. }
  9337. ,
  9338. n.prototype.getLabelsForCurrentFloor = function(e) {
  9339. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9340. }
  9341. ,
  9342. n.prototype.labelVisibleForFloor = function(e, t) {
  9343. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9344. if (!this.model.showingLabels || !e.labelGui || !i)
  9345. return !1;
  9346. var n = e.floorId === this.model.floors.size() - 1;
  9347. return this.model.allFloorsVisible ? n : e.floorId === t
  9348. }
  9349. ,
  9350. n.prototype.updateLabelVisibility = function(e) {
  9351. this.model.labels.forEach(function(e) {
  9352. 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)
  9353. }
  9354. .bind(this))
  9355. }
  9356. ,
  9357. n.prototype.showAllLabels = function(t, i) {
  9358. this.model.labels.forEach(function(e) {
  9359. this.showLabel(e, t, i)
  9360. }
  9361. .bind(this))
  9362. }
  9363. ,
  9364. n.prototype.hideAllLabels = function(t, i) {
  9365. this.model.labels.forEach(function(e) {
  9366. this.hideLabel(e, t, i)
  9367. }
  9368. .bind(this))
  9369. }
  9370. ,
  9371. n.prototype.showLabel = function(e, t, i) {
  9372. this.model.showingLabels && (e.visible || (e.visible = !0,
  9373. e.labelGui.style.display = "block",
  9374. e.labelGui.style.opacity = 0,
  9375. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9376. }
  9377. ,
  9378. n.prototype.hideLabel = function(e, t, i) {
  9379. e.visible && (e.visible = !1,
  9380. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9381. }
  9382. ,
  9383. n.prototype.supportedMode = function() {
  9384. return this.player.mode === h.FLOORPLAN
  9385. }
  9386. ,
  9387. n.prototype.updateLabelDisplay = (new r.Vector3,
  9388. new r.Vector3,
  9389. o = [],
  9390. function() {
  9391. var e = this.player.getLabelScaleFactor()
  9392. , t = 1.2 * (1 - e) + .6
  9393. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9394. this.getLabelsForCurrentFloor(o);
  9395. for (var n = 0; n < o.length; n++) {
  9396. var r = o[n];
  9397. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9398. 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)
  9399. }
  9400. }
  9401. ),
  9402. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9403. new r.Vector3,
  9404. function(e, t, i, n, r) {
  9405. t.style.fontSize = 100 * r + "%";
  9406. var o = .5 * $("#player").width()
  9407. , a = .5 * $("#player").height();
  9408. c.copy(i),
  9409. c.project(this.player.camera);
  9410. var s = c.x * o + o
  9411. , l = -c.y * a + a;
  9412. s -= e.offsetWidth / 2,
  9413. l -= e.offsetHeight / 2,
  9414. e.style.left = s + "px",
  9415. e.style.top = l + "px"
  9416. }
  9417. ),
  9418. n.prototype.handleStartInside = function(e) {
  9419. this.updateLabelVisibility()
  9420. }
  9421. ,
  9422. n.prototype.handleStartOutside = function() {
  9423. this.updateLabelVisibility()
  9424. }
  9425. ,
  9426. t.exports = n
  9427. }
  9428. , {
  9429. "../enum/DirectorEvents": 23,
  9430. "../enum/ModelManagerEvents": 33,
  9431. "../enum/PlayerEvents": 40,
  9432. "../enum/Viewmode": 51,
  9433. "../enum/WarpStyle": 52,
  9434. "../settings": 166,
  9435. "../util/browser": 182,
  9436. "../util/common": 185,
  9437. "../util/lerp": 188,
  9438. "../util/transitions": 195,
  9439. three: 217
  9440. }],
  9441. 92: [function(e, t, i) {
  9442. "use strict";
  9443. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9444. if (null == this)
  9445. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9446. if ("function" != typeof e)
  9447. throw new TypeError("predicate must be a function");
  9448. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9449. if (t = i[o],
  9450. e.call(r, t, o, i))
  9451. return o;
  9452. return -1
  9453. }
  9454. ),
  9455. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9456. value: function(e) {
  9457. if (null == this)
  9458. throw new TypeError('"this" is null or not defined');
  9459. var t = Object(this)
  9460. , i = t.length >>> 0;
  9461. if ("function" != typeof e)
  9462. throw new TypeError("predicate must be a function");
  9463. for (var n = arguments[1], r = 0; r < i; ) {
  9464. var o = t[r];
  9465. if (e.call(n, o, r, t))
  9466. return o;
  9467. r++
  9468. }
  9469. }
  9470. })
  9471. }
  9472. , {}],
  9473. 93: [function(e, t, i) {
  9474. "use strict";
  9475. 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 || {};
  9476. function te() {
  9477. this.backgroundElement = document.createElement("div"),
  9478. r.extend(this.backgroundElement.style, {
  9479. backgroundColor: "rgba(0,0,0,0.8)",
  9480. top: 0,
  9481. left: 0,
  9482. display: "none",
  9483. zIndex: "1000",
  9484. opacity: 0,
  9485. WebkitTransition: "opacity 0.2s linear"
  9486. }),
  9487. n.makeFullscreen(this.backgroundElement),
  9488. this.backgroundElement.style.position = "fixed",
  9489. this.domElement = document.createElement("div"),
  9490. r.extend(this.domElement.style, {
  9491. position: "fixed",
  9492. display: "none",
  9493. zIndex: "1001",
  9494. opacity: 0,
  9495. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9496. }),
  9497. document.body.appendChild(this.backgroundElement),
  9498. document.body.appendChild(this.domElement);
  9499. var e = this;
  9500. n.bind(this.backgroundElement, "click", function() {
  9501. e.hide()
  9502. })
  9503. }
  9504. function ie(e, t, i) {
  9505. Object.defineProperty(e, t, {
  9506. get: function() {
  9507. return "RGB" === this.__state.space || re(this, t, i),
  9508. this.__state[t]
  9509. },
  9510. set: function(e) {
  9511. "RGB" !== this.__state.space && (re(this, t, i),
  9512. this.__state.space = "RGB"),
  9513. this.__state[t] = e
  9514. }
  9515. })
  9516. }
  9517. function ne(e, t) {
  9518. Object.defineProperty(e, t, {
  9519. get: function() {
  9520. return "HSV" === this.__state.space || oe(this),
  9521. this.__state[t]
  9522. },
  9523. set: function(e) {
  9524. "HSV" !== this.__state.space && (oe(this),
  9525. this.__state.space = "HSV"),
  9526. this.__state[t] = e
  9527. }
  9528. })
  9529. }
  9530. function re(e, t, i) {
  9531. if ("HEX" === e.__state.space)
  9532. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9533. else {
  9534. if ("HSV" !== e.__state.space)
  9535. throw "Corrupted color state";
  9536. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9537. }
  9538. }
  9539. function oe(e) {
  9540. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9541. l.extend(e.__state, {
  9542. s: t.s,
  9543. v: t.v
  9544. }),
  9545. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9546. }
  9547. function ae() {
  9548. if (this.__state = o.apply(this, arguments),
  9549. !1 === this.__state)
  9550. throw "Failed to interpret color arguments";
  9551. this.__state.a = this.__state.a || 1
  9552. }
  9553. function se(e) {
  9554. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9555. }
  9556. function le(e, t) {
  9557. this.initialValue = e[t],
  9558. this.domElement = document.createElement("div"),
  9559. this.object = e,
  9560. this.property = t,
  9561. this.__onChange = void 0,
  9562. this.__onFinishChange = void 0
  9563. }
  9564. (t.exports = ee).gui = ee.gui || {},
  9565. ee.utils = ee.utils || {},
  9566. ee.controllers = ee.controllers || {},
  9567. ee.dom = ee.dom || {},
  9568. ee.color = ee.color || {},
  9569. ee.utils.css = {
  9570. load: function(e, t) {
  9571. var i = (t = t || document).createElement("link");
  9572. i.type = "text/css",
  9573. i.rel = "stylesheet",
  9574. i.href = e,
  9575. t.getElementsByTagName("head")[0].appendChild(i)
  9576. },
  9577. inject: function(e, t) {
  9578. t = t || document;
  9579. var i = document.createElement("style");
  9580. i.type = "text/css",
  9581. i.innerHTML = e,
  9582. t.getElementsByTagName("head")[0].appendChild(i)
  9583. }
  9584. },
  9585. ee.utils.common = (Q = Array.prototype.forEach,
  9586. J = Array.prototype.slice,
  9587. {
  9588. BREAK: {},
  9589. extend: function(i) {
  9590. return this.each(J.call(arguments, 1), function(e) {
  9591. for (var t in e)
  9592. this.isUndefined(e[t]) || (i[t] = e[t])
  9593. }, this),
  9594. i
  9595. },
  9596. defaults: function(i) {
  9597. return this.each(J.call(arguments, 1), function(e) {
  9598. for (var t in e)
  9599. this.isUndefined(i[t]) && (i[t] = e[t])
  9600. }, this),
  9601. i
  9602. },
  9603. compose: function() {
  9604. var i = J.call(arguments);
  9605. return function() {
  9606. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9607. e = [i[t].apply(this, e)];
  9608. return e[0]
  9609. }
  9610. },
  9611. each: function(e, t, i) {
  9612. if (e)
  9613. if (Q && e.forEach && e.forEach === Q)
  9614. e.forEach(t, i);
  9615. else if (e.length === e.length + 0) {
  9616. for (var n = 0, r = e.length; n < r; n++)
  9617. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9618. return
  9619. } else
  9620. for (var n in e)
  9621. if (t.call(i, e[n], n) === this.BREAK)
  9622. return
  9623. },
  9624. defer: function(e) {
  9625. setTimeout(e, 0)
  9626. },
  9627. toArray: function(e) {
  9628. return e.toArray ? e.toArray() : J.call(e)
  9629. },
  9630. isUndefined: function(e) {
  9631. return void 0 === e
  9632. },
  9633. isNull: function(e) {
  9634. return null === e
  9635. },
  9636. isNaN: function(e) {
  9637. return e != e
  9638. },
  9639. isArray: Array.isArray || function(e) {
  9640. return e.constructor === Array
  9641. }
  9642. ,
  9643. isObject: function(e) {
  9644. return e === Object(e)
  9645. },
  9646. isNumber: function(e) {
  9647. return e === e + 0
  9648. },
  9649. isString: function(e) {
  9650. return e === e + ""
  9651. },
  9652. isBoolean: function(e) {
  9653. return !1 === e || !0 === e
  9654. },
  9655. isFunction: function(e) {
  9656. return "[object Function]" === Object.prototype.toString.call(e)
  9657. }
  9658. }),
  9659. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9660. onChange: function(e) {
  9661. return this.__onChange = e,
  9662. this
  9663. },
  9664. onFinishChange: function(e) {
  9665. return this.__onFinishChange = e,
  9666. this
  9667. },
  9668. setValue: function(e) {
  9669. return this.object[this.property] = e,
  9670. this.__onChange && this.__onChange.call(this, e),
  9671. this.updateDisplay(),
  9672. this
  9673. },
  9674. getValue: function() {
  9675. return this.object[this.property]
  9676. },
  9677. updateDisplay: function() {
  9678. return this
  9679. },
  9680. isModified: function() {
  9681. return this.initialValue !== this.getValue()
  9682. }
  9683. }),
  9684. le),
  9685. ee.dom.dom = function(c) {
  9686. function i(e) {
  9687. if ("0" === e || c.isUndefined(e))
  9688. return 0;
  9689. var t = e.match(n);
  9690. return c.isNull(t) ? 0 : parseFloat(t[1])
  9691. }
  9692. var h = {};
  9693. c.each({
  9694. HTMLEvents: ["change"],
  9695. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9696. KeyboardEvents: ["keydown"]
  9697. }, function(e, t) {
  9698. c.each(e, function(e) {
  9699. h[e] = t
  9700. })
  9701. });
  9702. var n = /(\d+(\.\d+)?)px/
  9703. , r = {
  9704. makeSelectable: function(e, t) {
  9705. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9706. return !1
  9707. }
  9708. : function() {}
  9709. ,
  9710. e.style.MozUserSelect = t ? "auto" : "none",
  9711. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9712. e.unselectable = t ? "on" : "off")
  9713. },
  9714. makeFullscreen: function(e, t, i) {
  9715. c.isUndefined(t) && (t = !0),
  9716. c.isUndefined(i) && (i = !0),
  9717. e.style.position = "absolute",
  9718. t && (e.style.left = 0,
  9719. e.style.right = 0),
  9720. i && (e.style.top = 0,
  9721. e.style.bottom = 0)
  9722. },
  9723. fakeEvent: function(e, t, i, n) {
  9724. i = i || {};
  9725. var r = h[t];
  9726. if (!r)
  9727. throw new Error("Event type " + t + " not supported.");
  9728. var o = document.createEvent(r);
  9729. switch (r) {
  9730. case "MouseEvents":
  9731. var a = i.x || i.clientX || 0
  9732. , s = i.y || i.clientY || 0;
  9733. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9734. break;
  9735. case "KeyboardEvents":
  9736. var l = o.initKeyboardEvent || o.initKeyEvent;
  9737. c.defaults(i, {
  9738. cancelable: !0,
  9739. ctrlKey: !1,
  9740. altKey: !1,
  9741. shiftKey: !1,
  9742. metaKey: !1,
  9743. keyCode: void 0,
  9744. charCode: void 0
  9745. }),
  9746. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9747. break;
  9748. default:
  9749. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9750. }
  9751. c.defaults(o, n),
  9752. e.dispatchEvent(o)
  9753. },
  9754. bind: function(e, t, i, n) {
  9755. return n = n || !1,
  9756. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9757. r
  9758. },
  9759. unbind: function(e, t, i, n) {
  9760. return n = n || !1,
  9761. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9762. r
  9763. },
  9764. addClass: function(e, t) {
  9765. if (void 0 === e.className)
  9766. e.className = t;
  9767. else if (e.className !== t) {
  9768. var i = e.className.split(/ +/);
  9769. -1 == i.indexOf(t) && (i.push(t),
  9770. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9771. }
  9772. return r
  9773. },
  9774. removeClass: function(e, t) {
  9775. if (t)
  9776. if (void 0 === e.className)
  9777. ;
  9778. else if (e.className === t)
  9779. e.removeAttribute("class");
  9780. else {
  9781. var i = e.className.split(/ +/)
  9782. , n = i.indexOf(t);
  9783. -1 != n && (i.splice(n, 1),
  9784. e.className = i.join(" "))
  9785. }
  9786. else
  9787. e.className = void 0;
  9788. return r
  9789. },
  9790. hasClass: function(e, t) {
  9791. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9792. },
  9793. getWidth: function(e) {
  9794. var t = getComputedStyle(e);
  9795. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9796. },
  9797. getHeight: function(e) {
  9798. var t = getComputedStyle(e);
  9799. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9800. },
  9801. getOffset: function(e) {
  9802. var t = {
  9803. left: 0,
  9804. top: 0
  9805. };
  9806. if (e.offsetParent)
  9807. for (; t.left += e.offsetLeft,
  9808. t.top += e.offsetTop,
  9809. e = e.offsetParent; )
  9810. ;
  9811. return t
  9812. },
  9813. isActive: function(e) {
  9814. return e === document.activeElement && (e.type || e.href)
  9815. }
  9816. };
  9817. return r
  9818. }(ee.utils.common),
  9819. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9820. X = ee.dom.dom,
  9821. Z = ee.utils.common,
  9822. (K = function(e, t, i) {
  9823. K.superclass.call(this, e, t);
  9824. var n = this;
  9825. if (this.__select = document.createElement("select"),
  9826. Z.isArray(i)) {
  9827. var r = {};
  9828. Z.each(i, function(e) {
  9829. r[e] = e
  9830. }),
  9831. i = r
  9832. }
  9833. Z.each(i, function(e, t) {
  9834. var i = document.createElement("option");
  9835. i.innerHTML = t,
  9836. i.setAttribute("value", e),
  9837. n.__select.appendChild(i)
  9838. }),
  9839. this.updateDisplay(),
  9840. X.bind(this.__select, "change", function() {
  9841. var e = this.options[this.selectedIndex].value;
  9842. n.setValue(e)
  9843. }),
  9844. this.domElement.appendChild(this.__select)
  9845. }
  9846. ).superclass = q,
  9847. Z.extend(K.prototype, q.prototype, {
  9848. setValue: function(e) {
  9849. var t = K.superclass.prototype.setValue.call(this, e);
  9850. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9851. t
  9852. },
  9853. updateDisplay: function() {
  9854. return this.__select.value = this.getValue(),
  9855. K.superclass.prototype.updateDisplay.call(this)
  9856. }
  9857. }),
  9858. K),
  9859. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9860. j = ee.utils.common,
  9861. (Y = function(e, t, i) {
  9862. Y.superclass.call(this, e, t),
  9863. i = i || {},
  9864. this.__min = i.min,
  9865. this.__max = i.max,
  9866. this.__step = i.step,
  9867. 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,
  9868. this.__precision = se(this.__impliedStep)
  9869. }
  9870. ).superclass = W,
  9871. j.extend(Y.prototype, W.prototype, {
  9872. setValue: function(e) {
  9873. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9874. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9875. Y.superclass.prototype.setValue.call(this, e)
  9876. },
  9877. min: function(e) {
  9878. return this.__min = e,
  9879. this
  9880. },
  9881. max: function(e) {
  9882. return this.__max = e,
  9883. this
  9884. },
  9885. step: function(e) {
  9886. return this.__step = e,
  9887. this.__impliedStep = e,
  9888. this.__precision = se(e),
  9889. this
  9890. }
  9891. }),
  9892. Y),
  9893. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9894. H = ee.dom.dom,
  9895. z = ee.utils.common,
  9896. (G = function(e, t, i) {
  9897. function n() {
  9898. var e = parseFloat(s.__input.value);
  9899. z.isNaN(e) || s.setValue(e)
  9900. }
  9901. function r(e) {
  9902. var t = a - e.clientY;
  9903. s.setValue(s.getValue() + t * s.__impliedStep),
  9904. a = e.clientY
  9905. }
  9906. function o() {
  9907. H.unbind(window, "mousemove", r),
  9908. H.unbind(window, "mouseup", o)
  9909. }
  9910. this.__truncationSuspended = !1,
  9911. G.superclass.call(this, e, t, i);
  9912. var a, s = this;
  9913. this.__input = document.createElement("input"),
  9914. this.__input.setAttribute("type", "text"),
  9915. H.bind(this.__input, "change", n),
  9916. H.bind(this.__input, "blur", function() {
  9917. n(),
  9918. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9919. }),
  9920. H.bind(this.__input, "mousedown", function(e) {
  9921. H.bind(window, "mousemove", r),
  9922. H.bind(window, "mouseup", o),
  9923. a = e.clientY
  9924. }),
  9925. H.bind(this.__input, "keydown", function(e) {
  9926. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9927. this.blur(),
  9928. s.__truncationSuspended = !1)
  9929. }),
  9930. this.updateDisplay(),
  9931. this.domElement.appendChild(this.__input)
  9932. }
  9933. ).superclass = U,
  9934. z.extend(G.prototype, U.prototype, {
  9935. updateDisplay: function() {
  9936. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9937. var i = Math.pow(10, t);
  9938. return Math.round(e * i) / i
  9939. }(this.getValue(), this.__precision),
  9940. G.superclass.prototype.updateDisplay.call(this)
  9941. }
  9942. }),
  9943. G),
  9944. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9945. F = ee.dom.dom,
  9946. B = ee.utils.css,
  9947. V = ee.utils.common,
  9948. (k = function(e, t, i, n, r) {
  9949. function o(e) {
  9950. e.preventDefault();
  9951. var t = F.getOffset(s.__background)
  9952. , i = F.getWidth(s.__background);
  9953. return s.setValue(function(e, t, i, n, r) {
  9954. return n + (e - t) / (i - t) * (r - n)
  9955. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9956. !1
  9957. }
  9958. function a() {
  9959. F.unbind(window, "mousemove", o),
  9960. F.unbind(window, "mouseup", a),
  9961. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9962. }
  9963. k.superclass.call(this, e, t, {
  9964. min: i,
  9965. max: n,
  9966. step: r
  9967. });
  9968. var s = this;
  9969. this.__background = document.createElement("div"),
  9970. this.__foreground = document.createElement("div"),
  9971. F.bind(this.__background, "mousedown", function(e) {
  9972. F.bind(window, "mousemove", o),
  9973. F.bind(window, "mouseup", a),
  9974. o(e)
  9975. }),
  9976. F.addClass(this.__background, "slider"),
  9977. F.addClass(this.__foreground, "slider-fg"),
  9978. this.updateDisplay(),
  9979. this.__background.appendChild(this.__foreground),
  9980. this.domElement.appendChild(this.__background)
  9981. }
  9982. ).superclass = N,
  9983. k.useDefaultStyles = function() {
  9984. 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}")
  9985. }
  9986. ,
  9987. V.extend(k.prototype, N.prototype, {
  9988. updateDisplay: function() {
  9989. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9990. return this.__foreground.style.width = 100 * e + "%",
  9991. k.superclass.prototype.updateDisplay.call(this)
  9992. }
  9993. }),
  9994. k),
  9995. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9996. O = ee.dom.dom,
  9997. L = ee.utils.common,
  9998. (D = function(e, t, i) {
  9999. D.superclass.call(this, e, t);
  10000. var n = this;
  10001. this.__button = document.createElement("div"),
  10002. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10003. O.bind(this.__button, "click", function(e) {
  10004. return e.preventDefault(),
  10005. n.fire(),
  10006. !1
  10007. }),
  10008. O.addClass(this.__button, "button"),
  10009. this.domElement.appendChild(this.__button)
  10010. }
  10011. ).superclass = P,
  10012. L.extend(D.prototype, P.prototype, {
  10013. fire: function() {
  10014. this.__onChange && this.__onChange.call(this),
  10015. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10016. this.getValue().call(this.object)
  10017. }
  10018. }),
  10019. D),
  10020. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10021. S = ee.dom.dom,
  10022. M = ee.utils.common,
  10023. (R = function(e, t) {
  10024. R.superclass.call(this, e, t);
  10025. var i = this;
  10026. this.__prev = this.getValue(),
  10027. this.__checkbox = document.createElement("input"),
  10028. this.__checkbox.setAttribute("type", "checkbox"),
  10029. S.bind(this.__checkbox, "change", function() {
  10030. i.setValue(!i.__prev)
  10031. }, !1),
  10032. this.domElement.appendChild(this.__checkbox),
  10033. this.updateDisplay()
  10034. }
  10035. ).superclass = x,
  10036. M.extend(R.prototype, x.prototype, {
  10037. setValue: function(e) {
  10038. var t = R.superclass.prototype.setValue.call(this, e);
  10039. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10040. this.__prev = this.getValue(),
  10041. t
  10042. },
  10043. updateDisplay: function() {
  10044. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10045. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10046. R.superclass.prototype.updateDisplay.call(this)
  10047. }
  10048. }),
  10049. R),
  10050. ee.color.toString = (T = ee.utils.common,
  10051. function(e) {
  10052. if (1 == e.a || T.isUndefined(e.a)) {
  10053. for (var t = e.hex.toString(16); t.length < 6; )
  10054. t = "0" + t;
  10055. return "#" + t
  10056. }
  10057. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10058. }
  10059. ),
  10060. ee.color.interpret = (I = ee.color.toString,
  10061. E = ee.utils.common,
  10062. w = [{
  10063. litmus: E.isString,
  10064. conversions: {
  10065. THREE_CHAR_HEX: {
  10066. read: function(e) {
  10067. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10068. return null !== t && {
  10069. space: "HEX",
  10070. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10071. }
  10072. },
  10073. write: I
  10074. },
  10075. SIX_CHAR_HEX: {
  10076. read: function(e) {
  10077. var t = e.match(/^#([A-F0-9]{6})$/i);
  10078. return null !== t && {
  10079. space: "HEX",
  10080. hex: parseInt("0x" + t[1].toString())
  10081. }
  10082. },
  10083. write: I
  10084. },
  10085. CSS_RGB: {
  10086. read: function(e) {
  10087. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10088. return null !== t && {
  10089. space: "RGB",
  10090. r: parseFloat(t[1]),
  10091. g: parseFloat(t[2]),
  10092. b: parseFloat(t[3])
  10093. }
  10094. },
  10095. write: I
  10096. },
  10097. CSS_RGBA: {
  10098. read: function(e) {
  10099. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10100. return null !== t && {
  10101. space: "RGB",
  10102. r: parseFloat(t[1]),
  10103. g: parseFloat(t[2]),
  10104. b: parseFloat(t[3]),
  10105. a: parseFloat(t[4])
  10106. }
  10107. },
  10108. write: I
  10109. }
  10110. }
  10111. }, {
  10112. litmus: E.isNumber,
  10113. conversions: {
  10114. HEX: {
  10115. read: function(e) {
  10116. return {
  10117. space: "HEX",
  10118. hex: e,
  10119. conversionName: "HEX"
  10120. }
  10121. },
  10122. write: function(e) {
  10123. return e.hex
  10124. }
  10125. }
  10126. }
  10127. }, {
  10128. litmus: E.isArray,
  10129. conversions: {
  10130. RGB_ARRAY: {
  10131. read: function(e) {
  10132. return 3 == e.length && {
  10133. space: "RGB",
  10134. r: e[0],
  10135. g: e[1],
  10136. b: e[2]
  10137. }
  10138. },
  10139. write: function(e) {
  10140. return [e.r, e.g, e.b]
  10141. }
  10142. },
  10143. RGBA_ARRAY: {
  10144. read: function(e) {
  10145. return 4 == e.length && {
  10146. space: "RGB",
  10147. r: e[0],
  10148. g: e[1],
  10149. b: e[2],
  10150. a: e[3]
  10151. }
  10152. },
  10153. write: function(e) {
  10154. return [e.r, e.g, e.b, e.a]
  10155. }
  10156. }
  10157. }
  10158. }, {
  10159. litmus: E.isObject,
  10160. conversions: {
  10161. RGBA_OBJ: {
  10162. read: function(e) {
  10163. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10164. space: "RGB",
  10165. r: e.r,
  10166. g: e.g,
  10167. b: e.b,
  10168. a: e.a
  10169. }
  10170. },
  10171. write: function(e) {
  10172. return {
  10173. r: e.r,
  10174. g: e.g,
  10175. b: e.b,
  10176. a: e.a
  10177. }
  10178. }
  10179. },
  10180. RGB_OBJ: {
  10181. read: function(e) {
  10182. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10183. space: "RGB",
  10184. r: e.r,
  10185. g: e.g,
  10186. b: e.b
  10187. }
  10188. },
  10189. write: function(e) {
  10190. return {
  10191. r: e.r,
  10192. g: e.g,
  10193. b: e.b
  10194. }
  10195. }
  10196. },
  10197. HSVA_OBJ: {
  10198. read: function(e) {
  10199. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10200. space: "HSV",
  10201. h: e.h,
  10202. s: e.s,
  10203. v: e.v,
  10204. a: e.a
  10205. }
  10206. },
  10207. write: function(e) {
  10208. return {
  10209. h: e.h,
  10210. s: e.s,
  10211. v: e.v,
  10212. a: e.a
  10213. }
  10214. }
  10215. },
  10216. HSV_OBJ: {
  10217. read: function(e) {
  10218. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10219. space: "HSV",
  10220. h: e.h,
  10221. s: e.s,
  10222. v: e.v
  10223. }
  10224. },
  10225. write: function(e) {
  10226. return {
  10227. h: e.h,
  10228. s: e.s,
  10229. v: e.v
  10230. }
  10231. }
  10232. }
  10233. }
  10234. }],
  10235. function() {
  10236. b = !1;
  10237. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10238. return E.each(w, function(e) {
  10239. if (e.litmus(i))
  10240. return E.each(e.conversions, function(e, t) {
  10241. if (_ = e.read(i),
  10242. !1 === b && !1 !== _)
  10243. return (b = _).conversionName = t,
  10244. _.conversion = e,
  10245. E.BREAK
  10246. }),
  10247. E.BREAK
  10248. }),
  10249. b
  10250. }
  10251. ),
  10252. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10253. function y(e, t, i, n) {
  10254. if (void 0 === t[i])
  10255. throw new Error("Object " + t + ' has no property "' + i + '"');
  10256. var r;
  10257. if (n.color)
  10258. r = new g(t,i);
  10259. else {
  10260. var o = [t, i].concat(n.factoryArgs);
  10261. r = c.apply(e, o)
  10262. }
  10263. n.before instanceof h && (n.before = n.before.__li),
  10264. C(e, r),
  10265. m.addClass(r.domElement, "c");
  10266. var a = document.createElement("span");
  10267. m.addClass(a, "property-name"),
  10268. a.innerHTML = r.property;
  10269. var s = document.createElement("div");
  10270. s.appendChild(a),
  10271. s.appendChild(r.domElement);
  10272. var l = A(e, s, n.before);
  10273. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10274. m.addClass(l, typeof r.getValue()),
  10275. function(t, i, n) {
  10276. if (n.__li = i,
  10277. n.__gui = t,
  10278. v.extend(n, {
  10279. options: function(e) {
  10280. return 1 < arguments.length ? (n.remove(),
  10281. y(t, n.object, n.property, {
  10282. before: n.__li.nextElementSibling,
  10283. factoryArgs: [v.toArray(arguments)]
  10284. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10285. y(t, n.object, n.property, {
  10286. before: n.__li.nextElementSibling,
  10287. factoryArgs: [e]
  10288. })) : void 0
  10289. },
  10290. name: function(e) {
  10291. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10292. n
  10293. },
  10294. listen: function() {
  10295. return n.__gui.listen(n),
  10296. n
  10297. },
  10298. remove: function() {
  10299. return n.__gui.remove(n),
  10300. n
  10301. }
  10302. }),
  10303. n instanceof f) {
  10304. var r = new p(n.object,n.property,{
  10305. min: n.__min,
  10306. max: n.__max,
  10307. step: n.__step
  10308. });
  10309. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10310. var t = n[e]
  10311. , i = r[e];
  10312. n[e] = r[e] = function() {
  10313. var e = Array.prototype.slice.call(arguments);
  10314. return t.apply(n, e),
  10315. i.apply(r, e)
  10316. }
  10317. }),
  10318. m.addClass(i, "has-slider"),
  10319. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10320. } else if (n instanceof p) {
  10321. var e = function(e) {
  10322. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10323. y(t, n.object, n.property, {
  10324. before: n.__li.nextElementSibling,
  10325. factoryArgs: [n.__min, n.__max, n.__step]
  10326. })) : e
  10327. };
  10328. n.min = v.compose(e, n.min),
  10329. n.max = v.compose(e, n.max)
  10330. } else
  10331. n instanceof u ? (m.bind(i, "click", function() {
  10332. m.fakeEvent(n.__checkbox, "click")
  10333. }),
  10334. m.bind(n.__checkbox, "click", function(e) {
  10335. e.stopPropagation()
  10336. })) : n instanceof d ? (m.bind(i, "click", function() {
  10337. m.fakeEvent(n.__button, "click")
  10338. }),
  10339. m.bind(i, "mouseover", function() {
  10340. m.addClass(n.__button, "hover")
  10341. }),
  10342. m.bind(i, "mouseout", function() {
  10343. m.removeClass(n.__button, "hover")
  10344. })) : n instanceof g && (m.addClass(i, "color"),
  10345. n.updateDisplay = v.compose(function(e) {
  10346. return i.style.borderLeftColor = n.__color.toString(),
  10347. e
  10348. }, n.updateDisplay),
  10349. n.updateDisplay());
  10350. n.setValue = v.compose(function(e) {
  10351. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10352. e
  10353. }, n.setValue)
  10354. }(e, l, r),
  10355. e.__controllers.push(r),
  10356. r
  10357. }
  10358. function A(e, t, i) {
  10359. var n = document.createElement("li");
  10360. return t && n.appendChild(t),
  10361. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10362. e.onResize(),
  10363. n
  10364. }
  10365. function C(e, t) {
  10366. var i = e.getRoot()
  10367. , n = i.__rememberedObjects.indexOf(t.object);
  10368. if (-1 != n) {
  10369. var r = i.__rememberedObjectIndecesToControllers[n];
  10370. if (void 0 === r && (r = {},
  10371. i.__rememberedObjectIndecesToControllers[n] = r),
  10372. r[t.property] = t,
  10373. i.load && i.load.remembered) {
  10374. var o, a = i.load.remembered;
  10375. if (a[e.preset])
  10376. o = a[e.preset];
  10377. else {
  10378. if (!a[T])
  10379. return;
  10380. o = a[T]
  10381. }
  10382. if (o[n] && void 0 !== o[n][t.property]) {
  10383. var s = o[n][t.property];
  10384. t.initialValue = s,
  10385. t.setValue(s)
  10386. }
  10387. }
  10388. }
  10389. }
  10390. function I(e, t) {
  10391. return document.location.href + "." + t
  10392. }
  10393. function l(e, t) {
  10394. e.domElement.style.width = t + "px",
  10395. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10396. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10397. }
  10398. function a(r, o) {
  10399. var a = {};
  10400. return v.each(r.__rememberedObjects, function(e, t) {
  10401. var i = {}
  10402. , n = r.__rememberedObjectIndecesToControllers[t];
  10403. v.each(n, function(e, t) {
  10404. i[t] = o ? e.initialValue : e.getValue()
  10405. }),
  10406. a[t] = i
  10407. }),
  10408. a
  10409. }
  10410. function E(e, t, i) {
  10411. var n = document.createElement("option");
  10412. n.innerHTML = t,
  10413. n.value = t,
  10414. e.__preset_select.appendChild(n),
  10415. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10416. }
  10417. function _(e, t) {
  10418. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10419. i.innerHTML = t ? i.value + "*" : i.value
  10420. }
  10421. 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");
  10422. var b, w, T = "Default", x = function() {
  10423. try {
  10424. return "localStorage"in window && null !== window.localStorage
  10425. } catch (e) {
  10426. return !1
  10427. }
  10428. }(), S = !0, s = !1, M = [], R = function(t) {
  10429. var i = this;
  10430. this.domElement = document.createElement("div"),
  10431. this.__ul = document.createElement("ul"),
  10432. this.domElement.appendChild(this.__ul),
  10433. m.addClass(this.domElement, "dg"),
  10434. this.__folders = {},
  10435. this.__controllers = [],
  10436. this.__rememberedObjects = [],
  10437. this.__rememberedObjectIndecesToControllers = [],
  10438. this.__listening = [],
  10439. t = t || {},
  10440. t = v.defaults(t, {
  10441. autoPlace: !0,
  10442. width: R.DEFAULT_WIDTH
  10443. }),
  10444. t = v.defaults(t, {
  10445. resizable: t.autoPlace,
  10446. hideable: t.autoPlace
  10447. }),
  10448. v.isUndefined(t.load) ? t.load = {
  10449. preset: T
  10450. } : t.preset && (t.load.preset = t.preset),
  10451. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10452. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10453. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10454. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10455. if (Object.defineProperties(this, {
  10456. parent: {
  10457. get: function() {
  10458. return t.parent
  10459. }
  10460. },
  10461. scrollable: {
  10462. get: function() {
  10463. return t.scrollable
  10464. }
  10465. },
  10466. autoPlace: {
  10467. get: function() {
  10468. return t.autoPlace
  10469. }
  10470. },
  10471. preset: {
  10472. get: function() {
  10473. return i.parent ? i.getRoot().preset : t.load.preset
  10474. },
  10475. set: function(e) {
  10476. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10477. function(e) {
  10478. for (var t = 0; t < e.__preset_select.length; t++)
  10479. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10480. }(this),
  10481. i.revert()
  10482. }
  10483. },
  10484. width: {
  10485. get: function() {
  10486. return t.width
  10487. },
  10488. set: function(e) {
  10489. t.width = e,
  10490. l(i, e)
  10491. }
  10492. },
  10493. name: {
  10494. get: function() {
  10495. return t.name
  10496. },
  10497. set: function(e) {
  10498. t.name = e,
  10499. a && (a.innerHTML = t.name)
  10500. }
  10501. },
  10502. closed: {
  10503. get: function() {
  10504. return t.closed
  10505. },
  10506. set: function(e) {
  10507. t.closed = e,
  10508. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10509. this.onResize(),
  10510. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10511. }
  10512. },
  10513. load: {
  10514. get: function() {
  10515. return t.load
  10516. }
  10517. },
  10518. useLocalStorage: {
  10519. get: function() {
  10520. return r
  10521. },
  10522. set: function(e) {
  10523. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10524. localStorage.setItem(I(0, "isLocal"), e))
  10525. }
  10526. }
  10527. }),
  10528. v.isUndefined(t.parent)) {
  10529. if (t.closed = !1,
  10530. m.addClass(this.domElement, R.CLASS_MAIN),
  10531. m.makeSelectable(this.domElement, !1),
  10532. x && r) {
  10533. i.useLocalStorage = !0;
  10534. var o = localStorage.getItem(I(0, "gui"));
  10535. o && (t.load = JSON.parse(o))
  10536. }
  10537. this.__closeButton = document.createElement("div"),
  10538. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10539. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10540. this.domElement.appendChild(this.__closeButton),
  10541. m.bind(this.__closeButton, "click", function() {
  10542. i.closed = !i.closed
  10543. })
  10544. } else {
  10545. void 0 === t.closed && (t.closed = !0);
  10546. var a = document.createTextNode(t.name);
  10547. m.addClass(a, "controller-name");
  10548. var s = A(i, a);
  10549. m.addClass(this.__ul, R.CLASS_CLOSED),
  10550. m.addClass(s, "title"),
  10551. m.bind(s, "click", function(e) {
  10552. return e.preventDefault(),
  10553. i.closed = !i.closed,
  10554. !1
  10555. }),
  10556. t.closed || (this.closed = !1)
  10557. }
  10558. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10559. m.addClass(w, "dg"),
  10560. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10561. document.body.appendChild(w),
  10562. S = !1),
  10563. w.appendChild(this.domElement),
  10564. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10565. this.parent || l(i, t.width)),
  10566. m.bind(window, "resize", function() {
  10567. i.onResize()
  10568. }),
  10569. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10570. i.onResize()
  10571. }),
  10572. m.bind(this.__ul, "transitionend", function() {
  10573. i.onResize()
  10574. }),
  10575. m.bind(this.__ul, "oTransitionEnd", function() {
  10576. i.onResize()
  10577. }),
  10578. this.onResize(),
  10579. t.resizable && function(t) {
  10580. function e(e) {
  10581. return e.preventDefault(),
  10582. r = e.clientX,
  10583. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10584. m.bind(window, "mousemove", i),
  10585. m.bind(window, "mouseup", n),
  10586. !1
  10587. }
  10588. function i(e) {
  10589. return e.preventDefault(),
  10590. t.width += r - e.clientX,
  10591. t.onResize(),
  10592. r = e.clientX,
  10593. !1
  10594. }
  10595. function n() {
  10596. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10597. m.unbind(window, "mousemove", i),
  10598. m.unbind(window, "mouseup", n)
  10599. }
  10600. var r;
  10601. t.__resize_handle = document.createElement("div"),
  10602. v.extend(t.__resize_handle.style, {
  10603. width: "6px",
  10604. marginLeft: "-3px",
  10605. height: "200px",
  10606. cursor: "ew-resize",
  10607. position: "absolute"
  10608. }),
  10609. m.bind(t.__resize_handle, "mousedown", e),
  10610. m.bind(t.__closeButton, "mousedown", e),
  10611. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10612. }(this),
  10613. n = function() {
  10614. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10615. }
  10616. ,
  10617. this.saveToLocalStorageIfPossible = n,
  10618. i.getRoot(),
  10619. t.parent || ((e = i.getRoot()).width += 1,
  10620. v.defer(function() {
  10621. e.width -= 1
  10622. }))
  10623. };
  10624. return R.toggleHide = function() {
  10625. s = !s,
  10626. v.each(M, function(e) {
  10627. e.domElement.style.zIndex = s ? -999 : 999,
  10628. e.domElement.style.opacity = s ? 0 : 1
  10629. })
  10630. }
  10631. ,
  10632. R.CLASS_AUTO_PLACE = "a",
  10633. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10634. R.CLASS_MAIN = "main",
  10635. R.CLASS_CONTROLLER_ROW = "cr",
  10636. R.CLASS_TOO_TALL = "taller-than-window",
  10637. R.CLASS_CLOSED = "closed",
  10638. R.CLASS_CLOSE_BUTTON = "close-button",
  10639. R.CLASS_DRAG = "drag",
  10640. R.DEFAULT_WIDTH = 245,
  10641. R.TEXT_CLOSED = "Close Controls",
  10642. R.TEXT_OPEN = "Open Controls",
  10643. m.bind(window, "keydown", function(e) {
  10644. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10645. }, !1),
  10646. v.extend(R.prototype, {
  10647. add: function(e, t) {
  10648. return y(this, e, t, {
  10649. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10650. })
  10651. },
  10652. addColor: function(e, t) {
  10653. return y(this, e, t, {
  10654. color: !0
  10655. })
  10656. },
  10657. remove: function(e) {
  10658. this.__ul.removeChild(e.__li),
  10659. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10660. var t = this;
  10661. v.defer(function() {
  10662. t.onResize()
  10663. })
  10664. },
  10665. destroy: function() {
  10666. this.autoPlace && w.removeChild(this.domElement)
  10667. },
  10668. addFolder: function(e) {
  10669. if (void 0 !== this.__folders[e])
  10670. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10671. var t = {
  10672. name: e,
  10673. parent: this
  10674. };
  10675. t.autoPlace = this.autoPlace,
  10676. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10677. t.load = this.load.folders[e]);
  10678. var i = new R(t);
  10679. this.__folders[e] = i;
  10680. var n = A(this, i.domElement);
  10681. return m.addClass(n, "folder"),
  10682. i
  10683. },
  10684. open: function() {
  10685. this.closed = !1
  10686. },
  10687. close: function() {
  10688. this.closed = !0
  10689. },
  10690. onResize: function() {
  10691. var t = this.getRoot();
  10692. if (t.scrollable) {
  10693. var e = m.getOffset(t.__ul).top
  10694. , i = 0;
  10695. v.each(t.__ul.childNodes, function(e) {
  10696. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10697. }),
  10698. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10699. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10700. t.__ul.style.height = "auto")
  10701. }
  10702. t.__resize_handle && v.defer(function() {
  10703. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10704. }),
  10705. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10706. },
  10707. remember: function() {
  10708. 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>'),
  10709. this.parent)
  10710. throw new Error("You can only call remember on a top level GUI.");
  10711. var t = this;
  10712. v.each(Array.prototype.slice.call(arguments), function(e) {
  10713. 0 == t.__rememberedObjects.length && function(i) {
  10714. var e = i.__save_row = document.createElement("li");
  10715. m.addClass(i.domElement, "has-save"),
  10716. i.__ul.insertBefore(e, i.__ul.firstChild),
  10717. m.addClass(e, "save-row");
  10718. var t = document.createElement("span");
  10719. t.innerHTML = "&nbsp;",
  10720. m.addClass(t, "button gears");
  10721. var n = document.createElement("span");
  10722. n.innerHTML = "Save",
  10723. m.addClass(n, "button"),
  10724. m.addClass(n, "save");
  10725. var r = document.createElement("span");
  10726. r.innerHTML = "New",
  10727. m.addClass(r, "button"),
  10728. m.addClass(r, "save-as");
  10729. var o = document.createElement("span");
  10730. o.innerHTML = "Revert",
  10731. m.addClass(o, "button"),
  10732. m.addClass(o, "revert");
  10733. var a = i.__preset_select = document.createElement("select");
  10734. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10735. E(i, t, t == i.preset)
  10736. }) : E(i, T, !1),
  10737. m.bind(a, "change", function() {
  10738. for (var e = 0; e < i.__preset_select.length; e++)
  10739. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10740. i.preset = this.value
  10741. }),
  10742. e.appendChild(a),
  10743. e.appendChild(t),
  10744. e.appendChild(n),
  10745. e.appendChild(r),
  10746. e.appendChild(o),
  10747. x) {
  10748. var s = document.getElementById("dg-save-locally")
  10749. , l = document.getElementById("dg-local-explain");
  10750. s.style.display = "block";
  10751. var c = document.getElementById("dg-local-storage");
  10752. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10753. var h = function() {
  10754. l.style.display = i.useLocalStorage ? "block" : "none"
  10755. };
  10756. h(),
  10757. m.bind(c, "change", function() {
  10758. i.useLocalStorage = !i.useLocalStorage,
  10759. h()
  10760. })
  10761. }
  10762. var u = document.getElementById("dg-new-constructor");
  10763. m.bind(u, "keydown", function(e) {
  10764. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10765. }),
  10766. m.bind(t, "click", function() {
  10767. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10768. b.show(),
  10769. u.focus(),
  10770. u.select()
  10771. }),
  10772. m.bind(n, "click", function() {
  10773. i.save()
  10774. }),
  10775. m.bind(r, "click", function() {
  10776. var e = prompt("Enter a new preset name.");
  10777. e && i.saveAs(e)
  10778. }),
  10779. m.bind(o, "click", function() {
  10780. i.revert()
  10781. })
  10782. }(t),
  10783. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10784. }),
  10785. this.autoPlace && l(this, this.width)
  10786. },
  10787. getRoot: function() {
  10788. for (var e = this; e.parent; )
  10789. e = e.parent;
  10790. return e
  10791. },
  10792. getSaveObject: function() {
  10793. var i = this.load;
  10794. return i.closed = this.closed,
  10795. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10796. i.remembered || (i.remembered = {}),
  10797. i.remembered[this.preset] = a(this)),
  10798. i.folders = {},
  10799. v.each(this.__folders, function(e, t) {
  10800. i.folders[t] = e.getSaveObject()
  10801. }),
  10802. i
  10803. },
  10804. save: function() {
  10805. this.load.remembered || (this.load.remembered = {}),
  10806. this.load.remembered[this.preset] = a(this),
  10807. _(this, !1),
  10808. this.saveToLocalStorageIfPossible()
  10809. },
  10810. saveAs: function(e) {
  10811. this.load.remembered || (this.load.remembered = {},
  10812. this.load.remembered[T] = a(this, !0)),
  10813. this.load.remembered[e] = a(this),
  10814. this.preset = e,
  10815. E(this, e, !0),
  10816. this.saveToLocalStorageIfPossible()
  10817. },
  10818. revert: function(t) {
  10819. v.each(this.__controllers, function(e) {
  10820. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10821. }, this),
  10822. v.each(this.__folders, function(e) {
  10823. e.revert(e)
  10824. }),
  10825. t || _(this.getRoot(), !1)
  10826. },
  10827. listen: function(e) {
  10828. var t = 0 == this.__listening.length;
  10829. this.__listening.push(e),
  10830. t && function e(t) {
  10831. 0 != t.length && r(function() {
  10832. e(t)
  10833. }),
  10834. v.each(t, function(e) {
  10835. e.updateDisplay()
  10836. })
  10837. }(this.__listening)
  10838. }
  10839. }),
  10840. R
  10841. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10842. u = ee.controllers.NumberControllerBox,
  10843. d = ee.controllers.NumberControllerSlider,
  10844. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10845. y = ee.dom.dom,
  10846. A = ee.utils.common,
  10847. (C = function(e, t) {
  10848. function i() {
  10849. n.setValue(n.__input.value)
  10850. }
  10851. C.superclass.call(this, e, t);
  10852. var n = this;
  10853. this.__input = document.createElement("input"),
  10854. this.__input.setAttribute("type", "text"),
  10855. y.bind(this.__input, "keyup", i),
  10856. y.bind(this.__input, "change", i),
  10857. y.bind(this.__input, "blur", function() {
  10858. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10859. }),
  10860. y.bind(this.__input, "keydown", function(e) {
  10861. 13 === e.keyCode && this.blur()
  10862. }),
  10863. this.updateDisplay(),
  10864. this.domElement.appendChild(this.__input)
  10865. }
  10866. ).superclass = v,
  10867. A.extend(C.prototype, v.prototype, {
  10868. updateDisplay: function() {
  10869. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10870. C.superclass.prototype.updateDisplay.call(this)
  10871. }
  10872. }),
  10873. C),
  10874. f = ee.controllers.FunctionController,
  10875. g = ee.controllers.BooleanController,
  10876. m = ee.utils.common,
  10877. function(e, t) {
  10878. var i = e[t];
  10879. 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,{
  10880. min: arguments[2],
  10881. max: arguments[3]
  10882. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10883. }
  10884. ), 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) {
  10885. function f(t, i, n, r) {
  10886. t.style.background = "",
  10887. p.each(o, function(e) {
  10888. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10889. })
  10890. }
  10891. var g = function(e, t) {
  10892. function i(e) {
  10893. a(e),
  10894. h.bind(window, "mousemove", a),
  10895. h.bind(window, "mouseup", n)
  10896. }
  10897. function n() {
  10898. h.unbind(window, "mousemove", a),
  10899. h.unbind(window, "mouseup", n)
  10900. }
  10901. function r() {
  10902. var e = d(this.value);
  10903. !1 !== e ? (l.__color.__state = e,
  10904. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10905. }
  10906. function o() {
  10907. h.unbind(window, "mousemove", s),
  10908. h.unbind(window, "mouseup", o)
  10909. }
  10910. function a(e) {
  10911. e.preventDefault();
  10912. var t = h.getWidth(l.__saturation_field)
  10913. , i = h.getOffset(l.__saturation_field)
  10914. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10915. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10916. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10917. 1 < n ? n = 1 : n < 0 && (n = 0),
  10918. l.__color.v = r,
  10919. l.__color.s = n,
  10920. l.setValue(l.__color.toOriginal()),
  10921. !1
  10922. }
  10923. function s(e) {
  10924. e.preventDefault();
  10925. var t = h.getHeight(l.__hue_field)
  10926. , i = h.getOffset(l.__hue_field)
  10927. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10928. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10929. l.__color.h = 360 * n,
  10930. l.setValue(l.__color.toOriginal()),
  10931. !1
  10932. }
  10933. g.superclass.call(this, e, t),
  10934. this.__color = new u(this.getValue()),
  10935. this.__temp = new u(0);
  10936. var l = this;
  10937. this.domElement = document.createElement("div"),
  10938. h.makeSelectable(this.domElement, !1),
  10939. this.__selector = document.createElement("div"),
  10940. this.__selector.className = "selector",
  10941. this.__saturation_field = document.createElement("div"),
  10942. this.__saturation_field.className = "saturation-field",
  10943. this.__field_knob = document.createElement("div"),
  10944. this.__field_knob.className = "field-knob",
  10945. this.__field_knob_border = "2px solid ",
  10946. this.__hue_knob = document.createElement("div"),
  10947. this.__hue_knob.className = "hue-knob",
  10948. this.__hue_field = document.createElement("div"),
  10949. this.__hue_field.className = "hue-field",
  10950. this.__input = document.createElement("input"),
  10951. this.__input.type = "text",
  10952. this.__input_textShadow = "0 1px 1px ",
  10953. h.bind(this.__input, "keydown", function(e) {
  10954. 13 === e.keyCode && r.call(this)
  10955. }),
  10956. h.bind(this.__input, "blur", r),
  10957. h.bind(this.__selector, "mousedown", function(e) {
  10958. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10959. h.removeClass(l.__selector, "drag")
  10960. })
  10961. });
  10962. var c = document.createElement("div");
  10963. p.extend(this.__selector.style, {
  10964. width: "122px",
  10965. height: "102px",
  10966. padding: "3px",
  10967. backgroundColor: "#222",
  10968. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10969. }),
  10970. p.extend(this.__field_knob.style, {
  10971. position: "absolute",
  10972. width: "12px",
  10973. height: "12px",
  10974. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10975. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10976. borderRadius: "12px",
  10977. zIndex: 1
  10978. }),
  10979. p.extend(this.__hue_knob.style, {
  10980. position: "absolute",
  10981. width: "15px",
  10982. height: "2px",
  10983. borderRight: "4px solid #fff",
  10984. zIndex: 1
  10985. }),
  10986. p.extend(this.__saturation_field.style, {
  10987. width: "100px",
  10988. height: "100px",
  10989. border: "1px solid #555",
  10990. marginRight: "3px",
  10991. display: "inline-block",
  10992. cursor: "pointer"
  10993. }),
  10994. p.extend(c.style, {
  10995. width: "100%",
  10996. height: "100%",
  10997. background: "none"
  10998. }),
  10999. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11000. p.extend(this.__hue_field.style, {
  11001. width: "15px",
  11002. height: "100px",
  11003. display: "inline-block",
  11004. border: "1px solid #555",
  11005. cursor: "ns-resize"
  11006. }),
  11007. function(e) {
  11008. e.style.background = "",
  11009. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11010. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11011. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11012. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11013. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11014. }(this.__hue_field),
  11015. p.extend(this.__input.style, {
  11016. outline: "none",
  11017. textAlign: "center",
  11018. color: "#fff",
  11019. border: 0,
  11020. fontWeight: "bold",
  11021. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11022. }),
  11023. h.bind(this.__saturation_field, "mousedown", i),
  11024. h.bind(this.__field_knob, "mousedown", i),
  11025. h.bind(this.__hue_field, "mousedown", function(e) {
  11026. s(e),
  11027. h.bind(window, "mousemove", s),
  11028. h.bind(window, "mouseup", o)
  11029. }),
  11030. this.__saturation_field.appendChild(c),
  11031. this.__selector.appendChild(this.__field_knob),
  11032. this.__selector.appendChild(this.__saturation_field),
  11033. this.__selector.appendChild(this.__hue_field),
  11034. this.__hue_field.appendChild(this.__hue_knob),
  11035. this.domElement.appendChild(this.__input),
  11036. this.domElement.appendChild(this.__selector),
  11037. this.updateDisplay()
  11038. };
  11039. g.superclass = e,
  11040. p.extend(g.prototype, e.prototype, {
  11041. updateDisplay: function() {
  11042. var t = d(this.getValue());
  11043. if (!1 !== t) {
  11044. var i = !1;
  11045. p.each(u.COMPONENTS, function(e) {
  11046. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11047. return i = !0,
  11048. {}
  11049. }, this),
  11050. i && p.extend(this.__color.__state, t)
  11051. }
  11052. p.extend(this.__temp.__state, this.__color.__state),
  11053. this.__temp.a = 1;
  11054. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11055. , n = 255 - e;
  11056. p.extend(this.__field_knob.style, {
  11057. marginLeft: 100 * this.__color.s - 7 + "px",
  11058. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11059. backgroundColor: this.__temp.toString(),
  11060. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11061. }),
  11062. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11063. this.__temp.s = 1,
  11064. this.__temp.v = 1,
  11065. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11066. p.extend(this.__input.style, {
  11067. backgroundColor: this.__input.value = this.__color.toString(),
  11068. color: "rgb(" + e + "," + e + "," + e + ")",
  11069. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11070. })
  11071. }
  11072. });
  11073. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11074. return g
  11075. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11076. a = ee.color.math = {
  11077. hsv_to_rgb: function(e, t, i) {
  11078. var n = Math.floor(e / 60) % 6
  11079. , r = e / 60 - Math.floor(e / 60)
  11080. , o = i * (1 - t)
  11081. , a = i * (1 - r * t)
  11082. , s = i * (1 - (1 - r) * t)
  11083. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11084. return {
  11085. r: 255 * l[0],
  11086. g: 255 * l[1],
  11087. b: 255 * l[2]
  11088. }
  11089. },
  11090. rgb_to_hsv: function(e, t, i) {
  11091. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11092. return 0 == o ? {
  11093. h: NaN,
  11094. s: 0,
  11095. v: 0
  11096. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11097. (n /= 6) < 0 && (n += 1),
  11098. {
  11099. h: 360 * n,
  11100. s: a / o,
  11101. v: o / 255
  11102. })
  11103. },
  11104. rgb_to_hex: function(e, t, i) {
  11105. var n = this.hex_with_component(0, 2, e);
  11106. return n = this.hex_with_component(n, 1, t),
  11107. this.hex_with_component(n, 0, i)
  11108. },
  11109. component_from_hex: function(e, t) {
  11110. return e >> 8 * t & 255
  11111. },
  11112. hex_with_component: function(e, t, i) {
  11113. return i << (c = 8 * t) | e & ~(255 << c)
  11114. }
  11115. },
  11116. s = ee.color.toString,
  11117. l = ee.utils.common,
  11118. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11119. l.extend(ae.prototype, {
  11120. toString: function() {
  11121. return s(this)
  11122. },
  11123. toOriginal: function() {
  11124. return this.__state.conversion.write(this)
  11125. }
  11126. }),
  11127. ie(ae.prototype, "r", 2),
  11128. ie(ae.prototype, "g", 1),
  11129. ie(ae.prototype, "b", 0),
  11130. ne(ae.prototype, "h"),
  11131. ne(ae.prototype, "s"),
  11132. ne(ae.prototype, "v"),
  11133. Object.defineProperty(ae.prototype, "a", {
  11134. get: function() {
  11135. return this.__state.a
  11136. },
  11137. set: function(e) {
  11138. this.__state.a = e
  11139. }
  11140. }),
  11141. Object.defineProperty(ae.prototype, "hex", {
  11142. get: function() {
  11143. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11144. this.__state.hex
  11145. },
  11146. set: function(e) {
  11147. this.__state.space = "HEX",
  11148. this.__state.hex = e
  11149. }
  11150. }),
  11151. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11152. window.setTimeout(e, 1e3 / 60)
  11153. }
  11154. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11155. r = ee.utils.common,
  11156. te.prototype.show = function() {
  11157. var e = this;
  11158. this.backgroundElement.style.display = "block",
  11159. this.domElement.style.display = "block",
  11160. this.domElement.style.opacity = 0,
  11161. this.domElement.style.webkitTransform = "scale(1.1)",
  11162. this.layout(),
  11163. r.defer(function() {
  11164. e.backgroundElement.style.opacity = 1,
  11165. e.domElement.style.opacity = 1,
  11166. e.domElement.style.webkitTransform = "scale(1)"
  11167. })
  11168. }
  11169. ,
  11170. te.prototype.hide = function() {
  11171. var e = this
  11172. , t = function() {
  11173. e.domElement.style.display = "none",
  11174. e.backgroundElement.style.display = "none",
  11175. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11176. n.unbind(e.domElement, "transitionend", t),
  11177. n.unbind(e.domElement, "oTransitionEnd", t)
  11178. };
  11179. n.bind(this.domElement, "webkitTransitionEnd", t),
  11180. n.bind(this.domElement, "transitionend", t),
  11181. n.bind(this.domElement, "oTransitionEnd", t),
  11182. this.backgroundElement.style.opacity = 0,
  11183. this.domElement.style.opacity = 0,
  11184. this.domElement.style.webkitTransform = "scale(1.1)"
  11185. }
  11186. ,
  11187. te.prototype.layout = function() {
  11188. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11189. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11190. }
  11191. ,
  11192. te), ee.dom.dom, ee.utils.common)
  11193. }
  11194. , {}],
  11195. 94: [function(e, t, i) {
  11196. (function(J) {
  11197. "use strict";
  11198. function i(e) {
  11199. function t(e, t) {
  11200. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11201. for (var a = 1; a <= e[o]; a++)
  11202. r[t[n]] = [],
  11203. r[t[n]][0] = i,
  11204. r[t[n]][1] = o,
  11205. n++,
  11206. i++;
  11207. i *= 2
  11208. }
  11209. return r
  11210. }
  11211. function _(e) {
  11212. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11213. t & 1 << i && (B |= 1 << V),
  11214. i--,
  11215. --V < 0 && (255 == B ? (b(255),
  11216. b(0)) : b(B),
  11217. V = 7,
  11218. B = 0)
  11219. }
  11220. function b(e) {
  11221. F.push(e)
  11222. }
  11223. function w(e) {
  11224. b(e >> 8 & 255),
  11225. b(255 & e)
  11226. }
  11227. function T(e, t, i, n, r) {
  11228. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11229. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11230. for (h = 0; h < 8; ++h) {
  11231. i = e[d],
  11232. n = e[d + 1],
  11233. r = e[d + 2],
  11234. o = e[d + 3],
  11235. a = e[d + 4],
  11236. s = e[d + 5],
  11237. l = e[d + 6];
  11238. var p = i + (c = e[d + 7])
  11239. , f = i - c
  11240. , g = n + l
  11241. , m = n - l
  11242. , v = r + s
  11243. , y = r - s
  11244. , A = o + a
  11245. , C = o - a
  11246. , I = p + A
  11247. , E = p - A
  11248. , _ = g + v
  11249. , b = g - v;
  11250. e[d] = I + _,
  11251. e[d + 4] = I - _;
  11252. var w = .707106781 * (b + E);
  11253. e[d + 2] = E + w,
  11254. e[d + 6] = E - w;
  11255. var T = .382683433 * ((I = C + y) - (b = m + f))
  11256. , x = .5411961 * I + T
  11257. , S = 1.306562965 * b + T
  11258. , M = .707106781 * (_ = y + m)
  11259. , R = f + M
  11260. , P = f - M;
  11261. e[d + 5] = P + x,
  11262. e[d + 3] = P - x,
  11263. e[d + 1] = R + S,
  11264. e[d + 7] = R - S,
  11265. d += 8
  11266. }
  11267. for (h = d = 0; h < 8; ++h) {
  11268. i = e[d],
  11269. n = e[d + 8],
  11270. r = e[d + 16],
  11271. o = e[d + 24],
  11272. a = e[d + 32],
  11273. s = e[d + 40],
  11274. l = e[d + 48];
  11275. var O = i + (c = e[d + 56])
  11276. , L = i - c
  11277. , D = n + l
  11278. , N = n - l
  11279. , F = r + s
  11280. , B = r - s
  11281. , V = o + a
  11282. , k = o - a
  11283. , U = O + V
  11284. , H = O - V
  11285. , z = D + F
  11286. , G = D - F;
  11287. e[d] = U + z,
  11288. e[d + 32] = U - z;
  11289. var W = .707106781 * (G + H);
  11290. e[d + 16] = H + W,
  11291. e[d + 48] = H - W;
  11292. var j = .382683433 * ((U = k + B) - (G = N + L))
  11293. , Y = .5411961 * U + j
  11294. , q = 1.306562965 * G + j
  11295. , X = .707106781 * (z = B + N)
  11296. , Z = L + X
  11297. , K = L - X;
  11298. e[d + 40] = K + Y,
  11299. e[d + 24] = K - Y,
  11300. e[d + 8] = Z + q,
  11301. e[d + 56] = Z - q,
  11302. d++
  11303. }
  11304. for (h = 0; h < 64; ++h)
  11305. u = e[h] * t[h],
  11306. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11307. return Q
  11308. }(e, t), c = 0; c < 64; ++c)
  11309. A[C[c]] = l[c];
  11310. var h = A[0] - i;
  11311. i = A[0],
  11312. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11313. _(v[o]));
  11314. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11315. ;
  11316. if (0 == u)
  11317. return _(a),
  11318. i;
  11319. for (var d, p = 1; p <= u; ) {
  11320. for (var f = p; 0 == A[p] && p <= u; ++p)
  11321. ;
  11322. var g = p - f;
  11323. if (16 <= g) {
  11324. d = g >> 4;
  11325. for (var m = 1; m <= d; ++m)
  11326. _(s);
  11327. g &= 15
  11328. }
  11329. o = 32767 + A[p],
  11330. _(r[(g << 4) + y[o]]),
  11331. _(v[o]),
  11332. p++
  11333. }
  11334. return 63 != u && _(a),
  11335. i
  11336. }
  11337. function x(e) {
  11338. if (e <= 0 && (e = 1),
  11339. 100 < e && (e = 100),
  11340. i != e) {
  11341. (function(e) {
  11342. 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++) {
  11343. var n = u((t[i] * e + 50) / 100);
  11344. n < 1 ? n = 1 : 255 < n && (n = 255),
  11345. O[C[i]] = n
  11346. }
  11347. 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++) {
  11348. var a = u((r[o] * e + 50) / 100);
  11349. a < 1 ? a = 1 : 255 < a && (a = 255),
  11350. L[C[o]] = a
  11351. }
  11352. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11353. for (var h = 0; h < 8; h++)
  11354. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11355. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11356. l++
  11357. }
  11358. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11359. i = e
  11360. }
  11361. }
  11362. var S, M, R, P, i, u = (Math.round,
  11363. 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];
  11364. this.encode = function(e, t) {
  11365. var i = ((new Date).getTime(),
  11366. t.quality);
  11367. i && x(i),
  11368. F = new Array,
  11369. B = 0,
  11370. V = 7,
  11371. w(65496),
  11372. w(65504),
  11373. w(16),
  11374. b(74),
  11375. b(70),
  11376. b(73),
  11377. b(70),
  11378. b(0),
  11379. b(1),
  11380. b(1),
  11381. b(0),
  11382. w(1),
  11383. w(1),
  11384. b(0),
  11385. b(0),
  11386. function() {
  11387. w(65499),
  11388. w(132),
  11389. b(0);
  11390. for (var e = 0; e < 64; e++)
  11391. b(O[e]);
  11392. b(1);
  11393. for (var t = 0; t < 64; t++)
  11394. b(L[t])
  11395. }(),
  11396. function(e, t) {
  11397. w(65472),
  11398. w(17),
  11399. b(8),
  11400. w(t),
  11401. w(e),
  11402. b(3),
  11403. b(1),
  11404. b(17),
  11405. b(0),
  11406. b(2),
  11407. b(17),
  11408. b(1),
  11409. b(3),
  11410. b(17),
  11411. b(1)
  11412. }(e.width, e.height),
  11413. function() {
  11414. w(65476),
  11415. w(418),
  11416. b(0);
  11417. for (var e = 0; e < 16; e++)
  11418. b(G[e + 1]);
  11419. for (var t = 0; t <= 11; t++)
  11420. b(W[t]);
  11421. b(16);
  11422. for (var i = 0; i < 16; i++)
  11423. b(j[i + 1]);
  11424. for (var n = 0; n <= 161; n++)
  11425. b(Y[n]);
  11426. b(1);
  11427. for (var r = 0; r < 16; r++)
  11428. b(q[r + 1]);
  11429. for (var o = 0; o <= 11; o++)
  11430. b(X[o]);
  11431. b(17);
  11432. for (var a = 0; a < 16; a++)
  11433. b(Z[a + 1]);
  11434. for (var s = 0; s <= 161; s++)
  11435. b(K[s])
  11436. }(),
  11437. w(65498),
  11438. w(12),
  11439. b(3),
  11440. b(1),
  11441. b(0),
  11442. b(2),
  11443. b(17),
  11444. b(3),
  11445. b(17),
  11446. b(0),
  11447. b(63),
  11448. b(0);
  11449. var n = 0
  11450. , r = 0
  11451. , o = 0;
  11452. B = 0,
  11453. V = 7,
  11454. this.encode.displayName = "_encode_";
  11455. 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; ) {
  11456. for (a = 0; a < A; ) {
  11457. for (u = h = A * C + a,
  11458. d = -1,
  11459. f = p = 0; f < 64; f++)
  11460. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11461. v <= C + p && (u -= A * (C + 1 + p - v)),
  11462. A <= a + d && (u -= a + d - A + 4),
  11463. s = g[u++],
  11464. l = g[u++],
  11465. c = g[u++],
  11466. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11467. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11468. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11469. n = T(k, D, n, S, R),
  11470. r = T(U, N, r, M, P),
  11471. o = T(H, N, o, M, P),
  11472. a += 32
  11473. }
  11474. C += I
  11475. }
  11476. if (0 <= V) {
  11477. var E = [];
  11478. E[1] = V + 1,
  11479. E[0] = (1 << V + 1) - 1,
  11480. _(E)
  11481. }
  11482. return w(65497),
  11483. new J(F)
  11484. }
  11485. ,
  11486. (new Date).getTime(),
  11487. e = e || 50,
  11488. function() {
  11489. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11490. n[t] = e(t)
  11491. }(),
  11492. S = t(G, W),
  11493. M = t(q, X),
  11494. R = t(j, Y),
  11495. P = t(Z, K),
  11496. function() {
  11497. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11498. for (var n = e; n < t; n++)
  11499. y[32767 + n] = i,
  11500. v[32767 + n] = [],
  11501. v[32767 + n][1] = i,
  11502. v[32767 + n][0] = n;
  11503. for (var r = -(t - 1); r <= -e; r++)
  11504. y[32767 + r] = i,
  11505. v[32767 + r] = [],
  11506. v[32767 + r][1] = i,
  11507. v[32767 + r][0] = t - 1 + r;
  11508. e <<= 1,
  11509. t <<= 1
  11510. }
  11511. }(),
  11512. function() {
  11513. for (var e = 0; e < 256; e++)
  11514. z[e] = 19595 * e,
  11515. z[e + 256 >> 0] = 38470 * e,
  11516. z[e + 512 >> 0] = 7471 * e + 32768,
  11517. z[e + 768 >> 0] = -11059 * e,
  11518. z[e + 1024 >> 0] = -21709 * e,
  11519. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11520. z[e + 1536 >> 0] = -27439 * e,
  11521. z[e + 1792 >> 0] = -5329 * e
  11522. }(),
  11523. x(e),
  11524. (new Date).getTime()
  11525. }
  11526. t.exports.encode = function(e, t) {
  11527. return (t = t || {}).quality = t.quality || 50,
  11528. {
  11529. data: new i(t.quality).encode(e, t),
  11530. width: e.width,
  11531. height: e.height
  11532. }
  11533. }
  11534. }
  11535. ).call(this, e("buffer").Buffer)
  11536. }
  11537. , {
  11538. buffer: 198
  11539. }],
  11540. 95: [function(e, t, i) {
  11541. "use strict";
  11542. !function() {
  11543. if ("performance"in window == 0 && (window.performance = {}),
  11544. Date.now = Date.now || function() {
  11545. return (new Date).getTime()
  11546. }
  11547. ,
  11548. "now"in window.performance == 0) {
  11549. var e = Date.now();
  11550. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11551. window.performance.now = function() {
  11552. return Date.now() - e
  11553. }
  11554. }
  11555. }()
  11556. }
  11557. , {}],
  11558. 96: [function(e, t, i) {
  11559. "use strict";
  11560. var a = e("three");
  11561. a.EffectComposer = function(e, t) {
  11562. if (this.renderer = e,
  11563. void 0 === t) {
  11564. var i = {
  11565. minFilter: a.LinearFilter,
  11566. magFilter: a.LinearFilter,
  11567. format: a.RGBAFormat,
  11568. stencilBuffer: !1
  11569. }
  11570. , n = e.getSize();
  11571. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11572. }
  11573. this.renderTarget1 = t,
  11574. this.renderTarget2 = t.clone(),
  11575. this.writeBuffer = this.renderTarget1,
  11576. this.readBuffer = this.renderTarget2,
  11577. this.passes = [],
  11578. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11579. this.copyPass = new a.ShaderPass(a.CopyShader)
  11580. }
  11581. ,
  11582. a.EffectComposer.prototype = {
  11583. swapBuffers: function() {
  11584. var e = this.readBuffer;
  11585. this.readBuffer = this.writeBuffer,
  11586. this.writeBuffer = e
  11587. },
  11588. addPass: function(e) {
  11589. this.passes.push(e)
  11590. },
  11591. insertPass: function(e, t) {
  11592. this.passes.splice(t, 0, e)
  11593. },
  11594. render: function(e) {
  11595. this.writeBuffer = this.renderTarget1,
  11596. this.readBuffer = this.renderTarget2;
  11597. var t, i, n = !1, r = this.passes.length;
  11598. for (i = 0; i < r; i++)
  11599. if ((t = this.passes[i]).enabled) {
  11600. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11601. t.needsSwap) {
  11602. if (n) {
  11603. var o = this.renderer.context;
  11604. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11605. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11606. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11607. }
  11608. this.swapBuffers()
  11609. }
  11610. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11611. }
  11612. },
  11613. reset: function(e) {
  11614. if (void 0 === e) {
  11615. var t = this.renderer.getSize();
  11616. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11617. }
  11618. this.renderTarget1.dispose(),
  11619. this.renderTarget2.dispose(),
  11620. this.renderTarget1 = e,
  11621. this.renderTarget2 = e.clone(),
  11622. this.writeBuffer = this.renderTarget1,
  11623. this.readBuffer = this.renderTarget2
  11624. },
  11625. setSize: function(e, t) {
  11626. this.renderTarget1.setSize(e, t),
  11627. this.renderTarget2.setSize(e, t)
  11628. this.passes.forEach(a=>{//add for TransitionPass
  11629. a.setSize && a.setSize(e, t)
  11630. })
  11631. }
  11632. }
  11633. }
  11634. , {
  11635. three: 217
  11636. }],
  11637. 97: [function(e, t, i) {
  11638. "use strict";
  11639. var n = e("three");
  11640. n.MaskPass = function(e, t) {
  11641. this.scene = e,
  11642. this.camera = t,
  11643. this.enabled = !0,
  11644. this.clear = !0,
  11645. this.needsSwap = !1,
  11646. this.inverse = !1
  11647. }
  11648. ,
  11649. n.MaskPass.prototype = {
  11650. render: function(e, t, i, n) {
  11651. var r, o, a = e.context;
  11652. a.colorMask(!1, !1, !1, !1),
  11653. a.depthMask(!1),
  11654. o = this.inverse ? (r = 0,
  11655. 1) : (r = 1,
  11656. 0),
  11657. a.enable(a.STENCIL_TEST),
  11658. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11659. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11660. a.clearStencil(o),
  11661. e.render(this.scene, this.camera, i, this.clear),
  11662. e.render(this.scene, this.camera, t, this.clear),
  11663. a.colorMask(!0, !0, !0, !0),
  11664. a.depthMask(!0),
  11665. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11666. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11667. }
  11668. },
  11669. n.ClearMaskPass = function() {
  11670. this.enabled = !0
  11671. }
  11672. ,
  11673. n.ClearMaskPass.prototype = {
  11674. render: function(e, t, i, n) {
  11675. var r = e.context;
  11676. r.disable(r.STENCIL_TEST)
  11677. }
  11678. }
  11679. }
  11680. , {
  11681. three: 217
  11682. }],
  11683. 98: [function(e, t, i) {
  11684. "use strict";
  11685. var o = e("three");
  11686. o.RenderPass = function(e, t, i, n, r) {
  11687. this.scene = e,
  11688. this.camera = t,
  11689. this.overrideMaterial = i,
  11690. this.clearColor = n,
  11691. this.clearAlpha = void 0 !== r ? r : 1,
  11692. this.oldClearColor = new o.Color,
  11693. this.oldClearAlpha = 1,
  11694. this.enabled = !0,
  11695. this.clear = !0,
  11696. this.needsSwap = !1
  11697. }
  11698. ,
  11699. o.RenderPass.prototype = {
  11700. render: function(e, t, i, n) {
  11701. this.scene.overrideMaterial = this.overrideMaterial,
  11702. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11703. this.oldClearAlpha = e.getClearAlpha(),
  11704. e.setClearColor(this.clearColor, this.clearAlpha)),
  11705. e.render(this.scene, this.camera, i, this.clear),
  11706. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11707. this.scene.overrideMaterial = null
  11708. }
  11709. }
  11710. }
  11711. , {
  11712. three: 217
  11713. }],
  11714. 99: [function(e, t, i) {
  11715. "use strict";
  11716. var n = e("three");
  11717. n.ShaderPass = function(e, t) {
  11718. this.textureID = void 0 !== t ? t : "tDiffuse",
  11719. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11720. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11721. this.material = new n.ShaderMaterial({
  11722. defines: e.defines || {},
  11723. uniforms: this.uniforms,
  11724. vertexShader: e.vertexShader,
  11725. fragmentShader: e.fragmentShader
  11726. })),
  11727. this.renderToScreen = !1,
  11728. this.enabled = !0,
  11729. this.needsSwap = !0,
  11730. this.clear = !1,
  11731. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11732. this.scene = new n.Scene,
  11733. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11734. this.scene.add(this.quad)
  11735. }
  11736. ,
  11737. n.ShaderPass.prototype = {
  11738. render: function(e, t, i, n) {
  11739. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11740. this.quad.material = this.material,
  11741. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11742. }
  11743. }
  11744. }
  11745. , {
  11746. three: 217
  11747. }],
  11748. 100: [function(e, t, i) {
  11749. "use strict";
  11750. e("three").CopyShader = {
  11751. uniforms: {
  11752. tDiffuse: {
  11753. type: "t",
  11754. value: null
  11755. },
  11756. opacity: {
  11757. type: "f",
  11758. value: 1
  11759. }
  11760. },
  11761. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11762. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11763. }
  11764. }
  11765. , {
  11766. three: 217
  11767. }],
  11768. 101: [function(e, t, i) {
  11769. "use strict";
  11770. e("three").HorizontalBlurShader = {
  11771. uniforms: {
  11772. tDiffuse: {
  11773. type: "t",
  11774. value: null
  11775. },
  11776. h: {
  11777. type: "f",
  11778. value: 1 / 512
  11779. }
  11780. },
  11781. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11782. 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")
  11783. }
  11784. }
  11785. , {
  11786. three: 217
  11787. }],
  11788. 102: [function(e, t, i) {
  11789. "use strict";
  11790. e("three").VerticalBlurShader = {
  11791. uniforms: {
  11792. tDiffuse: {
  11793. type: "t",
  11794. value: null
  11795. },
  11796. v: {
  11797. type: "f",
  11798. value: 1 / 512
  11799. }
  11800. },
  11801. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11802. 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")
  11803. }
  11804. }
  11805. , {
  11806. three: 217
  11807. }],
  11808. 103: [function(e, t, i) {
  11809. "use strict";
  11810. var z = e("three");
  11811. !function() {
  11812. if ("performance"in window == 0 && (window.performance = {}),
  11813. "now"in window.performance == 0) {
  11814. var e = Date.now();
  11815. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11816. window.performance.now = function() {
  11817. return Date.now() - e
  11818. }
  11819. }
  11820. }(),
  11821. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11822. var t, i = this.extensions, n = this.context;
  11823. if (e === z.RepeatWrapping)
  11824. return n.REPEAT;
  11825. if (e === z.ClampToEdgeWrapping)
  11826. return n.CLAMP_TO_EDGE;
  11827. if (e === z.MirroredRepeatWrapping)
  11828. return n.MIRRORED_REPEAT;
  11829. if (e === z.NearestFilter)
  11830. return n.NEAREST;
  11831. if (e === z.NearestMipMapNearestFilter)
  11832. return n.NEAREST_MIPMAP_NEAREST;
  11833. if (e === z.NearestMipMapLinearFilter)
  11834. return n.NEAREST_MIPMAP_LINEAR;
  11835. if (e === z.LinearFilter)
  11836. return n.LINEAR;
  11837. if (e === z.LinearMipMapNearestFilter)
  11838. return n.LINEAR_MIPMAP_NEAREST;
  11839. if (e === z.LinearMipMapLinearFilter)
  11840. return n.LINEAR_MIPMAP_LINEAR;
  11841. if (e === z.UnsignedByteType)
  11842. return n.UNSIGNED_BYTE;
  11843. if (e === z.UnsignedShort4444Type)
  11844. return n.UNSIGNED_SHORT_4_4_4_4;
  11845. if (e === z.UnsignedShort5551Type)
  11846. return n.UNSIGNED_SHORT_5_5_5_1;
  11847. if (e === z.UnsignedShort565Type)
  11848. return n.UNSIGNED_SHORT_5_6_5;
  11849. if (e === z.ByteType)
  11850. return n.BYTE;
  11851. if (e === z.ShortType)
  11852. return n.SHORT;
  11853. if (e === z.UnsignedShortType)
  11854. return n.UNSIGNED_SHORT;
  11855. if (e === z.IntType)
  11856. return n.INT;
  11857. if (e === z.UnsignedIntType)
  11858. return n.UNSIGNED_INT;
  11859. if (e === z.FloatType)
  11860. return n.FLOAT;
  11861. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11862. return t.HALF_FLOAT_OES;
  11863. if (e === z.AlphaFormat)
  11864. return n.ALPHA;
  11865. if (e === z.RGBFormat)
  11866. return n.RGB;
  11867. if (e === z.RGBAFormat)
  11868. return n.RGBA;
  11869. if (e === z.LuminanceFormat)
  11870. return n.LUMINANCE;
  11871. if (e === z.LuminanceAlphaFormat)
  11872. return n.LUMINANCE_ALPHA;
  11873. if (e === z.AddEquation)
  11874. return n.FUNC_ADD;
  11875. if (e === z.SubtractEquation)
  11876. return n.FUNC_SUBTRACT;
  11877. if (e === z.ReverseSubtractEquation)
  11878. return n.FUNC_REVERSE_SUBTRACT;
  11879. if (e === z.ZeroFactor)
  11880. return n.ZERO;
  11881. if (e === z.OneFactor)
  11882. return n.ONE;
  11883. if (e === z.SrcColorFactor)
  11884. return n.SRC_COLOR;
  11885. if (e === z.OneMinusSrcColorFactor)
  11886. return n.ONE_MINUS_SRC_COLOR;
  11887. if (e === z.SrcAlphaFactor)
  11888. return n.SRC_ALPHA;
  11889. if (e === z.OneMinusSrcAlphaFactor)
  11890. return n.ONE_MINUS_SRC_ALPHA;
  11891. if (e === z.DstAlphaFactor)
  11892. return n.DST_ALPHA;
  11893. if (e === z.OneMinusDstAlphaFactor)
  11894. return n.ONE_MINUS_DST_ALPHA;
  11895. if (e === z.DstColorFactor)
  11896. return n.DST_COLOR;
  11897. if (e === z.OneMinusDstColorFactor)
  11898. return n.ONE_MINUS_DST_COLOR;
  11899. if (e === z.SrcAlphaSaturateFactor)
  11900. return n.SRC_ALPHA_SATURATE;
  11901. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11902. if (e === z.RGB_S3TC_DXT1_Format)
  11903. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11904. if (e === z.RGBA_S3TC_DXT1_Format)
  11905. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11906. if (e === z.RGBA_S3TC_DXT3_Format)
  11907. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11908. if (e === z.RGBA_S3TC_DXT5_Format)
  11909. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11910. }
  11911. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11912. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11913. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11914. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11915. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11916. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11917. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11918. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11919. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11920. }
  11921. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11922. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11923. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11924. if (e === z.MinEquation)
  11925. return t.MIN_EXT;
  11926. if (e === z.MaxEquation)
  11927. return t.MAX_EXT
  11928. }
  11929. return 0
  11930. }
  11931. ,
  11932. z.WebGLState = function(l, i, c) {
  11933. var n = this
  11934. , r = new z.Vector4
  11935. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11936. , o = new Uint8Array(e)
  11937. , a = new Uint8Array(e)
  11938. , s = new Uint8Array(e)
  11939. , t = {}
  11940. , h = null
  11941. , u = null
  11942. , d = null
  11943. , p = null
  11944. , f = null
  11945. , g = null
  11946. , m = null
  11947. , v = null
  11948. , y = !1
  11949. , A = null
  11950. , C = null
  11951. , I = null
  11952. , E = null
  11953. , _ = null
  11954. , b = null
  11955. , w = null
  11956. , T = null
  11957. , x = null
  11958. , S = null
  11959. , M = null
  11960. , R = null
  11961. , P = null
  11962. , O = null
  11963. , L = null
  11964. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11965. , N = void 0
  11966. , F = {}
  11967. , B = new z.Vector4
  11968. , V = null
  11969. , k = null
  11970. , U = new z.Vector4
  11971. , H = new z.Vector4;
  11972. this.init = function() {
  11973. this.clearColor(0, 0, 0, 1),
  11974. this.clearDepth(1),
  11975. this.clearStencil(0),
  11976. this.enable(l.DEPTH_TEST),
  11977. l.depthFunc(l.LEQUAL),
  11978. l.frontFace(l.CCW),
  11979. l.cullFace(l.BACK),
  11980. this.enable(l.CULL_FACE),
  11981. this.enable(l.BLEND),
  11982. l.blendEquation(l.FUNC_ADD),
  11983. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11984. }
  11985. ,
  11986. this.initAttributes = function() {
  11987. for (var e = 0, t = o.length; e < t; e++)
  11988. o[e] = 0
  11989. }
  11990. ,
  11991. this.enableAttribute = function(e) {
  11992. o[e] = 1,
  11993. 0 === a[e] && (l.enableVertexAttribArray(e),
  11994. a[e] = 1),
  11995. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11996. s[e] = 0)
  11997. }
  11998. ,
  11999. this.enableAttributeAndDivisor = function(e, t, i) {
  12000. o[e] = 1,
  12001. 0 === a[e] && (l.enableVertexAttribArray(e),
  12002. a[e] = 1),
  12003. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12004. s[e] = t)
  12005. }
  12006. ,
  12007. this.disableUnusedAttributes = function() {
  12008. for (var e = 0, t = a.length; e < t; e++)
  12009. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12010. a[e] = 0)
  12011. }
  12012. ,
  12013. this.enable = function(e) {
  12014. !0 !== t[e] && (l.enable(e),
  12015. t[e] = !0)
  12016. }
  12017. ,
  12018. this.disable = function(e) {
  12019. !1 !== t[e] && (l.disable(e),
  12020. t[e] = !1)
  12021. }
  12022. ,
  12023. this.getCompressedTextureFormats = function() {
  12024. if (null === h && (h = [],
  12025. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12026. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12027. h.push(e[t]);
  12028. return h
  12029. }
  12030. ,
  12031. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12032. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12033. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12034. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12035. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12036. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12037. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12038. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12039. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12040. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12041. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12042. u = e,
  12043. y = s),
  12044. e === z.CustomBlending ? (r = r || t,
  12045. o = o || i,
  12046. a = a || n,
  12047. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12048. d = t,
  12049. g = r),
  12050. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12051. p = i,
  12052. f = n,
  12053. m = o,
  12054. v = a)) : v = m = g = f = p = d = null
  12055. }
  12056. ,
  12057. this.setDepthFunc = function(e) {
  12058. if (A !== e) {
  12059. if (e)
  12060. switch (e) {
  12061. case z.NeverDepth:
  12062. l.depthFunc(l.NEVER);
  12063. break;
  12064. case z.AlwaysDepth:
  12065. l.depthFunc(l.ALWAYS);
  12066. break;
  12067. case z.LessDepth:
  12068. l.depthFunc(l.LESS);
  12069. break;
  12070. case z.LessEqualDepth:
  12071. l.depthFunc(l.LEQUAL);
  12072. break;
  12073. case z.EqualDepth:
  12074. l.depthFunc(l.EQUAL);
  12075. break;
  12076. case z.GreaterEqualDepth:
  12077. l.depthFunc(l.GEQUAL);
  12078. break;
  12079. case z.GreaterDepth:
  12080. l.depthFunc(l.GREATER);
  12081. break;
  12082. case z.NotEqualDepth:
  12083. l.depthFunc(l.NOTEQUAL);
  12084. break;
  12085. default:
  12086. l.depthFunc(l.LEQUAL)
  12087. }
  12088. else
  12089. l.depthFunc(l.LEQUAL);
  12090. A = e
  12091. }
  12092. }
  12093. ,
  12094. this.setDepthTest = function(e) {
  12095. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12096. }
  12097. ,
  12098. this.setDepthWrite = function(e) {
  12099. C !== e && (l.depthMask(e),
  12100. C = e)
  12101. }
  12102. ,
  12103. this.setColorWrite = function(e) {
  12104. I !== e && (l.colorMask(e, e, e, e),
  12105. I = e)
  12106. }
  12107. ,
  12108. this.setStencilFunc = function(e, t, i) {
  12109. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12110. _ = e,
  12111. b = t,
  12112. w = i)
  12113. }
  12114. ,
  12115. this.setStencilOp = function(e, t, i) {
  12116. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12117. T = e,
  12118. x = t,
  12119. S = i)
  12120. }
  12121. ,
  12122. this.setStencilTest = function(e) {
  12123. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12124. }
  12125. ,
  12126. this.setStencilWrite = function(e) {
  12127. E !== e && (l.stencilMask(e),
  12128. E = e)
  12129. }
  12130. ,
  12131. this.setFlipSided = function(e) {
  12132. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12133. M = e)
  12134. }
  12135. ,
  12136. this.setLineWidth = function(e) {
  12137. e !== R && (l.lineWidth(e),
  12138. R = e)
  12139. }
  12140. ,
  12141. this.setPolygonOffset = function(e, t, i) {
  12142. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12143. !e || P === t && O === i || (l.polygonOffset(t, i),
  12144. P = t,
  12145. O = i)
  12146. }
  12147. ,
  12148. this.getScissorTest = function() {
  12149. return L
  12150. }
  12151. ,
  12152. this.setScissorTest = function(e) {
  12153. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12154. }
  12155. ,
  12156. this.activeTexture = function(e) {
  12157. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12158. N !== e && (l.activeTexture(e),
  12159. N = e)
  12160. }
  12161. ,
  12162. this.bindTexture = function(e, t) {
  12163. void 0 === N && n.activeTexture();
  12164. var i = F[N];
  12165. void 0 === i && (i = {
  12166. type: void 0,
  12167. texture: void 0
  12168. },
  12169. F[N] = i),
  12170. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12171. i.type = e,
  12172. i.texture = t)
  12173. }
  12174. ,
  12175. this.compressedTexImage2D = function() {
  12176. try {
  12177. l.compressedTexImage2D.apply(l, arguments)
  12178. } catch (e) {
  12179. console.error(e)
  12180. }
  12181. }
  12182. ,
  12183. this.texImage2D = function() {
  12184. try {
  12185. l.texImage2D.apply(l, arguments)
  12186. } catch (e) {
  12187. console.error(e)
  12188. }
  12189. }
  12190. ,
  12191. this.clearColor = function(e, t, i, n) {
  12192. r.set(e, t, i, n),
  12193. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12194. B.copy(r))
  12195. }
  12196. ,
  12197. this.clearDepth = function(e) {
  12198. V !== e && (l.clearDepth(e),
  12199. V = e)
  12200. }
  12201. ,
  12202. this.clearStencil = function(e) {
  12203. k !== e && (l.clearStencil(e),
  12204. k = e)
  12205. }
  12206. ,
  12207. this.scissor = function(e) {
  12208. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12209. U.copy(e))
  12210. }
  12211. ,
  12212. this.viewport = function(e) {
  12213. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12214. H.copy(e))
  12215. }
  12216. ,
  12217. this.reset = function() {
  12218. for (var e = 0; e < a.length; e++)
  12219. 1 === a[e] && (l.disableVertexAttribArray(e),
  12220. a[e] = 0);
  12221. t = {},
  12222. N = void 0,
  12223. F = {},
  12224. M = E = C = I = u = h = null
  12225. }
  12226. }
  12227. }
  12228. , {
  12229. three: 217
  12230. }],
  12231. 104: [function(a, h, e) {
  12232. (function(i, e) {
  12233. "use strict";
  12234. function t(e) {
  12235. this.urls = e;
  12236. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12237. this.builder = n.loadProto(t),
  12238. this.decoder = this.builder.build("binary_mesh")
  12239. }
  12240. var s = a("three")
  12241. , n = a("protobufjs")
  12242. , r = a("../util/logger")
  12243. , o = (a("../util/common"),
  12244. a("../util/ajax"))
  12245. , l = a("../objects/Chunk")
  12246. , c = new r(e);
  12247. t.prototype = {
  12248. constructor: t,
  12249. load: function(t, i, n, r) {
  12250. return c.time("download"),
  12251. o.get(t, {
  12252. responseType: "arraybuffer"
  12253. }).done(function(e) {
  12254. c.timeEnd("download"),
  12255. this.parse(e, t, i, n, r)
  12256. }
  12257. .bind(this)).fail(r)
  12258. },
  12259. parse: function(e, t, i, n, r) {
  12260. var o = this.readProtobuf(e);
  12261. if (!o)
  12262. return r();
  12263. try {
  12264. c.time("convert to webgl"),
  12265. this.convertProtobufToSceneObject(o, t, i, n, r),
  12266. c.timeEnd("convert to webgl")
  12267. } catch (e) {
  12268. return c.error("failed parsing .dam"),
  12269. c.error(e.message),
  12270. r()
  12271. }
  12272. },
  12273. readProtobuf: function(e) {
  12274. var t;
  12275. try {
  12276. c.time("parse proto"),
  12277. t = this.decoder.decode(e),
  12278. c.timeEnd("parse proto")
  12279. } catch (e) {
  12280. return c.error("failed parsing proto for .dam"),
  12281. c.error(e.message),
  12282. null
  12283. }
  12284. return t
  12285. },
  12286. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12287. if (0 === e.chunk.length)
  12288. return c.warn("No chunks in damfile..."),
  12289. t([]);
  12290. var o = new s.Matrix4;
  12291. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12292. var a = e.chunk.map(function(e) {
  12293. var t = new s.BufferGeometry;
  12294. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12295. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12296. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12297. t.applyMatrix(o),
  12298. t.computeBoundingBox(),
  12299. new l({
  12300. geometry: t,
  12301. textureName: e.material_name,
  12302. name: e.chunk_name,
  12303. meshUrl: i
  12304. })
  12305. });
  12306. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12307. r())
  12308. }
  12309. },
  12310. h.exports = t
  12311. }
  12312. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12313. }
  12314. , {
  12315. "../objects/Chunk": 144,
  12316. "../util/ajax": 181,
  12317. "../util/common": 185,
  12318. "../util/logger": 189,
  12319. buffer: 198,
  12320. protobufjs: 214,
  12321. three: 217
  12322. }],
  12323. 105: [function(n, r, e) {
  12324. (function(e) {
  12325. "use strict";
  12326. var t = (n("three"),
  12327. n("../settings"),
  12328. n("../util/browser"),
  12329. n("./DamLoader"))
  12330. , i = n("../util/logger")
  12331. , u = (n("../ab"),
  12332. new i(e));
  12333. r.exports = {
  12334. getLoaders: function() {
  12335. return [["_50k", ".dam", t], ["", ".dam", t]]
  12336. },
  12337. load: function(e, t, i, n, r, o) {
  12338. var a = this.getLoaders()[o = o || 0];
  12339. if (a) {
  12340. var s = a[0]
  12341. , l = a[1]
  12342. , c = new a[2](t)
  12343. , h = t.get(e + s + l);
  12344. h ? (u.debug("Trying " + s + l),
  12345. c.load(h, i, n, function() {
  12346. this.load(e, t, i, n, r, ++o)
  12347. }
  12348. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12349. this.load(e, t, i, n, r, ++o))
  12350. } else
  12351. r && r("No suitable model file found...")
  12352. }
  12353. }
  12354. }
  12355. ).call(this, "/js/loaders/ModelLoader.js")
  12356. }
  12357. , {
  12358. "../ab": 3,
  12359. "../settings": 166,
  12360. "../util/browser": 182,
  12361. "../util/logger": 189,
  12362. "./DamLoader": 104,
  12363. three: 217
  12364. }],
  12365. 106: [function(i, n, e) {
  12366. (function(e) {
  12367. "use strict";
  12368. var l = i("../util/common")
  12369. , c = i("../util/texture")
  12370. , h = i("../util/browser")
  12371. , t = i("../util/logger")
  12372. , u = i("../settings")
  12373. , d = new t(e);
  12374. n.exports = {
  12375. load: function(i, n) {
  12376. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12377. return $.when();
  12378. var r = l.countUnique(i.chunks.map(function(e) {
  12379. return e.textureName
  12380. }))
  12381. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12382. , t = "_50k" == e ? "high" : "low";
  12383. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12384. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12385. t = "low"));
  12386. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12387. , a = $.Deferred()
  12388. , s = 0;
  12389. return i.chunks.forEach(function(e) {
  12390. if (!e.material.map && e.textureName) {
  12391. var t = i.urls.get(o + e.textureName);
  12392. e.setTextureMap(c.load(t, function(e, t) {
  12393. e || (n.push(t),
  12394. s++,
  12395. a.notify(s, r),
  12396. s === r && a.resolve())
  12397. }
  12398. .bind(this, c.isLoaded(t))))
  12399. }
  12400. }),
  12401. a.promise()
  12402. }
  12403. }
  12404. }
  12405. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12406. }
  12407. , {
  12408. "../settings": 166,
  12409. "../util/browser": 182,
  12410. "../util/common": 185,
  12411. "../util/logger": 189,
  12412. "../util/texture": 194
  12413. }],
  12414. 107: [function(s, l, e) {
  12415. (function(n, e) {
  12416. "use strict";
  12417. function t(e) {
  12418. this.model = e,
  12419. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12420. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12421. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12422. , i = r.loadProto(t);
  12423. this.decoder = i.build("VisionModeldata")
  12424. }
  12425. var r = s("protobufjs")
  12426. , i = s("../util/ajax")
  12427. , o = (s("../util/common"),
  12428. s("../util/math"))
  12429. , a = new (s("../util/logger"))(e);
  12430. t.prototype.load = function() {
  12431. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12432. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12433. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12434. $.when([]))
  12435. }
  12436. ,
  12437. t.prototype.loadVisionModelData = function() {
  12438. return i.get(this.modelDataPath, {
  12439. responseType: "arraybuffer"
  12440. }).then(function(e) {
  12441. var t;
  12442. try {
  12443. t = this.decoder.decode(e)
  12444. } catch (e) {
  12445. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12446. this.loadSweepLocationsCSV()
  12447. }
  12448. var i = t.sweepLocations.map(function(e) {
  12449. return {
  12450. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12451. position: {
  12452. x: e.pose.translation.x,
  12453. y: e.pose.translation.y,
  12454. z: e.pose.translation.z
  12455. },
  12456. quaternion: {
  12457. x: e.pose.rotation.x,
  12458. y: e.pose.rotation.y,
  12459. z: e.pose.rotation.z,
  12460. w: e.pose.rotation.w
  12461. },
  12462. puck: {
  12463. x: e.puck.x,
  12464. y: e.puck.y,
  12465. z: e.puck.z
  12466. },
  12467. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12468. neighbours: e.visibles,
  12469. alignmentType: e.alignment_type
  12470. }
  12471. }).map(function(e) {
  12472. return e.position = o.convertVisionVector(e.position),
  12473. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12474. e.puck = o.convertVisionVector(e.puck),
  12475. e
  12476. });
  12477. return i.forEach(function(e) {
  12478. /* if(e.neighbours.find(a=>a==-1)){
  12479. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12480. } */
  12481. e.neighbours = e.neighbours.filter(e=>i[e])
  12482. e.neighbours = e.neighbours.map(function(e) {
  12483. return i[e].uuid
  12484. })
  12485. }),
  12486. i
  12487. }
  12488. .bind(this), function() {
  12489. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12490. this.loadSweepLocationsCSV()
  12491. }
  12492. .bind(this))
  12493. }
  12494. ,
  12495. t.prototype.loadSweepLocationsCSV = function() {
  12496. return i.get(this.sweepLocationsPath).then(function(e) {
  12497. return e.split("\n").map(function(e) {
  12498. return e.split(", ")
  12499. }).filter(function(e) {
  12500. return 1 < e.length
  12501. }).map(function(e) {
  12502. return {
  12503. uuid: e[0],
  12504. position: {
  12505. x: parseFloat(e[1]),
  12506. y: parseFloat(e[2]),
  12507. z: parseFloat(e[3])
  12508. },
  12509. quaternion: {
  12510. x: parseFloat(e[4]),
  12511. y: parseFloat(e[5]),
  12512. z: parseFloat(e[6]),
  12513. w: parseFloat(e[7])
  12514. }
  12515. }
  12516. }).map(function(e) {
  12517. return e.position = o.convertVisionVector(e.position),
  12518. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12519. e
  12520. })
  12521. }).fail(function() {
  12522. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12523. })
  12524. }
  12525. ,
  12526. l.exports = t
  12527. }
  12528. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12529. }
  12530. , {
  12531. "../util/ajax": 181,
  12532. "../util/common": 185,
  12533. "../util/logger": 189,
  12534. "../util/math": 190,
  12535. buffer: 198,
  12536. protobufjs: 214
  12537. }],
  12538. 108: [function(s, l, e) {
  12539. (function(e) {
  12540. "use strict";
  12541. function t() {
  12542. this.locale = null
  12543. }
  12544. var i = s("../settings")
  12545. , n = s("../util/common")
  12546. , r = s("../util/logger")
  12547. , o = s("../enum/Locale")
  12548. , a = new r(e);
  12549. t.prototype.init = function() {
  12550. var e;
  12551. switch (i.languageTag) {
  12552. case null:
  12553. case "en":
  12554. case o.EN_US:
  12555. this.locale = o.EN_US,
  12556. e = s("./strings-en-US");
  12557. break;
  12558. case "es":
  12559. case o.ES_MX:
  12560. this.locale = o.ES_MX,
  12561. e = s("./strings-es-MX");
  12562. break;
  12563. case "fr":
  12564. case o.FR_FR:
  12565. this.locale = o.FR_FR,
  12566. e = s("./strings-fr-FR");
  12567. break;
  12568. case "de":
  12569. case o.DE_DE:
  12570. this.locale = o.DE_DE,
  12571. e = s("./strings-de-DE");
  12572. break;
  12573. case "ru":
  12574. case o.RU_RU:
  12575. this.locale = o.RU_RU,
  12576. e = s("./strings-ru-RU");
  12577. break;
  12578. case "cn":
  12579. case o.CN_CN:
  12580. this.locale = o.CN_CN,
  12581. e = s("./strings-cn-CN");
  12582. break;
  12583. case "jp":
  12584. case o.JP_JP:
  12585. this.locale = o.JP_JP,
  12586. e = s("./strings-jp-JP");
  12587. break;
  12588. default:
  12589. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12590. this.locale = o.EN_US,
  12591. e = s("./strings-en-US")
  12592. }
  12593. a.info("Using locale '" + this.locale + "'"),
  12594. n.extendObject(this, e)
  12595. }
  12596. ,
  12597. t.prototype.localizeGUI = function() {
  12598. var e = document.querySelector("#gui-parent");
  12599. this.localizeTree(e),
  12600. this.localizeLoadingText()
  12601. }
  12602. ,
  12603. t.prototype.localizeLoadingText = function() {
  12604. document.querySelector("#help-dialog").classList.add(this.locale),
  12605. document.querySelector("#interaction-modal").classList.add(this.locale),
  12606. document.querySelector("#gui").classList.add(this.locale)
  12607. }
  12608. ,
  12609. t.prototype.localizeTree = function(e) {
  12610. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12611. if (e.nodeType === Node.TEXT_NODE)
  12612. (t = e.data.match(n)) && (i = t[1],
  12613. e.data = this.localizeText(i) || i);
  12614. else if (e.nodeType === Node.ELEMENT_NODE) {
  12615. var r = e.getAttribute("title");
  12616. r && ((t = r.match(n)) && (i = t[1],
  12617. e.setAttribute("title", this.localizeText(i) || i)))
  12618. }
  12619. for (e = e.firstChild; e; )
  12620. this.localizeTree(e),
  12621. e = e.nextSibling
  12622. }
  12623. ,
  12624. t.prototype.localizeText = function(e) {
  12625. var t = this[e];
  12626. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12627. t = s("./strings-en-US")[e]),
  12628. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12629. t
  12630. }
  12631. ,
  12632. l.exports = new t
  12633. }
  12634. ).call(this, "/js/localization/localize.js")
  12635. }
  12636. , {
  12637. "../enum/Locale": 31,
  12638. "../settings": 166,
  12639. "../util/common": 185,
  12640. "../util/logger": 189,
  12641. "./strings-cn-CN": 109,
  12642. "./strings-de-DE": 110,
  12643. "./strings-en-US": 111,
  12644. "./strings-es-MX": 112,
  12645. "./strings-fr-FR": 113,
  12646. "./strings-jp-JP": 114,
  12647. "./strings-ru-RU": 115
  12648. }],
  12649. 109: [function(e, t, i) {
  12650. "use strict";
  12651. t.exports = {
  12652. PAGE_TITLE: "",
  12653. LOADING: "正在加载",
  12654. PRESENTED_BY_CAPS: "呈现者:",
  12655. POWERED_BY: "技术支持:",
  12656. POWERED_BY_CAPS: "技术支持:",
  12657. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12658. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12659. PRESENTED_BY: "呈现者:",
  12660. MORE: "更多 ",
  12661. LESS: "更少 ",
  12662. TAG_CONTENT: "tag™ 内容",
  12663. SHOW: "显示",
  12664. HIDE: "隐藏",
  12665. DOLLHOUSE: "场景屋",
  12666. FLOOR_PLAN: "楼层平面图",
  12667. OPEN_HIGHLIGHTS: "打开精彩片段",
  12668. CLOSE_HIGHLIGHTS: "关闭",
  12669. PREVIOUS: "上一个",
  12670. PLAY: "播放",
  12671. PAUSE: "暂停",
  12672. NEXT: "下一个",
  12673. EXPLORE_3D_SPACE: "探索 3D 空间",
  12674. VIEW_DOLLHOUSE: "观看场景屋",
  12675. SOCIAL_SHARING: "分享这个空间",
  12676. VIEW_IN_VR: "以 VR 观看",
  12677. VIEW_FULLSCREEN: "全屏观看",
  12678. EXIT_FULLSCREEN: " 退出全屏",
  12679. ZOOM_IN: "放大",
  12680. ZOOM_OUT: "缩小",
  12681. FLOOR_NAME: "楼层",
  12682. FLOOR_ALL: "ALL",
  12683. FLOOR_Lang: ["Floor", ""],
  12684. TERMS: "条款",
  12685. PORT_TERMS: "port 条款",
  12686. TERMS_OF_USE: "使用条款",
  12687. CLOSE_TERMS: "关闭",
  12688. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12689. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12690. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12691. WEBVR_ENTER_WEBVR: "进入 VR",
  12692. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12693. WEBVR_LEARN_MORE: "了解更多",
  12694. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12695. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12696. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12697. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12698. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12699. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12700. VR_LEARN_MORE_CAPS: "了解更多",
  12701. VR_PREVIOUS_CAPS: "上一个’,",
  12702. VR_NEXT_CAPS: "下一个",
  12703. VR_GOT_IT_CAPS: "明白了",
  12704. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12705. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12706. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12707. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12708. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12709. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12710. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12711. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12712. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12713. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12714. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12715. VR_APP: "port VR 应用程序",
  12716. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12717. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12718. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12719. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12720. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12721. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12722. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12723. VR_ANDROID_DVICES: "Android 设备",
  12724. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12725. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12726. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12727. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12728. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12729. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12730. VR_DOWNLOAD_HERE: "在此下载",
  12731. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12732. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12733. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12734. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12735. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12736. SHARE_TO: "分享到",
  12737. SHARE_LINK: "直接链接",
  12738. SHARE_EXPLORE: "探索",
  12739. SHARE_AT: "在",
  12740. SHARE_WITH: "使用",
  12741. SHARE_3D: "以 3D",
  12742. SHARE_COPIED: "已复制!",
  12743. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12744. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12745. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12746. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12747. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12748. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12749. ERROR_GENERIC_ACTIONS_3: " 或",
  12750. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12751. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12752. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12753. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12754. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12755. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12756. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12757. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12758. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12759. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12760. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12761. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12762. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12763. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12764. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12765. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12766. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12767. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12768. LINK_TO_LOCATION: "地点链接",
  12769. MENU_COPY: "复制",
  12770. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12771. ROTATE: "旋转",
  12772. MOVE: "移动",
  12773. INSIDE: "内部",
  12774. ZOOM: "缩放",
  12775. HELP: "小帮手",
  12776. HELP_NAVIGATION_TAB: "导航",
  12777. HELP_MORE_HELP_TAB: "更多帮助",
  12778. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12779. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12780. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12781. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12782. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12783. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12784. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12785. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12786. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12787. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12788. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12789. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12790. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12791. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12792. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12793. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12794. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12795. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12796. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12797. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12798. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12799. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12800. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12801. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12802. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12803. HELP_MORE_HLR_A: "精彩片段集锦",
  12804. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12805. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12806. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12807. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12808. HELP_MORE_FLOORS_A: "楼层选择器",
  12809. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12810. HELP_MORE_TAG_A: "tag™ 贴文",
  12811. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12812. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12813. HELP_MORE_ZOOM_A: "缩放控件",
  12814. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12815. HELP_MORE_TOUR_A: "导览控件",
  12816. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12817. HELP_MORE_INSIDE_A: "内部视图",
  12818. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12819. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12820. HELP_MORE_VR_A: "VR 模式",
  12821. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12822. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12823. HELP_MORE_360_A: "360° 视图",
  12824. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12825. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12826. HELP_MORE_FULLSCREEN_A: "全屏",
  12827. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12828. CLOSE: "关闭"
  12829. }
  12830. }
  12831. , {}],
  12832. 110: [function(e, t, i) {
  12833. "use strict";
  12834. t.exports = {
  12835. PAGE_TITLE: "",
  12836. LOADING: "Lädt",
  12837. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12838. POWERED_BY: "Angetrieben von",
  12839. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12840. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12841. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12842. PRESENTED_BY: "Präsentiert von ",
  12843. MORE: "Mehr ",
  12844. LESS: "Weniger ",
  12845. TAG_CONTENT: "tag™ Inhalt",
  12846. SHOW: "Anzeigen",
  12847. HIDE: "Verbergen",
  12848. DOLLHOUSE: "Puppenhaus",
  12849. FLOOR_PLAN: "Grundriss",
  12850. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12851. CLOSE_HIGHLIGHTS: "Schließen",
  12852. PREVIOUS: "Vorheriges",
  12853. PLAY: "Abspielen",
  12854. PAUSE: "Pausieren",
  12855. NEXT: "Nächstes",
  12856. EXPLORE_3D_SPACE: "Innenraum betreten",
  12857. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12858. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12859. VIEW_IN_VR: "In VR ansehen",
  12860. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12861. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12862. ZOOM_IN: "Vergrößern",
  12863. ZOOM_OUT: "Verkleinern",
  12864. FLOOR_NAME: "Etage ",
  12865. FLOOR_ALL: "Alle",
  12866. TERMS: "Bedingungen",
  12867. PORT_TERMS: "port Bedingungen",
  12868. TERMS_OF_USE: "Nutzungsbedingungen",
  12869. TERMS_TEXT_FILE: "terms-de-DE.html",
  12870. CLOSE_TERMS: "Schließen",
  12871. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12872. HELP: "Hilfe",
  12873. HELP_NAVIGATION_TAB: "Navigation",
  12874. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12875. CLOSE: "Schließen",
  12876. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12877. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12878. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12879. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12880. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12881. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12882. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12883. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12884. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12885. 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.",
  12886. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12887. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12888. 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.",
  12889. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12890. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12891. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12892. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12893. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12894. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12895. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12896. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12897. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12898. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12899. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12900. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12901. HELP_MORE_HLR_A: "Liste das Highlight",
  12902. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12903. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12904. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12905. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12906. HELP_MORE_FLOORS_A: "Etage auswählen",
  12907. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12908. HELP_MORE_TAG_A: "tag™ Posts",
  12909. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12910. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12911. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12912. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12913. HELP_MORE_TOUR_A: "Tour Steuerung",
  12914. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12915. HELP_MORE_INSIDE_A: "Innenansicht",
  12916. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12917. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12918. HELP_MORE_VR_A: "VR Modus",
  12919. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12920. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12921. HELP_MORE_360_A: "360° Views Ansicht ",
  12922. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12923. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12924. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12925. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12926. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12927. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12928. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12929. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12930. WEBVR_LEARN_MORE: "Mehr Infos",
  12931. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12932. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12933. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12934. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12935. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12936. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12937. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12938. VR_APP: "port VR App",
  12939. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12940. 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",
  12941. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12942. VR_APP_FOR_ANDROID: "port VR app für Android",
  12943. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12944. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12945. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12946. VR_PREVIOUS_CAPS: "ZURÜCK",
  12947. VR_NEXT_CAPS: "WEITER",
  12948. VR_GOT_IT_CAPS: "VERSTANDEN",
  12949. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12950. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12951. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12952. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12953. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12954. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12955. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12956. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12957. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12958. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12959. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12960. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12961. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12962. VR_ANDROID_DVICES: "Android Geräte",
  12963. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12964. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12965. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12966. VR_DOWNLOAD_HERE: "Hier runterladen",
  12967. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12968. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12969. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12970. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12971. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12972. SHARE_TO: "Teilen auf",
  12973. SHARE_LINK: "Direkter Link",
  12974. SHARE_EXPLORE: "Umsehen",
  12975. SHARE_AT: "auf",
  12976. SHARE_WITH: "mit",
  12977. SHARE_3D: "in 3D",
  12978. SHARE_COPIED: "Kopiert!",
  12979. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12980. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12981. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12982. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12983. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12984. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12985. ERROR_GENERIC_ACTIONS_3: " oder ",
  12986. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12987. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12988. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12989. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12990. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12991. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12992. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12993. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12994. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12995. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12996. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12997. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12998. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12999. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13000. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13001. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13002. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13003. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13004. LINK_TO_LOCATION: "Link zu",
  13005. MENU_COPY: "Kopieren",
  13006. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13007. ROTATE: "Drehen",
  13008. INSIDE: "Drinnen",
  13009. MOVE: "Bewegen",
  13010. ZOOM: "Vergrößern"
  13011. }
  13012. }
  13013. , {}],
  13014. 111: [function(e, t, i) {
  13015. "use strict";
  13016. t.exports = {
  13017. PAGE_TITLE: "",
  13018. LOADING: "Loading",
  13019. PRESENTED_BY_CAPS: "PRESENTED BY",
  13020. POWERED_BY: "powered by ",
  13021. POWERED_BY_CAPS: "POWERED BY",
  13022. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13023. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13024. PRESENTED_BY: "Presented by ",
  13025. MORE: "More ",
  13026. LESS: "Less ",
  13027. TAG_CONTENT: "tag™ Content",
  13028. SHOW: "Show",
  13029. HIDE: "Hide",
  13030. DOLLHOUSE: "Dollhouse",
  13031. FLOOR_PLAN: "Floor plan",
  13032. OPEN_HIGHLIGHTS: "Open Highlights",
  13033. CLOSE_HIGHLIGHTS: "Close",
  13034. PREVIOUS: "Previous",
  13035. PLAY: "Play",
  13036. PAUSE: "Pause",
  13037. NEXT: "Next",
  13038. EXPLORE_3D_SPACE: "Explore 3D Space",
  13039. VIEW_DOLLHOUSE: "View dollhouse",
  13040. SOCIAL_SHARING: "Share this Space",
  13041. VIEW_IN_VR: "View in VR",
  13042. VIEW_FULLSCREEN: "全屏",
  13043. EXIT_FULLSCREEN: "退出全屏",
  13044. ZOOM_IN: "Zoom in",
  13045. ZOOM_OUT: "Zoom out",
  13046. FLOOR_NAME: "Floor ",
  13047. FLOOR_ALL: "全部",
  13048. TERMS: "Terms",
  13049. PORT_TERMS: "port terms",
  13050. TERMS_OF_USE: "Terms of Use",
  13051. TERMS_TEXT_FILE: "terms-en-US.html",
  13052. CLOSE_TERMS: "Close",
  13053. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13054. HELP: "Help",
  13055. HELP_NAVIGATION_TAB: "Navigation",
  13056. HELP_MORE_HELP_TAB: "More Help",
  13057. CLOSE: "Close",
  13058. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13059. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13060. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13061. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13062. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13063. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13064. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13065. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13066. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13067. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13068. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13069. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13070. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13071. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13072. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13073. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13074. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13075. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13076. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13077. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13078. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13079. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13080. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13081. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13082. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13083. HELP_MORE_HLR_A: "Highlight Reel",
  13084. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13085. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13086. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13087. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13088. HELP_MORE_FLOORS_A: "Floor Selector",
  13089. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13090. HELP_MORE_TAG_A: "tag™ Posts",
  13091. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13092. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13093. HELP_MORE_ZOOM_A: "Zoom Controls",
  13094. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13095. HELP_MORE_TOUR_A: "Tour Controls",
  13096. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13097. HELP_MORE_INSIDE_A: "Inside View",
  13098. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13099. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13100. HELP_MORE_VR_A: "VR Mode",
  13101. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13102. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13103. HELP_MORE_360_A: "360° Views",
  13104. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13105. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13106. HELP_MORE_FULLSCREEN_A: "Full screen",
  13107. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13108. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13109. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13110. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13111. WEBVR_ENTER_WEBVR: "ENTER VR",
  13112. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13113. WEBVR_LEARN_MORE: "Learn more",
  13114. WEBVR_VIEW_SPACE: "View Space in VR",
  13115. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13116. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13117. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13118. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13119. VR_PREVIOUS_CAPS: "PREVIOUS",
  13120. VR_NEXT_CAPS: "NEXT",
  13121. VR_GOT_IT_CAPS: "GOT IT",
  13122. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13123. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13124. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13125. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13126. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13127. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13128. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13129. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13130. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13131. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13132. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13133. VR_APP: "port VR App",
  13134. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13135. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13136. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13137. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13138. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13139. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13140. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13141. VR_ANDROID_DVICES: "Android Devices",
  13142. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13143. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13144. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13145. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13146. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13147. VR_APP_OPEN: "Open with the port VR app instead",
  13148. VR_DOWNLOAD_HERE: "Download here",
  13149. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13150. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13151. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13152. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13153. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13154. SHARE_TO: "Share to",
  13155. SHARE_LINK: "Direct Link",
  13156. SHARE_EXPLORE: "Explore ",
  13157. SHARE_AT: "at",
  13158. SHARE_WITH: "with",
  13159. SHARE_3D: " in 3D",
  13160. SHARE_COPIED: "Copied!",
  13161. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13162. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13163. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13164. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13165. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13166. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13167. ERROR_GENERIC_ACTIONS_3: " or ",
  13168. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13169. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13170. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13171. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13172. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13173. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13174. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13175. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13176. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13177. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13178. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13179. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13180. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13181. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13182. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13183. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13184. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13185. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13186. LINK_TO_LOCATION: "Link to location",
  13187. MENU_COPY: "Copy",
  13188. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13189. ROTATE: "Rotate",
  13190. INSIDE: "Inside",
  13191. MOVE: "Move",
  13192. ZOOM: "Zoom"
  13193. }
  13194. }
  13195. , {}],
  13196. 112: [function(e, t, i) {
  13197. "use strict";
  13198. t.exports = {
  13199. PAGE_TITLE: "",
  13200. LOADING: "Cargando",
  13201. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13202. POWERED_BY: "potenciando por ",
  13203. POWERED_BY_CAPS: "POTENCIADO POR ",
  13204. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13205. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13206. PRESENTED_BY: "Presentado por ",
  13207. MORE: "Más ",
  13208. LESS: "Menos ",
  13209. TAG_CONTENT: "Contenido de tag™",
  13210. SHOW: "Mostrar",
  13211. HIDE: "Ocultar",
  13212. DOLLHOUSE: "Dollhouse",
  13213. FLOOR_PLAN: "Planos",
  13214. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13215. CLOSE_HIGHLIGHTS: "Cerrar",
  13216. PREVIOUS: "Anterior",
  13217. PLAY: "Play",
  13218. PAUSE: "Pausa",
  13219. NEXT: "Siguiente",
  13220. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13221. VIEW_DOLLHOUSE: "Ver dollhouse",
  13222. SOCIAL_SHARING: "Compartir este espacio",
  13223. VIEW_IN_VR: "Ver en realidad virtual",
  13224. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13225. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13226. ZOOM_IN: "Acercar",
  13227. ZOOM_OUT: "Alejar",
  13228. FLOOR_NAME: "Piso ",
  13229. FLOOR_ALL: "Todas",
  13230. TERMS: "Condiciones",
  13231. PORT_TERMS: "port términos de uso",
  13232. TERMS_OF_USE: "Términos de uso",
  13233. TERMS_TEXT_FILE: "terms-es-MX.html",
  13234. CLOSE_TERMS: "Cerrar",
  13235. 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.",
  13236. HELP: "Ayuda",
  13237. HELP_NAVIGATION_TAB: "Navegación",
  13238. HELP_MORE_HELP_TAB: "Más Ayuda",
  13239. CLOSE: "Cerrar",
  13240. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13241. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13242. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13243. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13244. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13245. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13246. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13247. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13248. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13249. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13250. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13251. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13252. 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.",
  13253. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13254. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13255. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13256. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13257. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13258. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13259. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13260. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13261. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13262. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13263. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13264. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13265. HELP_MORE_HLR_A: "Galería destacada",
  13266. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13267. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13268. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13269. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13270. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13271. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13272. HELP_MORE_TAG_A: "tag™ Posts",
  13273. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13274. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13275. HELP_MORE_ZOOM_A: "Controles de zoom",
  13276. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13277. HELP_MORE_TOUR_A: "Controles de recorrido",
  13278. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13279. HELP_MORE_INSIDE_A: "Vista interior",
  13280. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13281. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13282. HELP_MORE_VR_A: "Modo de realidad virtual",
  13283. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13284. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13285. HELP_MORE_360_A: "360° Views",
  13286. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13287. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13288. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13289. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13290. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13291. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13292. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13293. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13294. WEBVR_LEARN_MORE: "Más información",
  13295. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13296. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13297. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13298. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13299. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13300. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13301. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13302. VR_APP: "port VR App",
  13303. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13304. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13305. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13306. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13307. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13308. VR_PREVIOUS_CAPS: "ANTERIOR",
  13309. VR_NEXT_CAPS: "SIGUIENTE",
  13310. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13311. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13312. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13313. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13314. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13315. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13316. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13317. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13318. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13319. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13320. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13321. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13322. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13323. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13324. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13325. VR_ANDROID_DVICES: "Dispositivos Android",
  13326. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13327. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13328. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13329. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13330. VR_DOWNLOAD_HERE: "Descargar aquí",
  13331. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13332. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13333. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13334. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13335. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13336. SHARE_TO: "Compartir en",
  13337. SHARE_LINK: "Enlace directo",
  13338. SHARE_EXPLORE: "Explorar ",
  13339. SHARE_AT: "en",
  13340. SHARE_WITH: "con",
  13341. SHARE_3D: " en 3D",
  13342. SHARE_COPIED: "¡Copiado!",
  13343. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13344. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13345. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13346. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13347. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13348. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13349. ERROR_GENERIC_ACTIONS_3: " o ",
  13350. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13351. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13352. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13353. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13354. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13355. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13356. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13357. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13358. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13359. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13360. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13361. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13362. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13363. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13364. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13365. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13366. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13367. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13368. LINK_TO_LOCATION: "Enlace a la ubicación",
  13369. MENU_COPY: "Copiar",
  13370. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13371. ROTATE: "Girar",
  13372. INSIDE: "Interior",
  13373. MOVE: "Moverse",
  13374. ZOOM: "Acercar o alejar"
  13375. }
  13376. }
  13377. , {}],
  13378. 113: [function(e, t, i) {
  13379. "use strict";
  13380. t.exports = {
  13381. PAGE_TITLE: "",
  13382. LOADING: "Chargement",
  13383. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13384. POWERED_BY: "alimenté par ",
  13385. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13386. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13387. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13388. PRESENTED_BY: "Présenté par ",
  13389. MORE: "Plus ",
  13390. LESS: "Moins ",
  13391. TAG_CONTENT: "Contenu tag™",
  13392. SHOW: "Montrer",
  13393. HIDE: "Cacher",
  13394. DOLLHOUSE: "Dollhouse",
  13395. FLOOR_PLAN: "Plan de sol",
  13396. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13397. CLOSE_HIGHLIGHTS: "Fermer",
  13398. PREVIOUS: "Précédent",
  13399. PLAY: "Lecture",
  13400. PAUSE: "Pause",
  13401. NEXT: "Suivant",
  13402. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13403. VIEW_DOLLHOUSE: "Voir dollhouse",
  13404. SOCIAL_SHARING: "Partager cet espace",
  13405. VIEW_IN_VR: "Voir en VR",
  13406. VIEW_FULLSCREEN: "Plein écran",
  13407. EXIT_FULLSCREEN: "Fermer plein écran",
  13408. ZOOM_IN: "Zoom avant",
  13409. ZOOM_OUT: "Zoom arrière",
  13410. FLOOR_NAME: "Étage ",
  13411. FLOOR_ALL: "Tous",
  13412. TERMS: "Mentions légales",
  13413. PORT_TERMS: "port mentions légales",
  13414. TERMS_OF_USE: "Conditions d'utilisation",
  13415. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13416. CLOSE_TERMS: "Fermer",
  13417. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13418. HELP: "Aide",
  13419. HELP_NAVIGATION_TAB: "Navigation",
  13420. HELP_MORE_HELP_TAB: "Aide",
  13421. CLOSE: "Fermer",
  13422. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13423. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13424. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13425. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13426. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13427. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13428. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13429. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13430. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13431. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13432. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13433. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13434. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13435. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13436. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13437. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13438. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13439. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13440. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13441. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13442. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13443. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13444. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13445. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13446. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13447. HELP_MORE_HLR_A: "Carrousel",
  13448. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13449. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13450. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13451. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13452. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13453. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13454. HELP_MORE_TAG_A: "tag™ Posts",
  13455. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13456. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13457. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13458. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13459. HELP_MORE_TOUR_A: "Commandes de la visite",
  13460. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13461. HELP_MORE_INSIDE_A: "Vue intérieure",
  13462. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13463. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13464. HELP_MORE_VR_A: "Mode RV",
  13465. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13466. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13467. HELP_MORE_360_A: "Vues 360°",
  13468. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13469. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13470. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13471. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13472. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13473. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13474. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13475. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13476. WEBVR_LEARN_MORE: "En savoir plus",
  13477. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13478. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13479. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13480. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13481. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13482. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13483. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13484. VR_NEXT_CAPS: "SUIVANT",
  13485. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13486. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13487. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13488. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13489. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13490. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13491. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13492. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13493. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13494. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13495. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13496. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13497. VR_APP: "port VR App",
  13498. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13499. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13500. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13501. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13502. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13503. 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",
  13504. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13505. VR_ANDROID_DVICES: "Appareils Android",
  13506. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13507. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13508. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13509. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13510. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13511. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13512. VR_DOWNLOAD_HERE: "Télécharger ici",
  13513. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13514. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13515. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13516. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13517. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13518. SHARE_TO: "Partager sur",
  13519. SHARE_LINK: "Lien direct",
  13520. SHARE_EXPLORE: "Explorer ",
  13521. SHARE_AT: "à",
  13522. SHARE_WITH: "avec",
  13523. SHARE_3D: " en 3D",
  13524. SHARE_COPIED: "Copié!",
  13525. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13526. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13527. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13528. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13529. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13530. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13531. ERROR_GENERIC_ACTIONS_3: " ou ",
  13532. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13533. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13534. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13535. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13536. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13537. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13538. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13539. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13540. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13541. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13542. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13543. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13544. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13545. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13546. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13547. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13548. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13549. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13550. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13551. MENU_COPY: "Copie",
  13552. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13553. ROTATE: "Faire pivoter",
  13554. INSIDE: "Intérieure",
  13555. MOVE: "Se déplacer",
  13556. ZOOM: "Zoom"
  13557. }
  13558. }
  13559. , {}],
  13560. 114: [function(e, t, i) {
  13561. "use strict";
  13562. t.exports = {
  13563. PAGE_TITLE: "",
  13564. LOADING: "読み込み中",
  13565. PRESENTED_BY_CAPS: "PRESENTED BY",
  13566. POWERED_BY: "powered by",
  13567. POWERED_BY_CAPS: "POWERED BY",
  13568. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13569. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13570. PRESENTED_BY: "Presented by ",
  13571. MORE: "全て表示 ",
  13572. LESS: "閉じる ",
  13573. TAG_CONTENT: "tag™コンテンツ ",
  13574. SHOW: "表示",
  13575. HIDE: "非表示",
  13576. DOLLHOUSE: "ドールハウス",
  13577. FLOOR_PLAN: "フロアプラン",
  13578. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13579. CLOSE_HIGHLIGHTS: "閉じる",
  13580. PREVIOUS: "前へ",
  13581. PLAY: "再生",
  13582. PAUSE: "一時停止",
  13583. NEXT: "次へ",
  13584. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13585. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13586. SOCIAL_SHARING: "このSpaceを共有する",
  13587. VIEW_IN_VR: "VRで表示",
  13588. VIEW_FULLSCREEN: "フルスクリーン表示",
  13589. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13590. ZOOM_IN: "ズームイン",
  13591. ZOOM_OUT: "ズームアウト",
  13592. FLOOR_NAME: "フロア ",
  13593. FLOOR_ALL: "すべて",
  13594. TERMS: "規約",
  13595. PORT_TERMS: "port規約",
  13596. TERMS_OF_USE: "利用規約",
  13597. CLOSE_TERMS: "閉じる",
  13598. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13599. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13600. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13601. WEBVR_ENTER_WEBVR: "VRに入る",
  13602. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13603. WEBVR_LEARN_MORE: "もっと詳しく",
  13604. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13605. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13606. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13607. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13608. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13609. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13610. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13611. VR_PREVIOUS_CAPS: "前へ",
  13612. VR_NEXT_CAPS: "次へ",
  13613. VR_GOT_IT_CAPS: "了解",
  13614. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13615. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13616. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13617. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13618. VR_WHAT_YOU_NEED: "必要なもの",
  13619. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13620. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13621. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13622. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13623. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13624. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13625. VR_APP: "port VRアプリ",
  13626. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13627. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13628. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13629. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13630. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13631. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13632. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13633. VR_ANDROID_DVICES: "Androidデバイス",
  13634. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13635. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13636. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13637. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13638. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13639. VR_APP_OPEN: "port VRアプリで開く",
  13640. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13641. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13642. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13643. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13644. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13645. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13646. SHARE_TO: "共有先",
  13647. SHARE_LINK: "ダイレクトリンク",
  13648. SHARE_EXPLORE: "探索",
  13649. SHARE_AT: "場所",
  13650. SHARE_WITH: "使用アプリ",
  13651. SHARE_3D: "3Dで",
  13652. SHARE_COPIED: "コピーされました!",
  13653. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13654. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13655. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13656. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13657. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13658. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13659. ERROR_GENERIC_ACTIONS_3: "または",
  13660. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13661. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13662. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13663. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13664. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13665. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13666. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13667. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13668. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13669. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13670. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13671. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13672. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13673. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13674. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13675. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13676. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13677. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13678. LINK_TO_LOCATION: "ロケーションへのリンク",
  13679. MENU_COPY: "コピー",
  13680. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13681. ROTATE: "回転",
  13682. MOVE: "移動",
  13683. INSIDE: "内側",
  13684. ZOOM: "ズーム",
  13685. HELP: "ヘルプ",
  13686. HELP_NAVIGATION_TAB: "ナビゲーション",
  13687. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13688. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13689. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13690. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13691. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13692. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13693. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13694. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13695. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13696. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13697. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13698. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13699. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13700. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13701. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13702. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13703. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13704. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13705. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13706. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13707. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13708. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13709. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13710. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13711. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13712. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13713. HELP_MORE_HLR_A: "ハイライト",
  13714. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13715. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13716. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13717. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13718. HELP_MORE_FLOORS_A: "フロアセレクター",
  13719. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13720. HELP_MORE_TAG_A: "tag™ Posts",
  13721. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13722. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13723. HELP_MORE_ZOOM_A: "ズームコントロール",
  13724. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13725. HELP_MORE_TOUR_A: "ツアーコントロール",
  13726. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13727. HELP_MORE_INSIDE_A: "内側ビュー",
  13728. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13729. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13730. HELP_MORE_VR_A: "VRモード",
  13731. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13732. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13733. HELP_MORE_360_A: "360° Views",
  13734. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13735. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13736. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13737. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13738. CLOSE: "閉じる"
  13739. }
  13740. }
  13741. , {}],
  13742. 115: [function(e, t, i) {
  13743. "use strict";
  13744. t.exports = {
  13745. PAGE_TITLE: "",
  13746. LOADING: "Загрузка",
  13747. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13748. POWERED_BY: "разработано на платформе ",
  13749. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13750. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13751. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13752. PRESENTED_BY: "Представлено ",
  13753. MORE: "Больше ",
  13754. LESS: "Меньше ",
  13755. TAG_CONTENT: "tag™ Контент",
  13756. SHOW: "Показать",
  13757. HIDE: "Скрыть",
  13758. DOLLHOUSE: "Dollhouse",
  13759. FLOOR_PLAN: "Планировка",
  13760. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13761. CLOSE_HIGHLIGHTS: "Закрыть",
  13762. PREVIOUS: "Предыдущий",
  13763. PLAY: "Воспроизвести",
  13764. PAUSE: "Пауза",
  13765. NEXT: "Следующий",
  13766. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13767. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13768. SOCIAL_SHARING: "Поделиться этой моделью",
  13769. VIEW_IN_VR: "Посмотреть в VR",
  13770. VIEW_FULLSCREEN: "Полный экран",
  13771. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13772. ZOOM_IN: "Увеличить",
  13773. ZOOM_OUT: "Уменьшить",
  13774. FLOOR_NAME: "Этаж ",
  13775. FLOOR_ALL: "Все",
  13776. TERMS: "Условия",
  13777. PORT_TERMS: "Правила пользования",
  13778. TERMS_OF_USE: "Условия использования",
  13779. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13780. CLOSE_TERMS: "Закрыть",
  13781. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13782. HELP: "Помощь",
  13783. HELP_NAVIGATION_TAB: "Навигация",
  13784. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13785. CLOSE: "Закрыть",
  13786. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13787. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13788. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13789. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13790. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13791. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13792. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13793. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13794. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13795. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13796. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13797. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13798. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13799. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13800. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13801. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13802. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13803. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13804. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13805. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13806. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13807. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13808. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13809. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13810. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13811. HELP_MORE_HLR_A: "Фотоколлаж",
  13812. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13813. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13814. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13815. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13816. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13817. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13818. HELP_MORE_TAG_A: "tag™ Posts",
  13819. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13820. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13821. HELP_MORE_ZOOM_A: "Масштаб",
  13822. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13823. HELP_MORE_TOUR_A: "Управление Туром",
  13824. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13825. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13826. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13827. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13828. HELP_MORE_VR_A: "Режим VR",
  13829. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13830. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13831. HELP_MORE_360_A: "360° Views",
  13832. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13833. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13834. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13835. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13836. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13837. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13838. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13839. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13840. WEBVR_LEARN_MORE: "Узнать больше",
  13841. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13842. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13843. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13844. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13845. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13846. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13847. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13848. VR_APP: "port VR App",
  13849. VR_APP_OPEN: "Или открыть через приложение port VR",
  13850. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13851. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13852. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13853. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13854. VR_VIEW_SPACE: "Запустить модель в VR",
  13855. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13856. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13857. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13858. VR_GOT_IT_CAPS: "ЯСНО",
  13859. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13860. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13861. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13862. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13863. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13864. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13865. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13866. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13867. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13868. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13869. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13870. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13871. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13872. VR_ANDROID_DVICES: "Android устройства",
  13873. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13874. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13875. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13876. VR_DOWNLOAD_HERE: "Скачать здесь",
  13877. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13878. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13879. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13880. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13881. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13882. SHARE_TO: "Поделиться",
  13883. SHARE_LINK: "Прямая ссылка",
  13884. SHARE_EXPLORE: "просмотреть",
  13885. SHARE_AT: "на",
  13886. SHARE_WITH: "с",
  13887. SHARE_3D: "в 3D",
  13888. SHARE_COPIED: "Скопировано!",
  13889. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13890. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13891. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13892. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13893. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13894. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13895. ERROR_GENERIC_ACTIONS_3: " или ",
  13896. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13897. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13898. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13899. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13900. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13901. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13902. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13903. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13904. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13905. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13906. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13907. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13908. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13909. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13910. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13911. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13912. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13913. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13914. LINK_TO_LOCATION: "Ссылка на местоположение",
  13915. MENU_COPY: "Копировать",
  13916. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13917. ROTATE: "Вращать",
  13918. MOVE: "Передвигаться",
  13919. INSIDE: "Вид изнутри",
  13920. ZOOM: "Масштаб"
  13921. }
  13922. }
  13923. , {}],
  13924. 116: [function(r, e, t) {
  13925. (function(i) {
  13926. "use strict";
  13927. function re(e) {
  13928. console.log("e1:" + e),
  13929. e = Math.round(.4 * e * 100),
  13930. console.log("e2:" + e);
  13931. var t = $(".progressbar");
  13932. t.find(".bar").css("width", e + "%"),
  13933. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13934. t.find(".perc").text(e + "%")
  13935. }
  13936. $("#gui-loading").fadeIn(200),
  13937. re(.1);
  13938. var e = g_version ? "modeldata.js" : "someData.json";
  13939. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13940. dataType: "json"
  13941. }).done(function(e) {
  13942. var t = matcher(e);
  13943. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13944. t.user = {
  13945. is_authenticated: !1,
  13946. 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"]
  13947. }
  13948. try{//处理一下导览数据
  13949. t.model.images = t.model.images.filter(e=>{
  13950. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  13951. if(e.locations)e.locations = e.locations.filter(e=>e)
  13952. if(e.locations && e.locations.length == 0)return;
  13953. return e
  13954. })
  13955. }catch(e){console.log(e) }
  13956. window.editTool = new EditTools()
  13957. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  13958. window.DATA = t
  13959. window.DATA.puckHeight || window.DATA.info && window.DATA.info.puckHeight && (window.DATA.puckHeight = window.DATA.info.puckHeight)
  13960. window.PuckHeightHelper && (window.DATA.puckHeight = window.PuckHeightHelper.normalizeConfig(window.DATA.puckHeight))
  13961. settings.playTourNearBy = !DATA.tourFromStart
  13962. t.model.summary = t.summary
  13963. t.model.name = t.name
  13964. for(let i in t){
  13965. t[i] == "false" && (t[i] = false)
  13966. }
  13967. re(.7),
  13968. function() {
  13969. function y(e) {
  13970. t.update(e)
  13971. }
  13972. function A(e, t) {
  13973. ne.error(t),
  13974. n.error(t),
  13975. N.report(e, "error-" + t)
  13976. }
  13977. function C(e, t, i) {
  13978. try {
  13979. e.start(t)
  13980. } catch (e) {
  13981. throw ne.warn(e.message),
  13982. function(e) {
  13983. var t = O.details();
  13984. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13985. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13986. N.report(e, "error-webgl-generic"))
  13987. }(i.sid),
  13988. e
  13989. }
  13990. }
  13991. function I(e) {
  13992. e.stopPropagation(),
  13993. e.preventDefault()
  13994. }
  13995. window.DATA.hoticon && (g_HotImage = {
  13996. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13997. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13998. });
  13999. if (window.DATA.backgroundMusic && window.isLocal) {
  14000. window.DATA.backgroundMusic = manage.dealURL(window.DATA.backgroundMusic)
  14001. }else if (g_version === "one"){
  14002. window.DATA.backgroundMusic = manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3")
  14003. }
  14004. if (window.DATA.backgroundMusic) {
  14005. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14006. $("#volume").show();
  14007. }
  14008. //隐藏公司logo
  14009. window.DATA.loadlogo && showLogo();
  14010. // 隐藏顶部介绍
  14011. window.DATA.topText && topTextHide();
  14012. r("./lib/three75-shim"),
  14013. r("./lib/array-polyfill"),
  14014. r("./lib/performance-polyfill"),
  14015. r("./lib/shaders/CopyShader.js"),
  14016. r("./lib/shaders/HorizontalBlurShader.js"),
  14017. r("./lib/shaders/VerticalBlurShader.js"),
  14018. r("./lib/postprocessing/EffectComposer.js"),
  14019. r("./lib/postprocessing/RenderPass.js"),
  14020. r("./lib/postprocessing/MaskPass.js"),
  14021. r("./lib/postprocessing/ShaderPass.js"),
  14022. window.Promise || (window.Promise = r("promise-polyfill"));
  14023. var E = r("three")
  14024. , _ = r("three")
  14025. , b = (r("./util/sentry"),
  14026. r("./player"))
  14027. , w = r("./director")
  14028. , T = r("./controls/CameraControls")
  14029. , x = r("./model/ModelManager")
  14030. , S = r("./DisplayController")
  14031. , M = r("./label/LabelDisplayController")
  14032. , R = r("./enum/Viewmode")
  14033. , e = r("./util/logger")
  14034. , P = r("./showcase")
  14035. , O = r("./util/browser")
  14036. , L = r("./settings")
  14037. , D = r("./gui/gui")
  14038. , n = r("./gui/error")
  14039. , N = r("./analytics")
  14040. , F = r("./util/transitions")
  14041. , B = r("./effects")
  14042. , V = r("./objects/Skybox")
  14043. , k = (r("./util/common"),
  14044. r("./util/PanoramaCollection"),
  14045. r("./util/math"),
  14046. r("./util/showcase"))
  14047. , U = r("./util/camera")
  14048. , H = (r("./objects/Panorama"),
  14049. r("./cameras/PanoramaCamera"),
  14050. r("./preloaders"))
  14051. , z = r("events").EventEmitter
  14052. , G = r("./featureflags")
  14053. , W = (r("./util/lerp"),
  14054. r("./util/ajax"),
  14055. r("./ab"))
  14056. , j = r("./sdk/automation.js")
  14057. , Y = r("./scene/SceneRenderer")
  14058. , q = r("./scene/QuickstartManager")
  14059. , X = r("./tile/QualityManager.js")
  14060. , Z = r("./localization/localize")
  14061. , K = r("./tag/tagManager")
  14062. , Q = r("./tile/TileDownloader")
  14063. , J = r("./tile/PanoRenderer")
  14064. , ee = (r("./enum/PanoSizeClass"),
  14065. r("./enum/PanoramaEvents"),
  14066. r("./enum/SceneRendererEvents"))
  14067. , t = r("./gui/memoryUsage")
  14068. , te = r("./enum/RenderLayers")
  14069. , ie = r("./TimingData")
  14070. , ne = new e(i);
  14071. e.level = L.logLevel,
  14072. e.consoleEnabled = L.console,
  14073. function() {
  14074. var e = window.number//k.getModelIDFromQueryString();
  14075. if (!e)
  14076. return A(null, "loading-failed");
  14077. var t = k.parseSidUrl(e)
  14078. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14079. , n = {
  14080. panoElementsToLoad: 6,
  14081. modelElementsToLoad: 0,
  14082. totalElementsLoaded: 0,
  14083. totalElementsToLoad: 0,
  14084. totalPercentageLoaded: 0,
  14085. progressCallback: null
  14086. }
  14087. , r = document.getElementById("player")
  14088. , o = L.quickstart.enabled
  14089. , a = null
  14090. , s = null
  14091. , l = null
  14092. , c = null
  14093. , h = null
  14094. , u = null
  14095. , d = null
  14096. , p = null
  14097. , f = null
  14098. , g = null
  14099. , m = null
  14100. , v = new ie;
  14101. !function(e) {
  14102. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14103. z.defaultMaxListeners = 1e3,
  14104. function(e) {
  14105. e.addEventListener("dragenter", I, !1),
  14106. e.addEventListener("dragover", I, !1)
  14107. }(e),
  14108. O.valueFromHash("title", !0) || $(document).ready(function() {
  14109. $(".model-title").hide()
  14110. })
  14111. }(r),
  14112. function(e) {
  14113. return G.loadFeatureFlags(e).done(function(e) {
  14114. G.updateDependentSettings(e, L)
  14115. })
  14116. }({
  14117. urlBase: t.urlBase
  14118. }).then(function() {
  14119. return Z.init(),
  14120. function(e, t) {
  14121. var i = P.getModel({
  14122. url: t,
  14123. floors: O.valueFromHash("f", !0),
  14124. autoload: !1
  14125. });
  14126. return $.when(i, y).then(null, function(e) {
  14127. return this
  14128. })
  14129. }(0, e)
  14130. }).then(function(e) {
  14131. return re(.9),
  14132. function(e, t, i, n, r) {
  14133. ne.info("Model data loaded"),
  14134. ne.debug("UUID: " + e.data.job.uuid),
  14135. W.init(G.getFlags()),
  14136. i && N.initKeen({
  14137. token: i,
  14138. appId: n
  14139. }),
  14140. N.initSegment({
  14141. model: e.sid,
  14142. version: "2.25.6-0-gd87e5b1",
  14143. startSource: r.startSource,
  14144. token: t,
  14145. autoplay: r.autoplay,
  14146. quickstart: r.quickstart
  14147. })
  14148. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14149. startSource: i,
  14150. autoplay: L.autoplay,
  14151. quickstart: o
  14152. }),
  14153. g.urls.init()
  14154. }).then(function() {
  14155. return g.loadPanos()
  14156. }).then(function() {
  14157. s = U.getStartCameraOptions(g, g.panos);
  14158. //初始画面
  14159. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14160. $("<img/>").attr("src", e).on("load", function() {
  14161. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14162. $(this).remove()
  14163. $(".screen .shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14164. })
  14165. }(window.DATA.camera_start.thumbImg);
  14166. {//初始化导览时间
  14167. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14168. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14169. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14170. /* if(DATA.tourWalkSpeed!=void 0){
  14171. let r = 100 / DATA.tourWalkSpeed;
  14172. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14173. window._settings.warp.flyTime = settings.flyTime * r
  14174. }else{
  14175. window._settings.warp.flyTime = settings.flyTime
  14176. } */
  14177. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14178. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14179. }
  14180. }
  14181. {//其他
  14182. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14183. _settings.angleShift2d = DATA.angleShift2d || 0
  14184. if(DATA.insideLookLimit){
  14185. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14186. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14187. }
  14188. }
  14189. d = function(e) {
  14190. var t = new E.PerspectiveCamera;
  14191. t.layers.enable(te.PANOMARKERS),
  14192. t.layers.enable(te.RETICULE),
  14193. t.layers.enable(te.TAG);
  14194. var o = new E.Scene
  14195. , i = new E.AmbientLight(16777215);
  14196. return o.add(i),
  14197. o.skybox = new V,
  14198. o.add(o.skybox),
  14199. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14200. side: E.DoubleSide
  14201. })),
  14202. o.plane.position.y = 0,
  14203. o.plane.rotateX(-Math.PI / 2),
  14204. o.plane.material.visible = !1,
  14205. o.add(o.plane),
  14206. o.updateMatrixWorld(),
  14207. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14208. if (e.metadata && e.metadata.camera_position) {
  14209. var t = e.metadata.camera_position
  14210. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14211. i.position = t.clone(),
  14212. o.add(i);
  14213. var n = e.metadata.camera_quaternion
  14214. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14215. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14216. }
  14217. }),
  14218. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14219. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14220. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14221. new Y(o,t,B)
  14222. }(g),
  14223. m = function(e, t) {
  14224. var i = e ? 1 : 1e3
  14225. , n = W.tilegen || W.imgopt ? 6 : 2;
  14226. n = O.valueFromHash("tileconc", n);
  14227. var r = new X
  14228. , o = new Q({
  14229. concurrentDownloads: n
  14230. })
  14231. , a = new J
  14232. , s = new x
  14233. , l = new w
  14234. , c = new b(t)
  14235. , h = new T
  14236. , u = new S(i)
  14237. , d = new M
  14238. , p = new K;
  14239. return {
  14240. qualityManager: r,
  14241. panoRenderer: a,
  14242. tileDownloader: o,
  14243. player: c,
  14244. director: l,
  14245. modelManager: s,
  14246. tagManager: p,
  14247. displayController: u,
  14248. labelDisplayController: d,
  14249. controls: h
  14250. }
  14251. }(o, s.mode),
  14252. l = m.controls,
  14253. c = m.player,
  14254. h = m.director,
  14255. u = m.tagManager,
  14256. p = m.tileDownloader,
  14257. f = m.qualityManager,
  14258. m.panoRenderer,
  14259. function(e, t, i, n) {
  14260. var r = i.controls
  14261. , o = i.qualityManager
  14262. , a = i.panoRenderer
  14263. , s = i.tileDownloader
  14264. , l = i.modelManager;
  14265. r.init(n, l),
  14266. j.init(i.director, r, i.player, l, t),
  14267. o.init(l),
  14268. s.init(o),
  14269. a.init(t, s, o),
  14270. l.init(s, a, o),
  14271. l.addModel(e),
  14272. t.addComponent(F)
  14273. }(g, d, m, r),
  14274. c.director = h,
  14275. g.supportsTiles && p.start(),
  14276. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14277. o = !1);
  14278. var e = null;
  14279. if (o) {
  14280. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14281. var t = l.controls[R.PANORAMA];
  14282. a = new q(f,d.scene,d.camera,t,r),
  14283. C(d, r, g),
  14284. e = a.load(s).then(function() {
  14285. d.addComponent(a),
  14286. d.once(ee.AfterRender, function() {
  14287. ne.warn("First render after quickstart load finished.")
  14288. })
  14289. })
  14290. }
  14291. return window.flyToFirst = function() {
  14292. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14293. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14294. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14295. c.flyToPano({
  14296. pano: e,
  14297. lookAtPoint: i
  14298. })
  14299. }
  14300. ,
  14301. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14302. }).then(function() {
  14303. return function(e, t, i, n, r) {
  14304. return r.progressCallback = t,
  14305. N.sessionStart(),
  14306. e.load(n).progress(function(e, t) {
  14307. e.modelElementsToLoad = t[1],
  14308. function(e) {
  14309. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14310. }(e),
  14311. function(e) {
  14312. e.totalElementsLoaded++,
  14313. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14314. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14315. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14316. console.log("pro:" + e.totalPercentageLoaded),
  14317. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14318. }(e)
  14319. }
  14320. .bind(this, r))
  14321. }(g, D.onProgress, 0, !o, n)
  14322. }).then(function() {
  14323. s.quickstart = o,
  14324. function(e, t, i, n) {
  14325. var r = i.qualityManager
  14326. , o = i.panoRenderer
  14327. , a = i.tileDownloader
  14328. , s = i.modelManager
  14329. , l = i.player
  14330. , c = i.director
  14331. , h = i.tagManager
  14332. , u = i.displayController
  14333. , d = i.labelDisplayController
  14334. , p = i.controls;
  14335. t.scene.add(e),
  14336. t.qualityManager = r;
  14337. var f = {
  14338. camera: t.camera,
  14339. director: c,
  14340. modelManager: s,
  14341. tileDownloader: a,
  14342. panoRenderer: o,
  14343. qualityManager: r,
  14344. tagManager: h,
  14345. container: n,
  14346. controls: p
  14347. };
  14348. l.init(f),
  14349. l.setScene(t.scene),
  14350. h.init(s, l),
  14351. c.init(l, s),
  14352. u.init(c, l, s, h, n),
  14353. d.init(l, s, n),
  14354. B.bindEvents(l),
  14355. t.addComponent(h),
  14356. t.addComponent(l),
  14357. t.addComponent(o),
  14358. l.sceneRenderer = t
  14359. }(g, d, m, r),
  14360. d.started || C(d, r, g),
  14361. N.modelLoaded(g, c, l, L.autoplay),
  14362. function(e, t, i, n) {
  14363. return ne.info("Starting player in " + i.mode),
  14364. N.report(t.sid, "started-playing", n, i.quickstart),
  14365. e.start(i)
  14366. }(c, g, s, L.autoplay).done(function() {
  14367. h.autoTour()
  14368. }),
  14369. g.supportsTiles || new H(g,c).start();
  14370. o && (d.removeComponent(a),
  14371. a.destroy(),
  14372. s.pano.enter()),
  14373. D.init(g, h, c, l, d, s, N.getSessionId()),
  14374. D.endLoading(g, h, u),
  14375. d.once(ee.AfterRender, function() {
  14376. v.setAppReadyTime();
  14377. var e = v.calcFullLoadingTime();
  14378. ne.warn("Total load time: " + e / 1e3),
  14379. N.loadComplete(e),
  14380. ne.warn("First render after model load finished.");
  14381. editTool.loadDone('data', window.DATA)
  14382. }),
  14383. d.on(ee.MemoryUsageUpdated, y)
  14384. }).fail(A.bind(this, e))
  14385. }()
  14386. }()
  14387. }).fail(e=>{
  14388. alert("缺少someData文件,请检查场景码是否正确。")
  14389. })
  14390. }
  14391. ).call(this, "/js/main.js")
  14392. }
  14393. , {
  14394. "./DisplayController": 1,
  14395. "./TimingData": 2,
  14396. "./ab": 3,
  14397. "./analytics": 4,
  14398. "./cameras/PanoramaCamera": 7,
  14399. "./controls/CameraControls": 9,
  14400. "./director": 15,
  14401. "./effects": 16,
  14402. "./enum/PanoSizeClass": 36,
  14403. "./enum/PanoramaEvents": 37,
  14404. "./enum/RenderLayers": 41,
  14405. "./enum/SceneRendererEvents": 43,
  14406. "./enum/Viewmode": 51,
  14407. "./featureflags": 59,
  14408. "./gui/error": 64,
  14409. "./gui/gui": 65,
  14410. "./gui/memoryUsage": 73,
  14411. "./label/LabelDisplayController": 91,
  14412. "./lib/array-polyfill": 92,
  14413. "./lib/performance-polyfill": 95,
  14414. "./lib/postprocessing/EffectComposer.js": 96,
  14415. "./lib/postprocessing/MaskPass.js": 97,
  14416. "./lib/postprocessing/RenderPass.js": 98,
  14417. "./lib/postprocessing/ShaderPass.js": 99,
  14418. "./lib/shaders/CopyShader.js": 100,
  14419. "./lib/shaders/HorizontalBlurShader.js": 101,
  14420. "./lib/shaders/VerticalBlurShader.js": 102,
  14421. "./lib/three75-shim": 103,
  14422. "./localization/localize": 108,
  14423. "./tag/tagManager": 124,
  14424. "./model/ModelManager": 140,
  14425. "./objects/Panorama": 148,
  14426. "./objects/Skybox": 152,
  14427. "./player": 155,
  14428. "./preloaders": 156,
  14429. "./scene/QuickstartManager": 157,
  14430. "./scene/SceneRenderer": 158,
  14431. "./sdk/automation.js": 164,
  14432. "./settings": 166,
  14433. "./showcase": 168,
  14434. "./tile/PanoRenderer": 169,
  14435. "./tile/QualityManager.js": 170,
  14436. "./tile/TileDownloader": 171,
  14437. "./util/PanoramaCollection": 178,
  14438. "./util/ajax": 181,
  14439. "./util/browser": 182,
  14440. "./util/camera": 183,
  14441. "./util/common": 185,
  14442. "./util/lerp": 188,
  14443. "./util/logger": 189,
  14444. "./util/math": 190,
  14445. "./util/sentry": 192,
  14446. "./util/showcase": 193,
  14447. "./util/transitions": 195,
  14448. events: 202,
  14449. "promise-polyfill": 213,
  14450. three: 217
  14451. }],
  14452. 117: [function(e, t, i) {
  14453. "use strict";
  14454. function n(e) {
  14455. e = e || {},
  14456. r.RawShaderMaterial.call(this, a.extendObject({
  14457. fragmentShader: o.cube.fragmentShader,
  14458. vertexShader: o.cube.vertexShader,
  14459. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14460. name: "CubemapMaterial"
  14461. }, e))
  14462. }
  14463. var r = e("three")
  14464. , o = e("../shaders")
  14465. , a = e("../util/common");
  14466. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14467. t.exports = n
  14468. }
  14469. , {
  14470. "../shaders": 167,
  14471. "../util/common": 185,
  14472. three: 217
  14473. }],
  14474. 118: [function(e, t, i) {
  14475. "use strict";
  14476. function n(e) {
  14477. e = e || {},
  14478. r.RawShaderMaterial.call(this, a.extendObject({
  14479. fragmentShader: o.model.fragmentShader,
  14480. vertexShader: o.model.vertexShader,
  14481. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14482. name: "ModelTextureMaterial"
  14483. }, e))
  14484. }
  14485. var r = e("three")
  14486. , o = e("../shaders")
  14487. , a = e("../util/common");
  14488. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14489. i && (this.uniforms.progress.value = 0),
  14490. e.ensureSkyboxReadyForRender(),
  14491. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14492. this.uniforms.pano0Position.value.copy(e.position),
  14493. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14494. t.ensureSkyboxReadyForRender(),
  14495. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14496. this.uniforms.pano1Position.value.copy(t.position),
  14497. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14498. }
  14499. ,
  14500. t.exports = n
  14501. }
  14502. , {
  14503. "../shaders": 167,
  14504. "../util/common": 185,
  14505. three: 217
  14506. }],
  14507. 119: [function(m, v, e) {
  14508. (function(e) {
  14509. "use strict";
  14510. function t(e, t, i, n) {
  14511. this.div = null,
  14512. this.body = null,
  14513. this.label = e,
  14514. this.description = t,
  14515. this.parsedDescription = [],
  14516. this.media = i || {
  14517. type: null
  14518. },
  14519. this.loadingSpinner = null,
  14520. this.parser = new r({
  14521. supportLinks: !c.valueFromHash("mls"),
  14522. keepLinkLabels: !0
  14523. }),
  14524. this.state = g.CLOSED,
  14525. this.orientation = "",
  14526. this.initialTransform = "",
  14527. this.hovering = !1,
  14528. this.openTransition = null,
  14529. this.closeTransition = null,
  14530. this.openPromise = null,
  14531. this.closePromise = null,
  14532. this.animationTransition = null,
  14533. this.animationScale = 0
  14534. }
  14535. var r = m("../Parser/DescriptionParser")
  14536. , i = m("../Media/Link")
  14537. , n = m("../Media/Image")
  14538. , o = m("../Media/EmbedlyPlayer")
  14539. , a = m("../Media/EmbedlyEmbed")
  14540. , s = m("../../util/transitions")
  14541. , l = m("../../util/lerp")
  14542. , c = m("../../util/browser")
  14543. , b = m("./BillboardEvent")
  14544. , w = m("../Media/MediaEvent")
  14545. , h = m("../Parser/DescriptionChunkType")
  14546. , u = m("events").EventEmitter
  14547. , d = m("./billboardSettings")
  14548. , T = m("./overlaySettings")
  14549. , p = new (m("../../util/logger"))(e)
  14550. , f = document.getElementById("tag-billboards");
  14551. f.addEventListener("touchend", function(e) {
  14552. f.style.pointerEvents = "none"
  14553. }),
  14554. f.addEventListener("touchcancel", function(e) {
  14555. f.style.pointerEvents = "none"
  14556. });
  14557. var g = {
  14558. CLOSED: "closed",
  14559. OPENING: "opening",
  14560. OPEN: "open",
  14561. CLOSING: "closing",
  14562. ACTIVE: "active"
  14563. };
  14564. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14565. this.parsedDescription = this.parser.parse(this.description);
  14566. var t = document.createElement("div");
  14567. t.className = "tag-container has-hotzone",
  14568. this.div = t,
  14569. this.body = document.createElement("div"),
  14570. this.body.className = "tag-body";
  14571. var i = document.createElement("div");
  14572. i.classList.add("tag-content");
  14573. var n = document.createElement("div");
  14574. n.classList.add("tag-text-content");
  14575. var r = document.createElement("div");
  14576. r.className = "tag-label",
  14577. r.textContent = this.label,
  14578. n.appendChild(r);
  14579. var o = document.createElement("div");
  14580. o.className = "tag-desc",
  14581. n.appendChild(o),
  14582. i.appendChild(n),
  14583. this.body.appendChild(i),
  14584. this.appendDescriptionElements(this.parsedDescription, o),
  14585. this.appendMedia(),
  14586. t.appendChild(this.body),
  14587. f.appendChild(t),
  14588. this.bindEvents(t, this.body)
  14589. }
  14590. ,
  14591. t.prototype.bindEvents = function(i, e) {
  14592. function t(n) {
  14593. return function(e) {
  14594. if (!this.div.classList.contains("overlay")) {
  14595. var t, i = document.getElementById("player");
  14596. try {
  14597. t = new MouseEvent(n,e)
  14598. } catch (i) {
  14599. (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)
  14600. }
  14601. i.dispatchEvent(t)
  14602. }
  14603. }
  14604. }
  14605. e.addEventListener("mousedown", function(e) {
  14606. e.stopPropagation()
  14607. }),
  14608. e.addEventListener("mouseup", function(e) {
  14609. e.stopPropagation()
  14610. }),
  14611. i.addEventListener("touchstart", function(e) {
  14612. f.style.pointerEvents = "auto"
  14613. }),
  14614. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14615. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14616. e.addEventListener("mouseover", function(e) {
  14617. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14618. }
  14619. .bind(this)),
  14620. i.addEventListener("mouseenter", function(e) {
  14621. this.state !== g.CLOSING && (this.hovering = !0,
  14622. this.emit(b.ENTER))
  14623. }
  14624. .bind(this)),
  14625. i.addEventListener("mouseleave", function(e) {
  14626. this.hovering = !1,
  14627. this.emit(b.LEAVE)
  14628. }
  14629. .bind(this)),
  14630. i.addEventListener("gesturestart", function(e) {
  14631. e.preventDefault()
  14632. });
  14633. var n = i.querySelector(".tag-text-content")
  14634. , r = 0;
  14635. n.addEventListener("touchstart", function(e) {
  14636. r = e.changedTouches[0].clientY
  14637. }),
  14638. n.addEventListener("touchmove", function(t) {
  14639. function e(e) {
  14640. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14641. }
  14642. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14643. }),
  14644. i.addEventListener("touchmove", function(e) {
  14645. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14646. })
  14647. }
  14648. ,
  14649. t.prototype.appendDescriptionElements = function(e, i) {
  14650. 0 < e.length && this.div.classList.add("has-text"),
  14651. e.forEach(function(e, t) {
  14652. switch (e.type) {
  14653. case h.TEXT:
  14654. i.appendChild(this.createTextElement(e.text));
  14655. break;
  14656. case h.LINK:
  14657. i.appendChild(this.createLinkElement(e.link))
  14658. }
  14659. }
  14660. .bind(this))
  14661. }
  14662. ,
  14663. t.prototype.appendLoadingSpinner = function() {
  14664. this.loadingSpinner = document.createElement("div"),
  14665. this.loadingSpinner.classList.add("loading-spinner");
  14666. var e = document.createElement("div");
  14667. e.classList.add("gui-spinner-icon"),
  14668. this.loadingSpinner.appendChild(e),
  14669. this.body.appendChild(this.loadingSpinner)
  14670. }
  14671. ,
  14672. t.prototype.onMediaLoadFinished = function() {
  14673. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14674. this.applyOrientation(this.orientation),
  14675. this.loadingSpinner = null)
  14676. }
  14677. ,
  14678. t.prototype.appendMedia = function() {
  14679. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14680. this.appendLoadingSpinner();
  14681. var e = document.createElement("div");
  14682. e.classList.add("tag-media-content");
  14683. var t = document.createElement("i");
  14684. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14685. t.classList.add(e)
  14686. }),
  14687. this.body.appendChild(t),
  14688. this.body.appendChild(e),
  14689. this.media.type) {
  14690. case h.IMAGE:
  14691. e.appendChild(this.createImageElement(this.media, this.body));
  14692. break;
  14693. case h.VIDEO:
  14694. e.appendChild(this.createVideoElement(this.media, this.body));
  14695. break;
  14696. case h.RICH:
  14697. e.appendChild(this.createEmbedElement(this.media, this.body))
  14698. }
  14699. }
  14700. }
  14701. ,
  14702. t.prototype.createTextElement = function(e) {
  14703. var t = document.createElement("span");
  14704. return t.textContent = e,
  14705. t
  14706. }
  14707. ,
  14708. t.prototype.createLinkElement = function(e) {
  14709. var t = new i(e);
  14710. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14711. t.createDomElement()
  14712. }
  14713. ,
  14714. t.prototype.createImageElement = function(t, C) {
  14715. function e() {
  14716. function e() {
  14717. p || (E.classList.remove("view-image"),
  14718. a.classList.add("overlay"),
  14719. t(),
  14720. window.addEventListener("resize", A),
  14721. a.addEventListener("click", i),
  14722. c.addEventListener("click", r),
  14723. o.addEventListener("click", n),
  14724. p = !0,
  14725. _.emit(w.IMAGE_OPENED))
  14726. }
  14727. function t() {
  14728. C.classList.add("show-info"),
  14729. s.classList.remove("collapsible"),
  14730. s.style.height = "";
  14731. var e = parseFloat(getComputedStyle(v).lineHeight)
  14732. , t = g + e
  14733. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14734. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14735. , r = n
  14736. , o = r * I.aspect;
  14737. i < o && (r = (o = i) / I.aspect),
  14738. n < r && (o = (r = n) * I.aspect),
  14739. o += m,
  14740. r += m + t,
  14741. C.style.width = o + "px",
  14742. C.style.height = r + "px",
  14743. l.style.paddingTop = e + m + "px",
  14744. 0 < _.description.length && (s.classList.add("collapsible"),
  14745. s.style.height = s.clientHeight + 12 + "px",
  14746. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14747. }
  14748. function i(e) {
  14749. e.target === a && n()
  14750. }
  14751. function n() {
  14752. p && (p = !1,
  14753. E.classList.add("view-image"),
  14754. a.classList.remove("overlay"),
  14755. s.style.height = "",
  14756. l.style.paddingTop = "",
  14757. C.style.width = "",
  14758. C.style.height = "",
  14759. window.removeEventListener("resize", A),
  14760. a.removeEventListener("click", i),
  14761. c.removeEventListener("click", r),
  14762. o.removeEventListener("click", n),
  14763. _.emit(w.IMAGE_CLOSED),
  14764. _.close(!0))
  14765. }
  14766. function r(e) {
  14767. C.classList.toggle("show-info")
  14768. }
  14769. var a = _.div
  14770. , s = a.getElementsByClassName("tag-content")[0]
  14771. , l = a.getElementsByClassName("tag-media-content")[0]
  14772. , o = C.getElementsByClassName("close")[0]
  14773. , c = s.getElementsByClassName("tag-label")[0];
  14774. a.classList.add("has-image"),
  14775. E.classList.add("view-image"),
  14776. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14777. _.applyOrientation(_.orientation);
  14778. 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,
  14779. function() {
  14780. clearInterval(h),
  14781. clearTimeout(u),
  14782. h = setInterval(function() {
  14783. var e = a.clientHeight;
  14784. d !== e && (t(),
  14785. d = e)
  14786. }, 100),
  14787. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14788. }
  14789. );
  14790. I.on(w.IMAGE_OPENING, e),
  14791. _.on(b.ACTIVATE, e),
  14792. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14793. _.on(b.CLOSING, n)
  14794. }
  14795. var I = new n
  14796. , E = I.createDomElement();
  14797. this.once(b.OPENED, function() {
  14798. I.load(t.src).then(e).catch(function(e) {
  14799. p.warn("Failed to load image:", t.src),
  14800. p.warn("with error:", e)
  14801. }).then(this.onMediaLoadFinished.bind(this))
  14802. });
  14803. var _ = this;
  14804. return E
  14805. }
  14806. ,
  14807. t.prototype.createVideoElement = function(t, e) {
  14808. var i = new o({
  14809. autoPlay: !0,
  14810. autoResume: !0,
  14811. startMuted: !1,
  14812. loop: !1
  14813. })
  14814. , n = i.createDomElement();
  14815. return this.once(b.OPENED, function() {
  14816. i.load(t.src).then(function() {
  14817. this.div.classList.add("has-video"),
  14818. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14819. i.play()),
  14820. this.on(b.OPENING, i.show.bind(i)),
  14821. this.on(b.OPENED, i.play.bind(i)),
  14822. this.on(b.CLOSING, i.pause.bind(i)),
  14823. this.on(b.CLOSED, i.hide.bind(i))
  14824. }
  14825. .bind(this)).catch(function(e) {
  14826. p.warn("Failed to embed video:", t.src),
  14827. p.warn("with error:", e)
  14828. }).then(this.onMediaLoadFinished.bind(this))
  14829. }
  14830. .bind(this)),
  14831. n
  14832. }
  14833. ,
  14834. t.prototype.createEmbedElement = function(t, e) {
  14835. var i = new a
  14836. , n = i.createDomElement();
  14837. return this.once(b.OPENED, function() {
  14838. i.load(t.src).then(function() {
  14839. this.div.classList.add("has-embed"),
  14840. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14841. this.applyOrientation(this.orientation),
  14842. this.on(b.OPENING, i.show.bind(i)),
  14843. this.on(b.CLOSED, i.hide.bind(i))
  14844. }
  14845. .bind(this)).catch(function(e) {
  14846. p.warn("Failed to embed:", t.src),
  14847. p.warn("with error:", e)
  14848. }).then(this.onMediaLoadFinished.bind(this))
  14849. }
  14850. .bind(this)),
  14851. n
  14852. }
  14853. ,
  14854. t.prototype.open = function(e) {
  14855. return this.openPromise = $.Deferred(),
  14856. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14857. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14858. this.state !== g.OPEN && (this.emit(b.OPENING),
  14859. e && this.emit(b.ACTIVATING),
  14860. this.state = g.OPENING,
  14861. this.animateOpen(function() {
  14862. e && this.setActiveState(),
  14863. this.openPromise.resolve()
  14864. }
  14865. .bind(this)))
  14866. }
  14867. .bind(this), d.animation.openDelay),
  14868. s.cancel(this.closeTransition),
  14869. this.closePromise && this.closePromise.reject(),
  14870. this.closeTransition = void 0,
  14871. this.openPromise.promise())
  14872. }
  14873. ,
  14874. t.prototype.close = function(e) {
  14875. return this.closePromise = $.Deferred(),
  14876. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14877. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14878. this.state = g.CLOSING,
  14879. this.animateClose())
  14880. }
  14881. .bind(this), d.animation.closeDelay)),
  14882. s.cancel(this.openTransition),
  14883. this.openPromise && this.openPromise.reject(),
  14884. this.openTransition = void 0,
  14885. this.closePromise.resolve(),
  14886. this.closePromise.promise())
  14887. }
  14888. ,
  14889. t.prototype.setActiveState = function() {
  14890. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14891. this.emit(b.ACTIVATE),
  14892. this.div.classList.remove("has-hotzone"))
  14893. }
  14894. ,
  14895. t.prototype.animateOpen = function(e) {
  14896. if (this.state === g.OPENING) {
  14897. if (s.cancel(this.animationTransition),
  14898. c.detectSamsungNative())
  14899. return this.boardOrientation = null,
  14900. this.div.style.visibility = "visible",
  14901. this.emit(b.OPENED),
  14902. this.state = g.OPEN,
  14903. void (e && e());
  14904. this.div.style.webkitTransform = "scale(0)",
  14905. this.div.style.transform = "scale(0)",
  14906. this.div.style.visibility = "visible",
  14907. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14908. this.emit(b.OPENED),
  14909. this.state = g.OPEN,
  14910. e && e()
  14911. }
  14912. .bind(this))
  14913. }
  14914. }
  14915. ,
  14916. t.prototype.animateClose = function(e) {
  14917. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14918. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14919. this.emit(b.CLOSED),
  14920. this.state = g.CLOSED,
  14921. this.div.style.visibility = "hidden",
  14922. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14923. e && e()
  14924. }
  14925. .bind(this)))
  14926. }
  14927. ,
  14928. t.prototype.needsUpdate = function() {
  14929. return this.state !== g.CLOSED
  14930. }
  14931. ,
  14932. t.prototype.update = function(e, t) {
  14933. if (this.needsUpdate()) {
  14934. var i = (this.updateOrientation(e),
  14935. this.calcScale(t))
  14936. , n = {
  14937. x: (e.x + 1) * $("#player").width() / 2,
  14938. y: (e.y + 1) * $("#player").height() / 2
  14939. };
  14940. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14941. this.div.style.webkitTransform = this.div.screenTransform,
  14942. this.div.style.transform = this.div.screenTransform
  14943. }
  14944. }
  14945. ,
  14946. t.prototype.getDimensions = function() {
  14947. return this.div.getBoundingClientRect()
  14948. }
  14949. ,
  14950. t.prototype.calcScale = function(e) {
  14951. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14952. }
  14953. ,
  14954. t.prototype.updateOrientation = function(e) {
  14955. if (this.state !== g.ACTIVE) {
  14956. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14957. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14958. , n = "";
  14959. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14960. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14961. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14962. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14963. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14964. }
  14965. }
  14966. ,
  14967. t.prototype.applyOrientation = function(e) {
  14968. this.div.style.transform = this.div.style.webkitTransform = "",
  14969. this.div.classList.remove("tag-container-" + this.orientation),
  14970. this.div.classList.add("tag-container-" + e);
  14971. var t = window.getComputedStyle(this.div);
  14972. this.initialTransform = t.transform || t.webkitTransform,
  14973. "none" === this.initialTransform && (this.initialTransform = "");
  14974. var i = t.transform.slice(7, -1).split(",")
  14975. , n = -i[4]
  14976. , r = -i[5];
  14977. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14978. this.div.style.transformOrigin = n + "px " + r + "px",
  14979. this.orientation = e
  14980. }
  14981. ,
  14982. v.exports = t
  14983. }
  14984. ).call(this, "/js/tag/Billboard/Billboard.js")
  14985. }
  14986. , {
  14987. "../../util/browser": 182,
  14988. "../../util/lerp": 188,
  14989. "../../util/logger": 189,
  14990. "../../util/transitions": 195,
  14991. "../Media/EmbedlyEmbed": 125,
  14992. "../Media/EmbedlyPlayer": 126,
  14993. "../Media/Image": 128,
  14994. "../Media/Link": 129,
  14995. "../Media/MediaEvent": 131,
  14996. "../Parser/DescriptionChunkType": 133,
  14997. "../Parser/DescriptionParser": 134,
  14998. "./BillboardEvent": 120,
  14999. "./billboardSettings": 121,
  15000. "./overlaySettings": 122,
  15001. events: 202
  15002. }],
  15003. 120: [function(e, t, i) {
  15004. "use strict";
  15005. t.exports = Object.freeze({
  15006. ENTER: "billboard.enter",
  15007. LEAVE: "billboard.leave",
  15008. OPENING: "billboard.opening",
  15009. OPENED: "billboard.open",
  15010. CLOSING: "billboard.closing",
  15011. CLOSED: "billboard.closed",
  15012. ACTIVATING: "billboard.activating",
  15013. ACTIVATE: "billboard.activate"
  15014. })
  15015. }
  15016. , {}],
  15017. 121: [function(e, t, i) {
  15018. "use strict";
  15019. t.exports = Object.freeze({
  15020. animation: Object.freeze({
  15021. hoverOnClosing: !1,
  15022. openDelay: 100,
  15023. closeDelay: 50,
  15024. openDuration: 200,
  15025. closeDuration: 100
  15026. }),
  15027. boardToDiscRatio: 1.2
  15028. })
  15029. }
  15030. , {}],
  15031. 122: [function(e, t, i) {
  15032. "use strict";
  15033. t.exports = Object.freeze({
  15034. boundaryWidth: 30,
  15035. boundaryHeight: 0
  15036. })
  15037. }
  15038. , {}],
  15039. 123: [function(M, R, e) {
  15040. (function(e) {
  15041. "use strict";
  15042. function d(e, t, i) {
  15043. var n = i.version || "0";
  15044. "0" !== n && w.info("tag defined using version " + n),
  15045. this.model = e,
  15046. this.sid = t,
  15047. this.color = (new f.Color).set(i.color || o.tagDefault),
  15048. this.hoverColor = o._darken(this.color, .2),
  15049. this.floor = null,
  15050. this.floorIndex = i.floor,
  15051. this.mode = m.PANORAMA,
  15052. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15053. this.obj3d = null,
  15054. this.disc = null,
  15055. this.materials = {
  15056. disc: null,
  15057. pole: null
  15058. },
  15059. this.position = (new f.Vector3).copy(i.position),
  15060. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15061. this.discWorldPosition = null,
  15062. this.discScale = .05,
  15063. this.poleEnabled = i.stem.enabled,
  15064. this.billboard = new r(i.label,i.description,i.media,this),
  15065. this.visibleTransition = null,
  15066. this.hoveringDisc = !1
  15067. }
  15068. 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"),
  15069. 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);
  15070. d.prototype = Object.create(b.prototype),
  15071. d.raycaster = new f.Raycaster,
  15072. d.prototype.bindEvents = function() {
  15073. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15074. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15075. }
  15076. ,
  15077. d.prototype.build = function() {
  15078. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15079. this.floor && (this.billboard.build(this.model.sid),
  15080. this.obj3d = this.buildObject3D(),
  15081. this.floor.add(this.obj3d)),
  15082. this
  15083. }
  15084. ,
  15085. d.prototype.buildObject3D = function() {
  15086. var e = new f.Object3D;
  15087. e.position.copy(this.position);
  15088. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15089. t.bg.value = x,
  15090. t.mask.value = T,
  15091. t.color.value.copy(this.color),
  15092. this.materials.disc = new f.RawShaderMaterial({
  15093. transparent: !0,
  15094. vertexShader: A.tagDisc.vertexShader,
  15095. fragmentShader: A.tagDisc.fragmentShader,
  15096. uniforms: t
  15097. }),
  15098. this.disc = new f.Mesh(S,this.materials.disc),
  15099. this.disc.layers.set(a.TAG),
  15100. this.disc.position.copy(this.discPosition),
  15101. this.disc.renderOrder = s.tagDisc;
  15102. var i = (this.disc.tag = this).buildPole();
  15103. return i.layers.set(a.TAG),
  15104. i.renderOrder = s.tagStem,
  15105. e.add(i),
  15106. e.layers.set(a.TAG),
  15107. e.add(this.disc)
  15108. }
  15109. ,
  15110. d.prototype.buildPole = function() {
  15111. var e = new f.BufferGeometry
  15112. , t = new Float32Array(6);
  15113. return t[0] = t[1] = t[2] = 0,
  15114. t[3] = this.discPosition.x,
  15115. t[4] = this.discPosition.y,
  15116. t[5] = this.discPosition.z,
  15117. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15118. this.materials.pole = new f.LineBasicMaterial({
  15119. linewidth: g.tags.pole.width,
  15120. color: g.tags.pole.color,
  15121. opacity: 0,
  15122. visible: this.poleEnabled,
  15123. transparent: !0,
  15124. depthWrite: !1
  15125. }),
  15126. new f.Line(e,this.materials.pole)
  15127. }
  15128. ,
  15129. d.prototype.setFreeState = function(e) {
  15130. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15131. this.materials.disc.uniforms.color.value = this.color
  15132. }
  15133. .bind(this))
  15134. }
  15135. ,
  15136. d.prototype.setHoverState = function(e) {
  15137. this.billboard.open(e),
  15138. this.materials.disc.uniforms.color.value = this.hoverColor
  15139. }
  15140. ,
  15141. d.prototype.hide = function(e, t) {
  15142. var i = $.Deferred();
  15143. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15144. return i.resolve().promise();
  15145. e = e || 0,
  15146. t = t || 0,
  15147. C.cancel(this.visibleTransition);
  15148. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15149. return this.visibleTransition = C.start((n = this,
  15150. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15151. o = I.property(n.materials.pole, "opacity", 0),
  15152. function(e) {
  15153. r(e),
  15154. n.materials.pole && o(e)
  15155. }
  15156. ), s * a, function() {
  15157. i.resolve()
  15158. }, l, E[g.warp.blendEasing]),
  15159. i.promise()
  15160. }
  15161. ,
  15162. d.prototype.show = function(e, t) {
  15163. var i = $.Deferred();
  15164. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15165. return i.resolve().promise();
  15166. e = e || 0,
  15167. t = t || 0,
  15168. C.cancel(this.visibleTransition);
  15169. 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;
  15170. return this.visibleTransition = C.start((n = this,
  15171. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15172. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15173. function(e) {
  15174. r(e),
  15175. n.materials.pole && o(e)
  15176. }
  15177. ), s * a, function() {
  15178. i.resolve()
  15179. }, l, E[g.warp.blendEasing]),
  15180. i.promise()
  15181. }
  15182. ,
  15183. d.prototype.closestPanoTowardTag = function(e, t) {
  15184. var i = []
  15185. , n = []
  15186. , r = this.disc.getWorldPosition();
  15187. if (e === m.PANORAMA) {
  15188. var o = t.position.clone().sub(r).normalize();
  15189. i.push(y.filters.isPanoAligned()),
  15190. i.push(y.filters.isNeighbourPanoTo(t)),
  15191. i.push(y.filters.inPanoDirection(r, o, .5)),
  15192. n.push(y.scoreFunctions.direction(r, o))
  15193. }
  15194. var a = new f.Vector3;
  15195. i.push(function(e) {
  15196. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15197. }, function(e) {
  15198. a.copy(r).sub(e.position);
  15199. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15200. , i = g.tags.navigate.tiltTolerance;
  15201. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15202. }),
  15203. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15204. var s = this.model.panos.sortByScore(i, n);
  15205. if (g.tags.navigate.lineOfSight) {
  15206. for (var l = 0; l < s.length; l++) {
  15207. var c = s[l].item
  15208. , h = c.position.distanceTo(r);
  15209. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15210. return null;
  15211. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15212. var u = d.raycaster.intersectObjects(this.model.colliders);
  15213. if (0 === u.length || u[0].distance > h)
  15214. return c
  15215. }
  15216. return null
  15217. }
  15218. return 0 < s.length && s[0].pano
  15219. }
  15220. ,
  15221. d.prototype.examine = function(i) {
  15222. if(!player.currentPano)return;
  15223. var e = i.mode
  15224. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15225. , t = this.disc.getWorldPosition();
  15226. this.billboard.setActiveState();
  15227. var r = function() {
  15228. var e = this.billboard.getDimensions()
  15229. , t = new f.Vector3;
  15230. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15231. t.unproject(i.camera),
  15232. i.flyToPano({
  15233. pano: n,
  15234. lookAtPoint: t
  15235. })
  15236. }
  15237. .bind(this);
  15238. if (e === m.PANORAMA)
  15239. if (n !== i.currentPano) {
  15240. var o = {
  15241. pano: n,
  15242. lookAtPoint: t,
  15243. duration: null,
  15244. maxDistanceOverride: null,
  15245. skipWarpingCheck: !1
  15246. };
  15247. i.flyToPano(o, r)
  15248. } else
  15249. setTimeout(function() {
  15250. this.billboard.open().then(function() {
  15251. r()
  15252. })
  15253. }
  15254. .bind(this), 0);
  15255. else {
  15256. var a = {
  15257. pano: n
  15258. };
  15259. if (t) {
  15260. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15261. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15262. }
  15263. a.callback = r,
  15264. a.duration = 1500,
  15265. a.mode = m.PANORAMA,
  15266. i.flyToNewMode(a)
  15267. }
  15268. }
  15269. ,
  15270. d.prototype.update = (n = new f.Vector3,
  15271. function(e, t) {
  15272. this.discWorldPosition = this.disc.getWorldPosition(),
  15273. this.updateDisc(e, t),
  15274. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15275. n.z < 1 && (n.y *= -1,
  15276. this.billboard.update(n, this.getDiscRadius(n, t))))
  15277. }
  15278. ),
  15279. d.prototype.updateDisc = (l = new f.Vector3,
  15280. c = new f.Vector3,
  15281. h = new f.Vector3,
  15282. u = new f.Vector3,
  15283. p = new f.Vector3,
  15284. function(e, t) {
  15285. var i = g.tags.visibility
  15286. , n = g.tags.disc.scale
  15287. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15288. 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)),
  15289. this.obj3d.visible) {
  15290. this.disc.quaternion.copy(t.quaternion);
  15291. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15292. l.copy(this.discWorldPosition).project(t),
  15293. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15294. h.set(o / 2, 0, 0).add(c),
  15295. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15296. p.copy(u).unproject(t);
  15297. var a = p.distanceTo(this.discWorldPosition)
  15298. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15299. this.discScale = a * s,
  15300. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15301. }
  15302. }
  15303. ),
  15304. d.prototype.getDiscRadius = (i = new f.Vector3,
  15305. function(e, t) {
  15306. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15307. Math.abs(e.x - i.x) * $("#player").width()
  15308. }
  15309. ),
  15310. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15311. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15312. }
  15313. ,
  15314. d.prototype.offScreen = function(e, t) {
  15315. var i = e.getWorldPosition().project(t);
  15316. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15317. }
  15318. ,
  15319. d.viewportScale = function() {
  15320. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15321. d.viewportHeight = $("#player").height(),
  15322. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15323. d.currentViewportScale
  15324. }
  15325. ,
  15326. R.exports = d
  15327. }
  15328. ).call(this, "/js/tag/tag.js")
  15329. }
  15330. , {
  15331. "../enum/Colors": 19,
  15332. "../enum/RenderLayers": 41,
  15333. "../enum/RenderOrder": 42,
  15334. "../enum/Viewmode": 51,
  15335. "../objects/Panorama": 148,
  15336. "../settings": 166,
  15337. "../shaders": 167,
  15338. "../util/common": 185,
  15339. "../util/easing": 186,
  15340. "../util/lerp": 188,
  15341. "../util/logger": 189,
  15342. "../util/math": 190,
  15343. "../util/texture": 194,
  15344. "../util/transitions": 195,
  15345. "./Billboard/Billboard": 119,
  15346. "./Billboard/BillboardEvent": 120,
  15347. events: 202,
  15348. three: 217
  15349. }],
  15350. 124: [function(M, R, e) {
  15351. (function(e) {
  15352. "use strict";
  15353. function t() {
  15354. this.tagState = T.IDLE,
  15355. this.intersectTag = null,
  15356. this.hoveredTag = null,
  15357. this.activeTag = null,
  15358. this.tagDiscs = [],
  15359. this.raycaster = new i.Raycaster,
  15360. this.modelManager = null,
  15361. this.player = null,
  15362. this.totaltags = 0,
  15363. this.navigatingViaTag = !1,
  15364. this.enabled = !1
  15365. }
  15366. 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"),
  15367. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15368. r.extend(t, x),
  15369. t.prototype.init = function(e, t) {
  15370. this.modelManager = e,
  15371. this.player = t,
  15372. this.updateModel(),
  15373. this.bindEvents()
  15374. }
  15375. ,
  15376. t.prototype.update = function(e) {
  15377. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15378. }
  15379. ,
  15380. t.prototype.updateTags = function(e, t, i, n) {
  15381. for (var r in this.model.tags)
  15382. this.model.tags[r].update(e, t, i, n)
  15383. }
  15384. ,
  15385. t.prototype.updateModel = function() {
  15386. this.model = this.modelManager.getActiveModel(),
  15387. this.gettagsFromModel(),
  15388. this.totaltags = Object.keys(this.model.tags).length
  15389. }
  15390. ,
  15391. t.prototype.gettagsFromModel = function() {
  15392. for (var e in this.tagDiscs = [],
  15393. this.model.tags) {
  15394. var t = this.model.tags[e].disc;
  15395. t && this.tagDiscs.push(t)
  15396. }
  15397. }
  15398. ,
  15399. t.prototype.bindEvents = function() {
  15400. function e() {
  15401. Object.keys(this.model.tags).forEach(function(e) {
  15402. var t = this.model.tags[e];
  15403. t.bindEvents(),
  15404. t.billboard.on(y.LINK_CLICK, function(e) {
  15405. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15406. }
  15407. .bind(this)),
  15408. t.billboard.on(y.IMAGE_OPENED, function() {
  15409. this.tagState = T.EXAMINE,
  15410. this.emit(y.IMAGE_OPENED)
  15411. }
  15412. .bind(this)),
  15413. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15414. }
  15415. .bind(this))
  15416. }
  15417. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15418. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15419. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15420. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15421. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15422. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15423. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15424. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15425. e.call(this)
  15426. }
  15427. ,
  15428. t.prototype.navigateViaLink = function(e) {
  15429. var t = a.deserialize(e);
  15430. if (t)
  15431. if (t.mode === C.PANORAMA) {
  15432. try {
  15433. this.player.model.panos.get(t.panoId)
  15434. } catch (e) {
  15435. return void S.warn("Unable to find panorama location", t.panoId)
  15436. }
  15437. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15438. } else {
  15439. var i = {
  15440. cameraMode: t.mode,
  15441. position: t.position,
  15442. quaternion: t.quaternion,
  15443. scanId: t.panoId,
  15444. orthoZoom: t.zoom,
  15445. floorVisibility: t.floorVisibility,
  15446. thumbUrl: null,
  15447. name: null
  15448. };
  15449. this.player.flyToNewMode({
  15450. mode: t.mode,
  15451. duration: m.warp.outsideTime,
  15452. warpDest: new g(i),
  15453. force: !0
  15454. })
  15455. }
  15456. }
  15457. ,
  15458. t.prototype.handleWarpStart = function(e, t, i, n) {
  15459. this.dismissExaminedTag(),
  15460. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15461. e && (i = E.END),
  15462. this.hideShowTagsForBlackoutStyle(i, n))
  15463. }
  15464. ,
  15465. t.prototype.handleWarpInterruption = function(e, t, i) {
  15466. null != i || (i = m.warp.teleportTime),
  15467. this.hideShowTagsForBlackoutStyle(t, i)
  15468. }
  15469. ,
  15470. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15471. var i = 0
  15472. , n = 0
  15473. , r = t / 2;
  15474. switch (null != e || (e = E.MIDDLE),
  15475. e) {
  15476. case E.END:
  15477. this.hideAlltags(r);
  15478. break;
  15479. case E.BEGINNING:
  15480. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15481. break;
  15482. case E.NONE:
  15483. break;
  15484. case E.MIDDLE:
  15485. n = i = r,
  15486. this.hideAlltags(n),
  15487. setTimeout(function() {
  15488. this.showAlltags(i)
  15489. }
  15490. .bind(this), n);
  15491. break;
  15492. case E.FADEIN:
  15493. setTimeout(function() {
  15494. this.showAlltags(r)
  15495. }
  15496. .bind(this), r)
  15497. }
  15498. }
  15499. ,
  15500. t.prototype.onPlayerModeChanging = function(e, t) {
  15501. t !== C.PANORAMA && this.dismissExaminedTag(),
  15502. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15503. var i = t !== C.OUTDOOR;
  15504. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15505. }
  15506. ,
  15507. t.prototype.onPanoChange = function(e, t) {
  15508. var i = this.navigatingViaTag;
  15509. if (this.navigatingViaTag = !1,
  15510. !i) {
  15511. this.dismissExaminedTag();
  15512. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15513. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15514. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15515. }
  15516. }
  15517. ,
  15518. t.prototype.onPlayerReady = function(e, t, i) {
  15519. this.startAlltags(e, t ? i : null)
  15520. }
  15521. ,
  15522. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15523. this.updateClosestTags(e)
  15524. }
  15525. ,
  15526. t.prototype.dismissExaminedTag = function() {
  15527. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15528. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15529. this.hoveredTag = null)
  15530. }
  15531. ,
  15532. t.prototype.startAlltags = function(e, t) {
  15533. this.model.shouldShowtags = m.tags.enabled,
  15534. this.enabled = !0,
  15535. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15536. t && setTimeout(function() {
  15537. this.activateTag(this.model.getTagBySid(t))
  15538. }
  15539. .bind(this), m.tags.startup.fadeInDuration / 2))
  15540. }
  15541. ,
  15542. t.prototype.showAlltags = function(e, t, i) {
  15543. function n() {
  15544. ++o === this.totaltags && (this.model.tagsShown = !0,
  15545. r.resolve())
  15546. }
  15547. var r = $.Deferred();
  15548. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15549. return r.resolve().promise();
  15550. var o = 0;
  15551. for (var a in this.model.tags) {
  15552. this.model.tags[a].show(e, t).done(n.bind(this))
  15553. }
  15554. return r.promise()
  15555. }
  15556. ,
  15557. t.prototype.hideAlltags = function(e, t) {
  15558. function i() {
  15559. ++r === this.totaltags && (this.model.tagsShown = !1,
  15560. n.resolve())
  15561. }
  15562. var n = $.Deferred()
  15563. , r = 0;
  15564. for (var o in this.model.tags) {
  15565. var a = this.model.tags[o];
  15566. a.hide(e, t).done(i.bind(this)),
  15567. a === this.activeTag && this.dismissActiveTag()
  15568. }
  15569. return n.promise()
  15570. }
  15571. ,
  15572. t.prototype.enableHovering = function() {
  15573. this.enabled = !0
  15574. }
  15575. ,
  15576. t.prototype.disableHovering = function() {
  15577. this.enabled = !1
  15578. }
  15579. ,
  15580. t.prototype.activateTag = function(e, t) {
  15581. t = t || T.EXAMINE,
  15582. this.activeTag = e,
  15583. this.activeTag.hoveringDisc = !0,
  15584. this.activeTag.setHoverState(t === T.EXAMINE),
  15585. this.tagState = t,
  15586. this.emit(b.TagActivated, e)
  15587. }
  15588. ,
  15589. t.prototype.dismissActiveTag = function() {
  15590. this.activeTag.hoveringDisc = !1,
  15591. this.activeTag.setFreeState(!0);
  15592. var e = this.activeTag;
  15593. this.activeTag = null,
  15594. this.tagState = T.IDLE,
  15595. this.emit(b.TagDismissed, e)
  15596. }
  15597. ,
  15598. t.prototype.clickedOnTag = function(e) {
  15599. var t = function() {
  15600. this.navigatingViaTag = !0,
  15601. this.activeTag.examine(this.player),
  15602. this.emit(b.TagNavigation, this.activeTag)
  15603. }
  15604. .bind(this);
  15605. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15606. this.activeTag = this.intersectTag,
  15607. t(),
  15608. !0) : (this.dismissActiveTag(),
  15609. !1)
  15610. }
  15611. ,
  15612. t.prototype.intersecttag = (s = new i.Vector3,
  15613. l = new i.Vector3,
  15614. c = new i.Vector3,
  15615. function(e, t, i) {
  15616. if (!this.enabled)
  15617. return null;
  15618. var n = null
  15619. , r = this.tagDiscs.filter(function(e) {
  15620. return e.parent.visible
  15621. });
  15622. if (0 < r.length) {
  15623. var o = this.model.floors.reduce(function(e, t) {
  15624. return t.hidden ? e : e.concat(t.collider.children)
  15625. }, r);
  15626. s.set(e.x, e.y, -1).unproject(i),
  15627. l.set(e.x, e.y, 1).unproject(i),
  15628. c.copy(l).sub(s).normalize(),
  15629. this.raycaster.set(s, c);
  15630. var a = this.raycaster.intersectObjects(o);
  15631. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15632. }
  15633. return this.intersectTag = n,
  15634. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15635. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15636. this.hoveredTag = n
  15637. }
  15638. .bind(this)),
  15639. n.billboard.on(v.LEAVE, function() {
  15640. this.hoveredTag = null
  15641. }
  15642. .bind(this))),
  15643. this.activateTag(n, T.BROWSE))),
  15644. n
  15645. }
  15646. ),
  15647. t.prototype.rankedtagInDirection = (h = [],
  15648. u = [],
  15649. d = new i.Vector3,
  15650. p = new i.Vector3,
  15651. f = new i.Vector3,
  15652. function(e, t, i, n) {
  15653. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15654. var a = this.closesttags[o];
  15655. p.copy(a.position),
  15656. p.add(a.discPosition),
  15657. d.copy(t),
  15658. d.sub(p).negate(),
  15659. d.normalize();
  15660. var s = d.dot(n);
  15661. if (0 <= s && (f.copy(p),
  15662. f.project(i),
  15663. this.intersecttag(f, !1, i))) {
  15664. if (r >= h.length)
  15665. for (var l = 0; l < 64; l++)
  15666. h.push({
  15667. tag: a,
  15668. dot: s
  15669. });
  15670. var c = h[r];
  15671. c.tag = a,
  15672. c.dot = s,
  15673. c.position = math.projectPositionToCanvas(p, i),
  15674. u.push(c),
  15675. r++
  15676. }
  15677. }
  15678. return u.sort(function(e, t) {
  15679. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15680. }),
  15681. e < u.length ? u[e].tag : null
  15682. }
  15683. ),
  15684. t.prototype.updateClosestTags = (o = new i.Vector3,
  15685. function(e) {
  15686. this.closesttags || (this.closesttags = []),
  15687. this.closesttags.length = 0;
  15688. var t = this.model.tags;
  15689. if (t)
  15690. for (var i in t)
  15691. if (t.hasOwnProperty(i)) {
  15692. var n = t[i]
  15693. , r = n.position;
  15694. o.copy(e),
  15695. o.sub(r).negate(),
  15696. o.lengthSq() < 30 && this.closesttags.push(n)
  15697. }
  15698. }
  15699. ),
  15700. R.exports = t
  15701. }
  15702. ).call(this, "/js/tag/tagManager.js")
  15703. }
  15704. , {
  15705. "../controls/serializer": 14,
  15706. "../enum/BlackoutStyle": 18,
  15707. "../enum/tagEvents": 32,
  15708. "../enum/ModelManagerEvents": 33,
  15709. "../enum/PlayerEvents": 40,
  15710. "../enum/TagStates": 44,
  15711. "../enum/Viewmode": 51,
  15712. "../enum/WarpStyle": 52,
  15713. "../objects/Snapshot": 153,
  15714. "../settings": 166,
  15715. "../util/common": 185,
  15716. "../util/lerp": 188,
  15717. "../util/logger": 189,
  15718. "./Billboard/BillboardEvent": 120,
  15719. "./Media/LinkType": 130,
  15720. "./Media/MediaEvent": 131,
  15721. events: 202,
  15722. three: 217
  15723. }],
  15724. 125: [function(r, o, e) {
  15725. (function(e) {
  15726. "use strict";
  15727. function t() {
  15728. this.embedWrapper = null,
  15729. this.embedElement = null
  15730. }
  15731. var i = r("../../util/ajax")
  15732. , a = r("./mediaSettings")
  15733. , n = r("../../settings")
  15734. , s = new (r("../../util/logger"))(e);
  15735. t.prototype.createDomElement = function() {
  15736. return this.embedWrapper = document.createElement("div"),
  15737. this.embedWrapper.classList.add("tag-embed"),
  15738. this.embedWrapper.classList.add("hidden"),
  15739. this.embedWrapper
  15740. }
  15741. ,
  15742. t.prototype.load = function(e) {
  15743. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15744. return new Promise(function(r, o) {
  15745. i.get(t).then(function(e) {
  15746. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15747. this.embedWrapper.innerHTML = e.html;
  15748. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15749. if (this.embedWrapper.style.width = t + "px",
  15750. e.height) {
  15751. var i = e.height / e.width;
  15752. this.embedWrapper.style.height = t * i + "px"
  15753. }
  15754. this.embedElement = this.embedWrapper.firstChild;
  15755. var n = [];
  15756. try {
  15757. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15758. } catch (e) {
  15759. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15760. }
  15761. n.forEach(function(e) {
  15762. e.setAttribute("target", "_blank")
  15763. }),
  15764. this.embedElement.classList.add("hidden"),
  15765. this.embedWrapper.classList.remove("hidden"),
  15766. r()
  15767. } else
  15768. o("Not a valid embed")
  15769. }
  15770. .bind(this), function(e) {
  15771. o(e.response)
  15772. })
  15773. }
  15774. .bind(this))
  15775. }
  15776. ,
  15777. t.prototype.show = function() {
  15778. this.embedElement && this.embedElement.classList.remove("hidden")
  15779. }
  15780. ,
  15781. t.prototype.hide = function() {
  15782. this.embedElement && this.embedElement.classList.add("hidden")
  15783. }
  15784. ,
  15785. o.exports = t
  15786. }
  15787. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15788. }
  15789. , {
  15790. "../../settings": 166,
  15791. "../../util/ajax": 181,
  15792. "../../util/logger": 189,
  15793. "./mediaSettings": 132
  15794. }],
  15795. 126: [function(a, s, e) {
  15796. (function(e) {
  15797. "use strict";
  15798. function t(e) {
  15799. r.call(this),
  15800. this.options = e,
  15801. this.playerControls = null,
  15802. this.state = o.NOT_READY
  15803. }
  15804. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15805. Object.freeze({
  15806. NOT_READY: "player.not.ready",
  15807. CUED: "player.cued",
  15808. PLAYING: "player.playing",
  15809. PAUSED: "player.paused"
  15810. }));
  15811. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15812. return this.embedWrapper = document.createElement("div"),
  15813. this.embedWrapper.classList.add("tag-video"),
  15814. this.embedWrapper.classList.add("hidden"),
  15815. this.embedWrapper
  15816. }
  15817. ,
  15818. t.prototype.load = function(e) {
  15819. var t = function() {
  15820. function e(e) {
  15821. this.playerState = e
  15822. }
  15823. this.playerControls = new playerjs.Player(this.embedElement),
  15824. this.playerControls.on("ready", function(e) {
  15825. this.playerState = o.CUED,
  15826. this.options.startMuted && this.playerControls.mute()
  15827. }
  15828. .bind(this)),
  15829. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15830. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15831. this.playerControls.on("ended", function(e) {
  15832. this.playerControls.setCurrentTime(0),
  15833. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15834. }
  15835. .bind(this))
  15836. }
  15837. .bind(this);
  15838. return r.prototype.load.call(this, e).then(t.bind(this))
  15839. }
  15840. ,
  15841. t.prototype.play = (i = n.isMobile(),
  15842. function() {
  15843. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15844. }
  15845. ),
  15846. t.prototype.pause = function() {
  15847. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15848. }
  15849. ,
  15850. s.exports = t
  15851. }
  15852. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15853. }
  15854. , {
  15855. "../../util/browser": 182,
  15856. "../../util/logger": 189,
  15857. "./EmbedlyEmbed": 125
  15858. }],
  15859. 127: [function(t, i, e) {
  15860. (function(e) {
  15861. "use strict";
  15862. var r = t("../../util/ajax")
  15863. , o = new (t("./mediaSettings"),
  15864. t("../../util/logger"))(e)
  15865. , a = Promise.resolve();
  15866. i.exports.enqueue = function(i) {
  15867. function n() {}
  15868. return a = new Promise(function(e, t) {
  15869. a.catch(n).then(function() {
  15870. (o.debug("requesting file from embedly:", i.href),
  15871. r.get(i.href, {
  15872. responseType: i.responseType
  15873. }).then(function(e) {
  15874. return o.debug("requesting file finished:", i.href),
  15875. e
  15876. })).then(e, t)
  15877. })
  15878. }
  15879. )
  15880. }
  15881. }
  15882. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15883. }
  15884. , {
  15885. "../../util/ajax": 181,
  15886. "../../util/logger": 189,
  15887. "./mediaSettings": 132
  15888. }],
  15889. 128: [function(s, l, e) {
  15890. (function(e) {
  15891. "use strict";
  15892. function t() {
  15893. this.imageWrapper = null,
  15894. this.width = 0,
  15895. this.height = 0,
  15896. this.aspect = 1
  15897. }
  15898. var i = s("./MediaEvent")
  15899. , n = s("./EmbedlyQueue")
  15900. , r = s("events").EventEmitter
  15901. , o = s("../../util/logger")
  15902. , a = s("../../settings");
  15903. new o(e),
  15904. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15905. return this.imageWrapper = document.createElement("div"),
  15906. this.imageWrapper.classList.add("tag-image"),
  15907. this.imageWrapper.classList.add("hidden"),
  15908. this.imageWrapper.addEventListener("click", function(e) {
  15909. e.stopPropagation(),
  15910. this.emit(i.IMAGE_OPENING),
  15911. this.imageWrapper.style.pointerEvents = "none"
  15912. }
  15913. .bind(this)),
  15914. this.imageWrapper
  15915. }
  15916. ,
  15917. t.prototype.onClosed = function() {
  15918. this.imageWrapper.style.pointerEvents = "auto"
  15919. }
  15920. ,
  15921. t.prototype.load = function(e) {
  15922. var t = Math.max(window.screen.height, window.screen.width)
  15923. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15924. return new Promise(function(o, e) {
  15925. n.enqueue({
  15926. href: i,
  15927. responseType: "arraybuffer"
  15928. }).then(function(e) {
  15929. var t = new Uint8Array(e)
  15930. , i = new Blob([t])
  15931. , n = new window.Image;
  15932. n.addEventListener("load", function(e) {
  15933. var t = e.target;
  15934. this.width = t.naturalWidth,
  15935. this.height = t.naturalHeight,
  15936. this.aspect = this.width / this.height;
  15937. var i = e.target.src;
  15938. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15939. this.imageWrapper.style.width = this.width + "px",
  15940. this.imageWrapper.style.height = this.height + "px",
  15941. this.imageWrapper.classList.remove("hidden"),
  15942. o()
  15943. }
  15944. .bind(this));
  15945. var r = URL.createObjectURL(i);
  15946. n.src = r
  15947. }
  15948. .bind(this), e)
  15949. }
  15950. .bind(this))
  15951. }
  15952. ,
  15953. l.exports = t
  15954. }
  15955. ).call(this, "/js/tag/Media/Image.js")
  15956. }
  15957. , {
  15958. "../../settings": 166,
  15959. "../../util/logger": 189,
  15960. "./EmbedlyQueue": 127,
  15961. "./MediaEvent": 131,
  15962. events: 202
  15963. }],
  15964. 129: [function(e, t, i) {
  15965. "use strict";
  15966. function n(e) {
  15967. this.label = e.label,
  15968. this.href = e.url,
  15969. this.type = this.updateLinkForType(),
  15970. this.domElement = null,
  15971. this.id = c++
  15972. }
  15973. var r = e("./LinkType")
  15974. , o = e("./MediaEvent")
  15975. , a = e("../../util/browser")
  15976. , s = e("../../analytics")
  15977. , l = e("events").EventEmitter
  15978. , c = 0;
  15979. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15980. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15981. 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,
  15982. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15983. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15984. r.MODEL) : r.EXT_LINK
  15985. }
  15986. ;
  15987. var h = {};
  15988. n.prototype.createDomElement = function() {
  15989. if (this.domElement = document.createElement("a"),
  15990. this.domElement.classList.add("tag-link"),
  15991. this.domElement.textContent = this.label,
  15992. this.type === r.EXT_LINK) {
  15993. this.domElement.textContent += " ";
  15994. var e = document.createElement("i");
  15995. e.classList.add("icon-ext-link"),
  15996. e.title = "Link to external web site",
  15997. this.domElement.appendChild(e)
  15998. }
  15999. return this.domElement.addEventListener("click", function(e) {
  16000. switch (e.stopPropagation(),
  16001. h[this.id] = !0,
  16002. s.trackAlways("click_tag_link", {
  16003. link_type: this.type,
  16004. link_count: c,
  16005. links_clicked: Object.keys(h).length
  16006. }),
  16007. this.type) {
  16008. case r.MODEL:
  16009. window.location.replace(this.href);
  16010. break;
  16011. case r.EXT_LINK:
  16012. window.open(this.href, "_blank")
  16013. }
  16014. this.emit(o.LINK_CLICK, {
  16015. type: this.type,
  16016. url: this.href
  16017. })
  16018. }
  16019. .bind(this)),
  16020. this.domElement
  16021. }
  16022. ,
  16023. t.exports = n
  16024. }
  16025. , {
  16026. "../../analytics": 4,
  16027. "../../util/browser": 182,
  16028. "./LinkType": 130,
  16029. "./MediaEvent": 131,
  16030. events: 202
  16031. }],
  16032. 130: [function(e, t, i) {
  16033. "use strict";
  16034. t.exports = {
  16035. NAVIGATION: "navigation",
  16036. MODEL: "model",
  16037. EXT_LINK: "ext-link"
  16038. }
  16039. }
  16040. , {}],
  16041. 131: [function(e, t, i) {
  16042. "use strict";
  16043. t.exports = Object.freeze({
  16044. LINK_CLICK: "mtmedia.link",
  16045. IMAGE_LOADED: "mtmedia.image.loaded",
  16046. IMAGE_OPENING: "mtmedia.image.opening",
  16047. IMAGE_OPENED: "mtmedia.image.opened",
  16048. IMAGE_CLOSING: "mtmedia.image.closing",
  16049. IMAGE_CLOSED: "mtmedia.image.closed",
  16050. VIDEO_START: "mtmedia.video.start",
  16051. VIDEO_PAUSE: "mtmedia.video.pause",
  16052. VIDEO_ENDED: "mtmedia.video.end"
  16053. })
  16054. }
  16055. , {}],
  16056. 132: [function(e, t, i) {
  16057. "use strict";
  16058. t.exports = Object.freeze({
  16059. maxEmbedWidth: 350,
  16060. defaultAspectRatio: .75
  16061. })
  16062. }
  16063. , {}],
  16064. 133: [function(e, t, i) {
  16065. "use strict";
  16066. t.exports = Object.freeze({
  16067. TEXT: "text",
  16068. LINK: "link",
  16069. IMAGE: "photo",
  16070. VIDEO: "video",
  16071. RICH: "rich"
  16072. })
  16073. }
  16074. , {}],
  16075. 134: [function(e, t, i) {
  16076. "use strict";
  16077. function n(e) {
  16078. this.capabilities = {
  16079. links: {
  16080. enable: e.supportLinks,
  16081. keepLabels: e.keepLinkLabels
  16082. }
  16083. }
  16084. }
  16085. var r = e("./DescriptionChunkType");
  16086. n.prototype.parse = function(e, i) {
  16087. var n = [];
  16088. return e.split("[").map(function(e, t) {
  16089. return 0 === t ? e : "[" + e
  16090. }).forEach(function(e) {
  16091. var t = this.findMarkdown(e);
  16092. if (t) {
  16093. if (-1 !== t.url.indexOf("javascript:"))
  16094. return;
  16095. this.addLinkChunk(n, t, i),
  16096. this.addTextChunk(n, e.slice(t.markdown.length))
  16097. } else
  16098. this.addTextChunk(n, e)
  16099. }
  16100. .bind(this)),
  16101. n
  16102. }
  16103. ,
  16104. n.prototype.findMarkdown = function(e) {
  16105. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16106. if (t) {
  16107. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16108. 0 !== n); )
  16109. r++;
  16110. var o = i.length - r;
  16111. return {
  16112. markdown: t[0].substring(0, t[0].length - o),
  16113. label: t[1],
  16114. url: t[2].substring(0, r)
  16115. }
  16116. }
  16117. }
  16118. ,
  16119. n.prototype.addTextChunk = function(e, t) {
  16120. 0 !== t.length && e.push({
  16121. type: r.TEXT,
  16122. text: t
  16123. })
  16124. }
  16125. ,
  16126. n.prototype.addLinkChunk = function(e, t) {
  16127. if (this.capabilities.links.enable) {
  16128. var i = {
  16129. label: t.label,
  16130. url: t.url
  16131. };
  16132. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16133. e.push({
  16134. type: r.LINK,
  16135. link: i
  16136. })
  16137. } else
  16138. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16139. }
  16140. ,
  16141. t.exports = n
  16142. }
  16143. , {
  16144. "./DescriptionChunkType": 133
  16145. }],
  16146. 135: [function(t, r, e) {
  16147. (function(e) {
  16148. "use strict";
  16149. var i = new (t("../util/logger"))(e)
  16150. , n = {
  16151. parseIdsFromChunkName: function(e, t) {
  16152. t.floorId = n.parseFloor(e),
  16153. t.roomId = n.parseRoom(e)
  16154. },
  16155. parseFloor: function(e) {
  16156. var t = e.match(/_group([0-9]+)/);
  16157. if (!t)
  16158. return 0;
  16159. try {
  16160. return parseInt(t[1], 10)
  16161. } catch (e) {
  16162. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16163. 0
  16164. }
  16165. },
  16166. parseRoom: function(e) {
  16167. var t = e.match(/_sub([0-9]+)/);
  16168. if (!t)
  16169. return -1;
  16170. try {
  16171. return parseInt(t[1], 10)
  16172. } catch (e) {
  16173. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16174. 0
  16175. }
  16176. }
  16177. };
  16178. r.exports = n
  16179. }
  16180. ).call(this, "/js/model/Chunks.js")
  16181. }
  16182. , {
  16183. "../util/logger": 189
  16184. }],
  16185. 136: [function(a, c, e) {
  16186. (function(e) {
  16187. "use strict";
  16188. function t(e) {
  16189. r.call(this),
  16190. this.model = e,
  16191. this.exploded = !1
  16192. }
  16193. var i = a("../objects/Floor")
  16194. , n = (a("../settings"),
  16195. a("../util/logger"))
  16196. , s = a("../util/transitions")
  16197. , r = a("../util/IndexedCollection")
  16198. , o = a("../util/common")
  16199. , l = a("../util/easing");
  16200. new n(e),
  16201. o.inherit(t, r),
  16202. t.prototype.add = function(e) {
  16203. r.prototype.add.call(this, e),
  16204. this.model.add(e)
  16205. }
  16206. ,
  16207. t.prototype.getIndex = function(e) {
  16208. return e.floorIndex
  16209. }
  16210. ,
  16211. t.prototype.build = function() {
  16212. this.list.forEach(function(e) {
  16213. e.build()
  16214. })
  16215. }
  16216. ,
  16217. t.prototype.size = function() {
  16218. return this.length
  16219. }
  16220. ,
  16221. t.prototype.sort = function() {
  16222. r.prototype.sort.call(this, function(e, t) {
  16223. return e.floorIndex - t.floorIndex
  16224. })
  16225. }
  16226. ,
  16227. t.prototype.nextFloor = function(e, t) {
  16228. return this.index[e.floorIndex + t] || null
  16229. }
  16230. ,
  16231. t.prototype.getFloorAtPoint = function(e) {
  16232. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16233. var r = this.list[n]
  16234. , o = r.distanceToPoint(e);
  16235. (!t || o < i) && (i = o,
  16236. t = r)
  16237. }
  16238. return t
  16239. }
  16240. ,
  16241. t.prototype.getOrMakeFloor = function(e) {
  16242. var t = this.index[e];
  16243. return t || (t = new i(this.model,e),
  16244. this.add(t)),
  16245. t
  16246. }
  16247. ,
  16248. t.prototype.hide = function() {
  16249. this.list.forEach(function(e) {
  16250. e.hide()
  16251. })
  16252. }
  16253. ,
  16254. t.prototype.show = function() {
  16255. this.list.forEach(function(e) {
  16256. e.show()
  16257. })
  16258. }
  16259. ,
  16260. t.prototype.names = function() {
  16261. return this.list.reduce(function(e, t) {
  16262. return e.concat(t.name)
  16263. }, [])
  16264. }
  16265. ,
  16266. t.prototype.toggleExplodeHorizontal = function() {
  16267. function i(e, t) {
  16268. a.copy(e.position),
  16269. e.position.x = r[e.floorIndex] * t,
  16270. e.position.y = 1 * e.floorIndex * t,
  16271. a.sub(e.position).multiplyScalar(-1),
  16272. e.panos.forEach(function(e) {
  16273. e.translate(a)
  16274. })
  16275. }
  16276. var n, r = [], o = 0;
  16277. this.list.forEach(function(e, t, i) {
  16278. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16279. o += n,
  16280. r[t] = o
  16281. }),
  16282. r = r.map(function(e) {
  16283. return e - o / 2
  16284. });
  16285. var a = this.list[0].position.clone();
  16286. this.exploded ? this.list.forEach(function(t) {
  16287. s.start(function(e) {
  16288. i(t, 1 - e)
  16289. }, 1500, null, 0, l.easeOutExpo)
  16290. }) : this.list.forEach(function(t) {
  16291. s.start(function(e) {
  16292. i(t, e)
  16293. }, 1500, null, 0, l.easeOutExpo)
  16294. }),
  16295. this.exploded = !this.exploded
  16296. }
  16297. ,
  16298. t.prototype.toggleExplodeVertical = function() {
  16299. function i(e, t) {
  16300. var i = i.copy(e.position);
  16301. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16302. i.sub(e.position).multiplyScalar(-1),
  16303. e.panos.forEach(function(e) {
  16304. e.translate(i)
  16305. })
  16306. }
  16307. var n = this.model.size;
  16308. this.list[0].position.clone(),
  16309. this.exploded ? this.list.forEach(function(t) {
  16310. s.start(function(e) {
  16311. i(t, 1 - e)
  16312. }, 1500, null, 0, l.easeOutExpo)
  16313. }) : this.list.forEach(function(t) {
  16314. s.start(function(e) {
  16315. i(t, e)
  16316. }, 1500, null, 0, l.easeOutExpo)
  16317. }),
  16318. this.exploded = !this.exploded
  16319. }
  16320. ,
  16321. c.exports = t
  16322. }
  16323. ).call(this, "/js/model/FloorCollection.js")
  16324. }
  16325. , {
  16326. "../objects/Floor": 146,
  16327. "../settings": 166,
  16328. "../util/IndexedCollection": 175,
  16329. "../util/common": 185,
  16330. "../util/easing": 186,
  16331. "../util/logger": 189,
  16332. "../util/transitions": 195
  16333. }],
  16334. 137: [function(r, o, e) {
  16335. (function(e) {
  16336. "use strict";
  16337. function h() {
  16338. n.call(this)
  16339. }
  16340. var u = r("../settings")
  16341. , t = r("../util/logger")
  16342. , d = r("../enum/Viewmode")
  16343. , p = r("../objects/Snapshot")
  16344. , i = (r("../util/math"),
  16345. r("../util/common"))
  16346. , n = r("../util/IndexedCollection")
  16347. , l = new t(e);
  16348. i.inherit(h, n),
  16349. h.prototype.getImage = function(e) {
  16350. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16351. }
  16352. ,
  16353. h.prototype.filterByModesAndReel = function(e, t) {
  16354. for (var i = [], n = 0; n < t.length; n += 1) {
  16355. var r = t[n]
  16356. , o = this.index[r.sid];
  16357. o && i.push(o)
  16358. }
  16359. var a = e[d.DOLLHOUSE]
  16360. , s = e[d.FLOORPLAN];
  16361. (i = i.filter(function(e) {
  16362. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16363. return !0;
  16364. var t;
  16365. try {
  16366. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16367. } catch (e) {
  16368. return l.debug(e.message),
  16369. !1
  16370. }
  16371. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16372. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16373. this.list = i,
  16374. this.reIndex()
  16375. }
  16376. ,
  16377. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16378. if (0 === this.list.length)
  16379. return [];
  16380. var locations = [];
  16381. var deal = (n, container)=>{
  16382. var r = n.thumbnail_signed_src,
  16383. o = n.name || "";
  16384. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16385. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16386. var a = panos.get(n.metadata.scan_id);
  16387. if (a && !a.isAligned()) return
  16388. }
  16389. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16390. if (s === d.MESH) return
  16391. if(window.isLocal)var src = manage.dealURL(r)
  16392. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16393. var l = {
  16394. cameraMode: s,
  16395. position: n.metadata.camera_position,
  16396. quaternion: n.metadata.camera_quaternion,
  16397. zoom: n.metadata.zoom,
  16398. panoId: n.metadata.scan_id,
  16399. orthoZoom: n.metadata.ortho_zoom,
  16400. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16401. thumbUrl: src,
  16402. name: h.filterImageName(o),
  16403. sid: n.sid
  16404. }
  16405. var item = new p(l);
  16406. item.momentTour = n.momentTour
  16407. item.dontRot = n.dontRot
  16408. item.rotTime = n.rotTime
  16409. container.push(item)
  16410. return item
  16411. }
  16412. }
  16413. this.list.forEach(image=>{
  16414. if(image.images){
  16415. var folder = $.extend({}, image )
  16416. folder.heroLocations = [];
  16417. image.images.list.forEach(child=>{
  16418. deal(child, folder.heroLocations);
  16419. })
  16420. folder.musicInfo = folder.musicInfo || {}
  16421. locations.push(folder)
  16422. delete folder.images;
  16423. delete folder.locations;
  16424. }else{
  16425. var item = deal(image, locations);
  16426. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16427. }
  16428. })
  16429. return locations
  16430. }
  16431. ,
  16432. h.prototype.getIndex = function(e) {
  16433. return e.sid
  16434. }
  16435. ,
  16436. h.filterImageName = function(e) {
  16437. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16438. }
  16439. ,
  16440. o.exports = h
  16441. }
  16442. ).call(this, "/js/model/ImageCollection.js")
  16443. }
  16444. , {
  16445. "../enum/Viewmode": 51,
  16446. "../objects/Snapshot": 153,
  16447. "../settings": 166,
  16448. "../util/IndexedCollection": 175,
  16449. "../util/common": 185,
  16450. "../util/logger": 189,
  16451. "../util/math": 190
  16452. }],
  16453. 138: [function(h, u, e) {
  16454. (function(e) {
  16455. "use strict";
  16456. function n() {
  16457. c.call(this)
  16458. }
  16459. var r = h("../label/Label")
  16460. , i = h("../settings")
  16461. , t = h("../util/logger")
  16462. , o = h("../util/math")
  16463. , a = h("../util/ajax")
  16464. , s = h("./RoomCollection")
  16465. , l = h("../util/common")
  16466. , c = h("../util/IndexedCollection");
  16467. new t(e),
  16468. l.inherit(n, c),
  16469. n.prototype.getIndex = function(e) {
  16470. return e.labelId
  16471. }
  16472. ,
  16473. n.prototype.associateWithRooms = function(e) {
  16474. this.forEach(function(t) {
  16475. e.forEach(function(e) {
  16476. e.roomId === t.roomId && (t.room = e)
  16477. })
  16478. })
  16479. }
  16480. ,
  16481. n.prototype.createFromLabelData = function(e) {
  16482. e.forEach(function(e) {
  16483. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16484. t = s.generateRoomId(e.floorId, t);
  16485. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16486. i.position = o.convertWorkshopVector(i.position),
  16487. this.add(i),
  16488. i.build()
  16489. }
  16490. .bind(this))
  16491. }
  16492. ,
  16493. n.prototype.load = function(e, t) {
  16494. return a.get(e, {
  16495. responseType: "json",
  16496. auth: t ? i.authorizationHeader : null
  16497. }).done(function(e) {
  16498. var t = [];
  16499. for (var i in e) {
  16500. var n = e[i];
  16501. t.push(n)
  16502. }
  16503. this.createFromLabelData(t)
  16504. }
  16505. .bind(this))
  16506. }
  16507. ,
  16508. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16509. var t = -1;
  16510. if (e) {
  16511. if(typeof e == 'number'){
  16512. t = parseInt(e)
  16513. }else{
  16514. var i = e.split("_");
  16515. t = parseInt(i[0])
  16516. }
  16517. }
  16518. return t
  16519. }
  16520. ,
  16521. u.exports = n
  16522. }
  16523. ).call(this, "/js/model/LabelCollection.js")
  16524. }
  16525. , {
  16526. "../label/Label": 90,
  16527. "../settings": 166,
  16528. "../util/IndexedCollection": 175,
  16529. "../util/ajax": 181,
  16530. "../util/common": 185,
  16531. "../util/logger": 189,
  16532. "../util/math": 190,
  16533. "./RoomCollection": 141
  16534. }],
  16535. 139: [function(P, O, e) {
  16536. (function(e) {
  16537. "use strict";
  16538. function t(e, t) {
  16539. o.Object3D.call(this),
  16540. this.sid = window.number;//t.sid,
  16541. this.data = t,
  16542. this.options = e,
  16543. this.urls = new i(e.urlFiles),
  16544. this.isPublic = void 0 !== t.is_public && t.is_public,
  16545. //创建heroLocations
  16546. this.images = new E(this),
  16547. this.images.extend(t.images),
  16548. this.images.forEach((info)=>{
  16549. if(info.locations){
  16550. info.images = new E(this);
  16551. info.images.extend(info.locations)
  16552. }
  16553. })
  16554. this.heroLocations = []
  16555. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16556. this.outdoorPanoLocations = [],
  16557. this.floors = new c(this),
  16558. this.floorsEnabled = void 0 === e.floors || e.floors,
  16559. this.changingFloor = !1,
  16560. this.chunks = [],
  16561. this.panos = new g,
  16562. this.colliders = [],
  16563. this.loadPanosPromise = null,
  16564. this.loadMeshTexturesPromise = null,
  16565. this.auxDataPromise = null,
  16566. this.meshTexturesLoaded = !1,
  16567. this.meshTextures = [],
  16568. this.tags = {},
  16569. this.tagsShown = !1,
  16570. this.shouldShowtags = !1,
  16571. this.has360Views = !1,
  16572. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16573. this.supportedModes = {},
  16574. this.supportedModes[s.PANORAMA] = !0,
  16575. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16576. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16577. this.supportedModes[s.TRANSITIONING] = !0,
  16578. this.supportsTiles = this.configureTiling(),
  16579. this.supportsVR = window.DATA.supportsVR || false//!0,
  16580. this.mode = s.DOLLHOUSE,
  16581. this.size = null,
  16582. this.center = null,
  16583. this.boundingBox = new o.Box3,
  16584. this.currentFloor = null,
  16585. this.allFloorsVisible = !0,
  16586. this.projectedPano0 = null,
  16587. this.projectedPano1 = null,
  16588. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16589. this.addFloor(new r(this,t,e.trim()))
  16590. }
  16591. .bind(this)),
  16592. this.waitQueue = [],
  16593. this.on("load", function(e) {
  16594. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16595. return !e.isLoadedCallback()
  16596. }),
  16597. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16598. }
  16599. .bind(this)),
  16600. this.setupCustomProperties(),
  16601. this.hots = {}
  16602. }
  16603. var o = P("three")
  16604. , a = P("../util/ajax")
  16605. , i = P("../util/ModelUrls")
  16606. , n = P("../objects/BoundingTextureSkybox")
  16607. , s = P("../enum/Viewmode")
  16608. , l = P("../enum/RenderOrder")
  16609. , r = (P("../enum/AlignmentType"),
  16610. P("../objects/Floor"))
  16611. , c = P("./FloorCollection")
  16612. , h = P("../objects/Chunk")
  16613. , u = (P("../objects/Room"),
  16614. P("../objects/Snapshot"),
  16615. P("../label/Label"),
  16616. P("../util/math"),
  16617. P("../settings"))
  16618. , d = P("../shaders")
  16619. , p = P("../util/logger")
  16620. , f = (P("../tag/tag"),
  16621. P("../tag/tagManager"),
  16622. P("../objects/Panorama"))
  16623. , g = P("../util/PanoramaCollection")
  16624. , m = P("../loaders/ModelLoader")
  16625. , v = P("../loaders/ModelTextureLoader")
  16626. , y = P("../loaders/SweepDataLoader")
  16627. , A = P("../util/transitions")
  16628. , C = (P("../util/easing"),
  16629. P("../util/lerp"),
  16630. P("../util/common"))
  16631. , I = (P("../util/texture"),
  16632. P("./../util/browser"))
  16633. , E = P("./ImageCollection")
  16634. , _ = P("./RoomCollection")
  16635. , b = P("./LabelCollection")
  16636. , w = P("./Chunks")
  16637. , T = P("./../util/showcase")
  16638. , x = P("../exception/BasicException")
  16639. , S = (P("../constants"),
  16640. P("events").EventEmitter)
  16641. // , M = P("hot")
  16642. , R = new p(e);
  16643. t.prototype = Object.create(o.Object3D.prototype),
  16644. C.extend(t, S),
  16645. t.prototype.setupCustomProperties = function() {
  16646. var t = u.modelAlpha;
  16647. Object.defineProperty(this, "alpha", {
  16648. get: function() {
  16649. return t
  16650. },
  16651. set: function(e) {
  16652. t = e,
  16653. this.chunks.forEach(function(e) {
  16654. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16655. })
  16656. }
  16657. })
  16658. }
  16659. ,
  16660. t.prototype.configureTiling = function() {
  16661. var e = function() {
  16662. try {
  16663. var e = document.createElement("canvas")
  16664. , t = e.getContext("webgl");
  16665. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16666. } catch (e) {
  16667. return 0
  16668. }
  16669. }();
  16670. if (e < 2048)
  16671. return !1;
  16672. R.warn("Max cube texture size: " + e);
  16673. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16674. var i = u.tiling.tilingFlagNames[t];
  16675. if ("1" === I.valueFromHash(i, null))
  16676. return !0;
  16677. if ("0" === I.valueFromHash(i, null))
  16678. return !1
  16679. }
  16680. return !!T.modelDataPromisesTiles(this.data)
  16681. }
  16682. ,
  16683. t.prototype.toggleAlpha = function() {
  16684. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16685. }
  16686. ,
  16687. t.prototype.load = function(e) {
  16688. var t = this.urls.init().then(function() {
  16689. return $.when(this.loadPanos(), this.loadMesh())
  16690. }
  16691. .bind(this));
  16692. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16693. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16694. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16695. }
  16696. ,
  16697. t.prototype.loadMesh = function() {
  16698. var n = $.Deferred()
  16699. , r = this;
  16700. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16701. if (0 === e.length) {
  16702. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16703. r.supportedModes[s.DOLLHOUSE] = !1,
  16704. r.supportedModes[s.FLOORPLAN] = !1;
  16705. var i = new h({
  16706. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16707. });
  16708. i.material.visible = !1,
  16709. i.rotateX(-Math.PI / 2),
  16710. i.geometry.computeBoundingBox(),
  16711. e = [i]
  16712. }
  16713. e.forEach(function(e) {
  16714. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16715. r.addChunk(t, e)
  16716. }),
  16717. r.floors.sort(),
  16718. n.resolve(r)
  16719. }, function(e, t) {
  16720. n.notify(e, t)
  16721. }, function(e) {
  16722. R.error(e),
  16723. n.reject("loading-failed")
  16724. }),
  16725. n.promise()
  16726. }
  16727. ,
  16728. t.prototype.loadMeshTextures = function() {
  16729. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16730. this.meshTexturesLoaded = !0
  16731. }
  16732. .bind(this))),
  16733. this.loadTexturesPromise
  16734. }
  16735. ,
  16736. t.prototype.loadhots = function() {
  16737. initHot(this)
  16738. this.roomLabels = []
  16739. let finish = (e={})=>{
  16740. g_data2 = hotMatcher(e)
  16741. this.hotsCount = 0;
  16742. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16743. let create = ()=>{
  16744. //alertInfo('开始计算',{dontAutoClose:true, hideCloseBtn:true, name:'getPanoVisibles'}); //暂时没找到很多热点要计算的场景
  16745. if(e.hots){
  16746. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16747. sids.forEach((sid)=>{
  16748. e.hots[sid].sid = sid
  16749. if(e.hots[sid].texType == 'photo' && !e.hots[sid].texSrc)return console.error('有photo热点无texSrc',e.hots[sid])
  16750. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  16751. })
  16752. }
  16753. if(e.overlays){
  16754. e.overlays.forEach((info)=>{
  16755. new Hot(info, 'byOverlay')
  16756. })
  16757. }
  16758. Hot.createHotList();
  16759. if(DATA.roomLabels){
  16760. DATA.roomLabels.forEach((data)=>{
  16761. this.roomLabels.push(new RoomLabel(data))
  16762. })
  16763. }
  16764. //alertClose('getPanoVisibles');
  16765. Hot.startLoad()
  16766. editTool.loadDone('data2', e)
  16767. }
  16768. if(player.currentPano){
  16769. create()
  16770. }else{
  16771. let f = ()=>{
  16772. window.bus.removeEventListener('playerAndModelReady',f)
  16773. create()
  16774. }
  16775. window.bus.addEventListener('playerAndModelReady',f)
  16776. }
  16777. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16778. r.resolve()
  16779. }
  16780. var r = $.Deferred()
  16781. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16782. return a.get(e, {
  16783. responseType: "json",
  16784. auth: this.isPublic ? null : u.authorizationHeader
  16785. }).done(function(e) {
  16786. window.data2 = e;
  16787. finish(e)
  16788. }
  16789. .bind(this)).fail(function() {
  16790. /* console.log("没有热点"),
  16791. Hot.startLoad()
  16792. editTool.loadDone('data2', {}) */
  16793. finish()
  16794. }),
  16795. r
  16796. }
  16797. ,
  16798. t.prototype.loadPanos = function() {
  16799. if (this.loadPanosPromise)
  16800. return this.loadPanosPromise;
  16801. var e = new y(this);
  16802. return this.loadPanosPromise = e.load().then(function(e) {
  16803. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  16804. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16805. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16806. else console.log(e.uuid)
  16807. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16808. }
  16809. .bind(this))),
  16810. this.panos.extend(e.map(function(e) {
  16811. return new f(this,e.uuid,e,this.supportsTiles)
  16812. }
  16813. .bind(this))),
  16814. this.panos.forEach(function(i) {
  16815. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16816. var t = this.panos.get(e);
  16817. t && this.panos.setNeighbour(i, t, !0)
  16818. }
  16819. .bind(this)),
  16820. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16821. }
  16822. .bind(this)),
  16823. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16824. this.supportedModes[s.PANORAMA] = !1),
  16825. $.when(this)
  16826. }
  16827. .bind(this)),
  16828. this.loadPanosPromise
  16829. }
  16830. ,
  16831. t.prototype.loadHighlightReel = function() {
  16832. var t = $.Deferred()
  16833. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16834. return a.get(e, {
  16835. responseType: "json",
  16836. auth: this.isPublic ? null : u.authorizationHeader
  16837. }).done(function(e) {
  16838. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16839. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16840. t.resolve()
  16841. }
  16842. .bind(this)).fail(function() {
  16843. R.warn("Getting highlight reel failed, no highlights available"),
  16844. t.resolve()
  16845. }),
  16846. t
  16847. }
  16848. ,
  16849. t.prototype.waitForLoad = function(e, t) {
  16850. t() || (this.waitQueue.push({
  16851. object: e,
  16852. isLoadedCallback: t
  16853. }),
  16854. 1 === this.waitQueue.length && this.emit("waiting"))
  16855. }
  16856. ,
  16857. t.prototype.hide = function() {
  16858. this.floors.hide()
  16859. }
  16860. ,
  16861. t.prototype.show = function() {
  16862. this.floors.show()
  16863. }
  16864. ,
  16865. t.prototype.floorNames = function() {
  16866. return this.floors.names()
  16867. }
  16868. ,
  16869. t.prototype.warpDestFloors = function(e, t) {
  16870. if (e && this.floors.length === e.length) {
  16871. var i = e.findIndex(function(e) {
  16872. return e
  16873. }
  16874. .bind(this));
  16875. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16876. } else
  16877. this.toggleAllFloors(!0)
  16878. }
  16879. ,
  16880. t.prototype.setFloor = function(e, t, i) {
  16881. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16882. this.allFloorsVisible = !1,
  16883. this._setFloor(e, t, i)
  16884. }
  16885. ,
  16886. t.prototype.toggleAllFloors = function(e) {
  16887. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16888. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16889. this._setFloor(this.currentFloor)
  16890. }
  16891. ,
  16892. t.prototype._setFloor = function(e, t, i) {
  16893. var n;
  16894. if (t = t || this.mode,
  16895. this.emit("floor.changed", e, t, this.currentFloor),
  16896. this.currentFloor = e,
  16897. t === s.PANORAMA) {
  16898. if (this.show(),
  16899. this.shouldShowtags && this.tagsShown)
  16900. for (n in this.tags)
  16901. this.tags[n].show(u.showFloorDuration)
  16902. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16903. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16904. }
  16905. .bind(this)),
  16906. this.shouldShowtags && this.tagsShown))
  16907. for (n in this.tags) {
  16908. var r = this.tags[n];
  16909. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16910. }
  16911. var o = this
  16912. , a = e;
  16913. A.start(function() {}, u.showFloorDelay, function() {
  16914. o.floors.forEach(function(t) {
  16915. t.chunks.forEach(function(e) {
  16916. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16917. })
  16918. })
  16919. }
  16920. .bind(this))
  16921. }
  16922. ,
  16923. t.prototype.toggleExplode = function() {
  16924. this.floors.toggleExplodeHorizontal()
  16925. }
  16926. ,
  16927. t.prototype.toggleExplodeUp = function() {
  16928. this.floors.toggleExplodeVertical()
  16929. }
  16930. ,
  16931. t.prototype.nextFloor = function(e) {
  16932. return this.floors.nextFloor(this.currentFloor, e)
  16933. }
  16934. ,
  16935. t.prototype.addFloor = function(e) {
  16936. this.floors.add(e)
  16937. }
  16938. ,
  16939. t.prototype.getFloorAtPoint = function(e) {
  16940. return this.floors.getFloorAtPoint(e)
  16941. }
  16942. ,
  16943. t.prototype.getTagBySid = function(e) {
  16944. return this.tags[e]
  16945. }
  16946. ,
  16947. t.prototype.addChunk = function(e, t) {
  16948. this.floors.getOrMakeFloor(e).addChunk(t),
  16949. this.chunks.push(t)
  16950. }
  16951. ,
  16952. t.prototype.setMode = function(t) {
  16953. if (!this.supportedModes[t])
  16954. throw new x("Mode not supported for this model: " + t);
  16955. this.mode = t
  16956. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  16957. this.chunks.forEach(function(e) {
  16958. e.setMode(t)
  16959. })
  16960. }
  16961. ,
  16962. t.prototype.build = function() {
  16963. this.heroLocations = this.images.getHeroLocations(this.panos);
  16964. var e = function() {
  16965. 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()
  16966. }
  16967. .bind(this)();
  16968. this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16969. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16970. }
  16971. .bind(this)) || e,
  16972. null === this.heroImage && R.warn("No hero image defined."),
  16973. this.currentFloor = this.floors.last(),
  16974. this.floors.build(),
  16975. this.colliders = this.floors.reduce(function(e, t) {
  16976. return e.concat(t.collider.children)
  16977. }, []),
  16978. this.panos.forEach(function(e) {
  16979. e.build1(),
  16980. e.on("enter", function() {
  16981. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16982. }
  16983. .bind(this))
  16984. }
  16985. .bind(this))
  16986. let downVec = new THREE.Vector3(0,-1,0)
  16987. this.panos.forEach((pano)=>{
  16988. player.raycaster.set(pano.position, downVec);
  16989. let collider = pano.floor.collider.children
  16990. let n = player.raycaster.intersectObjects(collider , true );//add true
  16991. if(n && n[0]){
  16992. if(n[0].point.y - pano.floorPosition.y > 0.03){
  16993. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  16994. pano.originFloorY = pano.floorPosition.y
  16995. pano.floorPosition.y = n[0].point.y
  16996. }
  16997. }
  16998. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  16999. })
  17000. this.panos.forEach(function(e) {
  17001. e.build2()
  17002. }),
  17003. window.PuckHeightHelper && (window.PuckHeightHelper.captureBaseFloorPosition(this),
  17004. window.PuckHeightHelper.applyToModel(this, window.DATA && window.DATA.puckHeight)),
  17005. this.floors.forEach(function(e) {
  17006. this.boundingBox.union(e.boundingBox)
  17007. }
  17008. .bind(this)),
  17009. this.size = this.boundingBox.size(),
  17010. this.center = this.boundingBox.center(),
  17011. this.floors.forEach(function(e) {
  17012. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17013. }
  17014. .bind(this)),
  17015. this.panos.populate_path_graph(),
  17016. this.skybox = new n(this.boundingBox),
  17017. this.skybox.matrixWorldNeedsUpdate = !0,
  17018. this.add(this.skybox)
  17019. //因为一部分漫游点在模型外
  17020. {
  17021. let bounding = new THREE.Box3 //不包含pano的bound
  17022. this.floors.list.forEach(floor=>{
  17023. bounding.union(floor.conservativeBoundingBox)
  17024. })
  17025. this.boundWithoutPanos = bounding
  17026. this.sizeWithoutPanos = bounding.size()
  17027. this.centerWithoutPanos = bounding.center()
  17028. /* 如果想居中模型, bound不加pano:
  17029. this.boundingBox = bounding
  17030. this.size = bounding.size()
  17031. this.center = bounding.center() */
  17032. }
  17033. return R.debug("Done building model"),
  17034. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17035. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17036. this.buildRooms(),
  17037. this.labels.associateWithRooms(this.rooms),
  17038. $.when(this)
  17039. }
  17040. ,
  17041. t.prototype.loadLabels = function() {
  17042. this.labels = new b(this);
  17043. var e = $.Deferred();
  17044. window.DATA.showingLabels ? this.showingLabels = true : '';
  17045. if (!this.showingLabels)
  17046. return e.resolve();
  17047. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17048. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17049. R.warn("Getting labels failed, not displaying labels."),
  17050. e.resolve()
  17051. }),
  17052. e
  17053. }
  17054. ,
  17055. t.prototype.buildRooms = function() {
  17056. this.rooms = new _(this),
  17057. this.rooms.createFromChunks(this.chunks),
  17058. this.rooms.calcRoomBoundaries()
  17059. }
  17060. ,
  17061. t.prototype.updateProjectedPanos = function() {
  17062. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17063. }
  17064. ,
  17065. t.prototype.setProjectedPanos = function(t, i, n) {
  17066. null != n || (n = !0),
  17067. n = !!n,
  17068. this.projectedPano0 = t,
  17069. this.projectedPano1 = i,
  17070. this.skybox.material.setProjectedPanos(t, i, n),
  17071. this.chunks.forEach(function(e) {
  17072. e.materialInside.setProjectedPanos(t, i, n)
  17073. })
  17074. }
  17075. ,
  17076. t.prototype.setSide = function(t) {
  17077. this.floors.forEach(function(e) {
  17078. e.collider.material.side = t
  17079. })
  17080. }
  17081. ,
  17082. t.prototype.heroCount = function() {
  17083. return this.heroLocations ? this.heroLocations.length : 0
  17084. }
  17085. ,
  17086. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17087. if (e[0] < 0)
  17088. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17089. null;
  17090. if (this.heroCount() < 1)
  17091. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17092. null;
  17093. var t = this.heroLocations[e[0]];
  17094. if(t.heroLocations && e[1]!=void 0){
  17095. t = t.heroLocations[e[1]];
  17096. }
  17097. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17098. null) : t
  17099. }
  17100. ,
  17101. t.prototype.findPanoramicHero = function() {
  17102. for (var e in this.heroLocations)
  17103. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17104. return this.heroLocations[e];
  17105. return null
  17106. }
  17107. ,
  17108. t.prototype.listImagePanos = function() {
  17109. var i = []
  17110. , n = this;
  17111. return this.images.forEach(function(e) {
  17112. if (e.metadata && e.metadata.scan_id) {
  17113. var t = n.panos.get(e.metadata.scan_id);
  17114. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17115. }
  17116. }),
  17117. i
  17118. }
  17119. ,
  17120. t.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  17121. if(window.DATA.hideFloorMarker)return
  17122. var currentPano = player.currentPano
  17123. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  17124. var hideWhenFlyOut = () => {
  17125. var shows = [],
  17126. hides = []
  17127. player.model.panos.forEach(pano => {
  17128. hides.push(pano)
  17129. })
  17130. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  17131. }
  17132. if (opacity == 0) {
  17133. hideWhenFlyOut()
  17134. } else {
  17135. if (player.mode == 'panorama' && currentPano) {
  17136. var shows = [], hides = []
  17137. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  17138. if (pano.id === currentPano.id) {
  17139. hides.push(pano)
  17140. } else if (currentPano.neighbourPanos[pano.id]) {
  17141. shows.push(pano)
  17142. } else {
  17143. hides.push(pano)
  17144. }
  17145. })
  17146. this.panos.fadeMarkerOpacity(opacity, dur, [
  17147. { toOp: opacity, member: shows },
  17148. { toOp: 0, member: hides },
  17149. ])
  17150. } else if (player.modeTran.split('-')[1] != 'panorama') {
  17151. //飞出后marker隐藏
  17152. hideWhenFlyOut()
  17153. }
  17154. }
  17155. }
  17156. ,
  17157. t.prototype.setSweepVisibility = function(t) {
  17158. this.panos.forEach(function(e) {
  17159. e.marker && (e.marker.visible = t)
  17160. })
  17161. }
  17162. ,
  17163. t.prototype.outsideAllowed = function() {
  17164. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17165. }
  17166. ,
  17167. O.exports = t
  17168. }
  17169. ).call(this, "/js/model/Model.js")
  17170. }
  17171. , {
  17172. "../constants": 8,
  17173. "../enum/AlignmentType": 17,
  17174. "../enum/RenderOrder": 42,
  17175. "../enum/Viewmode": 51,
  17176. "../exception/BasicException": 55,
  17177. "../label/Label": 90,
  17178. "../loaders/ModelLoader": 105,
  17179. "../loaders/ModelTextureLoader": 106,
  17180. "../loaders/SweepDataLoader": 107,
  17181. "../tag/tag": 123,
  17182. "../tag/tagManager": 124,
  17183. "../objects/BoundingTextureSkybox": 143,
  17184. "../objects/Chunk": 144,
  17185. "../objects/Floor": 146,
  17186. "../objects/Panorama": 148,
  17187. "../objects/Room": 150,
  17188. "../objects/Snapshot": 153,
  17189. "../settings": 166,
  17190. "../shaders": 167,
  17191. "../util/ModelUrls": 177,
  17192. "../util/PanoramaCollection": 178,
  17193. "../util/ajax": 181,
  17194. "../util/common": 185,
  17195. "../util/easing": 186,
  17196. "../util/lerp": 188,
  17197. "../util/logger": 189,
  17198. "../util/math": 190,
  17199. "../util/texture": 194,
  17200. "../util/transitions": 195,
  17201. "./../util/browser": 182,
  17202. "./../util/showcase": 193,
  17203. "./Chunks": 135,
  17204. "./FloorCollection": 136,
  17205. "./ImageCollection": 137,
  17206. "./LabelCollection": 138,
  17207. "./RoomCollection": 141,
  17208. events: 202,
  17209. three: 217,
  17210. //hot: "hot"
  17211. }],
  17212. 140: [function(e, t, i) {
  17213. "use strict";
  17214. function n() {
  17215. this.modelMap = {},
  17216. this.activeModel = null,
  17217. this.modelCount = 0,
  17218. this.tileDownloader = null,
  17219. this.panoRenderer = null
  17220. }
  17221. var r = (e("three"),
  17222. e("../util/common"))
  17223. , o = e("../exception/BasicException")
  17224. , a = e("../enum/ModelManagerEvents")
  17225. , s = e("../enum/PanoRendererEvents")
  17226. , l = e("events").EventEmitter;
  17227. n.prototype.init = function(e, t, i) {
  17228. this.tileDownloader = e,
  17229. this.panoRenderer = t,
  17230. this.qualityManager = i,
  17231. this.bindEvents()
  17232. }
  17233. ,
  17234. n.prototype.bindEvents = function() {
  17235. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17236. }
  17237. ,
  17238. n.prototype.onTileRendered = function(e, t, i, n) {}
  17239. ,
  17240. n.prototype.addModel = function(e) {
  17241. this.modelMap[e.sid] = e,
  17242. 0 === this.modelCount && this.activateModel(e.sid),
  17243. this.modelCount++,
  17244. this.emit(a.ModelAdded)
  17245. }
  17246. ,
  17247. n.prototype.getModel = function(e) {
  17248. return this.modelMap[e]
  17249. }
  17250. ,
  17251. n.prototype.activateModel = function(e) {
  17252. var t = this.modelMap[e];
  17253. if (!t)
  17254. throw new o("Tried to activate invalid model!");
  17255. var i = this.activeModel;
  17256. this.activeModel = t,
  17257. this.tileDownloader.setpanoData(t.panos, t.listImagePanos(), t.sid),
  17258. this.tileDownloader.setUrls(t.urls),
  17259. t.panos.forEach(function(e) {
  17260. e.attachToPanoRenderer(this.panoRenderer),
  17261. e.tileDownloader = this.tileDownloader,
  17262. e.qualityManager = this.qualityManager
  17263. }
  17264. .bind(this)),
  17265. this.emit(a.ActiveModelChanged, {
  17266. oldModel: i,
  17267. model: t
  17268. })
  17269. }
  17270. ,
  17271. n.prototype.getActiveModel = function() {
  17272. return this.activeModel
  17273. }
  17274. ,
  17275. r.extend(n, l),
  17276. t.exports = n
  17277. }
  17278. , {
  17279. "../enum/ModelManagerEvents": 33,
  17280. "../enum/PanoRendererEvents": 35,
  17281. "../exception/BasicException": 55,
  17282. "../util/common": 185,
  17283. events: 202,
  17284. three: 217
  17285. }],
  17286. 141: [function(r, l, e) {
  17287. (function(e) {
  17288. "use strict";
  17289. function o() {
  17290. n.call(this)
  17291. }
  17292. var a = r("../objects/Room")
  17293. , t = (r("../settings"),
  17294. r("../util/logger"))
  17295. , i = (r("../util/transitions"),
  17296. r("../util/easing"),
  17297. r("../util/common"))
  17298. , n = r("../util/IndexedCollection")
  17299. , s = r("./Chunks");
  17300. new t(e),
  17301. i.inherit(o, n),
  17302. o.prototype.getIndex = function(e) {
  17303. return e.roomId
  17304. }
  17305. ,
  17306. o.prototype.calcRoomBoundaries = function() {
  17307. this.forEach(function(e) {
  17308. e.calcBoundaries()
  17309. })
  17310. }
  17311. ,
  17312. o.prototype.createFromChunks = function(e) {
  17313. var n = {
  17314. floorId: -1,
  17315. roomId: -1
  17316. }
  17317. , r = {};
  17318. e.forEach(function(e) {
  17319. s.parseIdsFromChunkName(e.name, n);
  17320. var t = r[n.roomId];
  17321. if (!t) {
  17322. var i = o.generateRoomId(n.floorId, n.roomId);
  17323. t = new a(n.floorId,i),
  17324. this.add(t),
  17325. r[n.roomId] = t
  17326. }
  17327. t.addChunk(e)
  17328. }
  17329. .bind(this)),
  17330. this.calcRoomBoundaries()
  17331. }
  17332. ,
  17333. o.generateRoomId = function(e, t) {
  17334. return e + "_" + t
  17335. }
  17336. ,
  17337. l.exports = o
  17338. }
  17339. ).call(this, "/js/model/RoomCollection.js")
  17340. }
  17341. , {
  17342. "../objects/Room": 150,
  17343. "../settings": 166,
  17344. "../util/IndexedCollection": 175,
  17345. "../util/common": 185,
  17346. "../util/easing": 186,
  17347. "../util/logger": 189,
  17348. "../util/transitions": 195,
  17349. "./Chunks": 135
  17350. }],
  17351. 142: [function(e, t, i) {
  17352. "use strict";
  17353. function n(e, t, i) {
  17354. var n = (e = e.clone().expandByScalar(0.01)).size()
  17355. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17356. r.boundingBox = e,
  17357. o.Mesh.call(this, r, t),
  17358. this.position.copy(e.center()),
  17359. this.frustumCulled = !1,
  17360. i && this.add(new o.WireframeHelper(this))
  17361. }
  17362. var o = e("three");
  17363. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17364. t.exports = n
  17365. }
  17366. , {
  17367. three: 217
  17368. }],
  17369. 143: [function(l, c, e) {
  17370. (function(e) {
  17371. "use strict";
  17372. function t(e) {
  17373. s.time("Computing a nice bounding cubemap");
  17374. var t = new r({
  17375. side: i.BackSide,
  17376. transparent: !0
  17377. });
  17378. t.uniforms.modelAlpha.value = 0,
  17379. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17380. this.renderOrder = a.boundingSkybox,
  17381. n.call(this, e, t),
  17382. s.timeEnd("Computing a nice bounding cubemap")
  17383. }
  17384. var i = l("three")
  17385. , n = (l("../enum/Viewmode"),
  17386. l("../shaders"),
  17387. l("./BoundingMesh"))
  17388. , r = l("../materials/ModelTextureMaterial")
  17389. , o = l("../settings")
  17390. , a = l("../enum/RenderOrder")
  17391. , s = new (l("../util/logger"))(e);
  17392. (t.prototype = Object.create(n.prototype)).constructor = t,
  17393. c.exports = t
  17394. }
  17395. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17396. }
  17397. , {
  17398. "../enum/RenderOrder": 42,
  17399. "../enum/Viewmode": 51,
  17400. "../materials/ModelTextureMaterial": 118,
  17401. "../settings": 166,
  17402. "../shaders": 167,
  17403. "../util/logger": 189,
  17404. "./BoundingMesh": 142,
  17405. three: 217
  17406. }],
  17407. 144: [function(e, t, i) {
  17408. "use strict";
  17409. function n(e) {
  17410. this.materialInside = new s({
  17411. side: r.DoubleSide
  17412. });
  17413. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17414. this.materialOutside = new r.RawShaderMaterial({
  17415. fragmentShader: o.modelOutside.fragmentShader,
  17416. vertexShader: o.modelOutside.vertexShader,
  17417. uniforms: t,
  17418. side: r.FrontSide,
  17419. name: "chunkOut"
  17420. }),
  17421. r.Mesh.call(this, e.geometry, this.materialInside),
  17422. this.name = e.name || "",
  17423. this.textureName = e.textureName,
  17424. this.meshUrl = e.meshUrl
  17425. }
  17426. var r = e("three")
  17427. , o = e("../shaders")
  17428. , a = e("../enum/Viewmode")
  17429. , s = e("../materials/ModelTextureMaterial");
  17430. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17431. this.materialInside.uniforms.map.value = e,
  17432. this.materialOutside.uniforms.map.value = e
  17433. }
  17434. ,
  17435. n.prototype.setMode = function(e) {
  17436. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17437. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17438. t.transparent = this.material.transparent,
  17439. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17440. this.material = t
  17441. }
  17442. ,
  17443. t.exports = n
  17444. }
  17445. , {
  17446. "../enum/Viewmode": 51,
  17447. "../materials/ModelTextureMaterial": 118,
  17448. "../shaders": 167,
  17449. three: 217
  17450. }],
  17451. 145: [function(e, t, i) {
  17452. "use strict";
  17453. function n(e) {
  17454. this.chunksize = e || 10,
  17455. this.chunks = {},
  17456. this.boundingBoxes = {},
  17457. this.children = [],
  17458. this.offset = new m.Vector3(0,.5,0),
  17459. this.material = new m.MeshBasicMaterial({
  17460. color: 16777215 * Math.random(),
  17461. side: m.DoubleSide
  17462. })
  17463. }
  17464. var m = e("three");
  17465. e("../enum/Viewmode"),
  17466. n.prototype.add = function(e) {
  17467. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17468. u ? (t = u.position.array,
  17469. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17470. e.faces);
  17471. var d = new m.Vector3;
  17472. if (i)
  17473. for (n = 0,
  17474. r = i.length; n < r; n += 3) {
  17475. var p = 3 * i[n]
  17476. , f = 3 * i[n + 1]
  17477. , g = 3 * i[n + 2];
  17478. o = (t[p] + t[f] + t[g]) / 3,
  17479. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17480. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17481. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17482. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17483. this.boundingBoxes[l] = new m.Box3),
  17484. 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]),
  17485. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17486. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17487. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17488. }
  17489. else
  17490. for (n = 0,
  17491. r = t.length; n < r; n += 9)
  17492. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17493. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17494. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17495. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17496. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17497. this.boundingBoxes[l] = new m.Box3),
  17498. 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]),
  17499. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17500. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17501. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17502. }
  17503. ,
  17504. n.prototype.build = function() {
  17505. var e = new m.Object3D;
  17506. for (var t in e.material = this.material,
  17507. this.chunks) {
  17508. var i = this.chunks[t]
  17509. , n = new m.BufferGeometry;
  17510. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17511. n.boundingBox = this.boundingBoxes[t];
  17512. var r = new m.Mesh(n,this.material);
  17513. r.material.visible = !1,
  17514. e.add(r),
  17515. this.chunks[t] = []
  17516. }
  17517. return e
  17518. }
  17519. ,
  17520. t.exports = n
  17521. }
  17522. , {
  17523. "../enum/Viewmode": 51,
  17524. three: 217
  17525. }],
  17526. 146: [function(e, t, i) {
  17527. "use strict";
  17528. var n = e("three")
  17529. , r = e("../settings")
  17530. , o = e("../util/common")
  17531. , a = e("../util/lerp")
  17532. , s = e("./ChunkedCollider")
  17533. , l = e("../util/transitions")
  17534. , c = e("../util/easing")
  17535. , h = (e("../objects/Panorama"),
  17536. e("../enum/RenderOrder"));
  17537. e("../localization/localize");
  17538. function u(e, t, i) {
  17539. n.Object3D.call(this),
  17540. this.model = e,
  17541. this.floorIndex = t,
  17542. this.lang = r.languageTag,
  17543. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17544. this.panos = [],
  17545. this.chunks = [],
  17546. this.colliderBuilder = new s(3),
  17547. this.collider = null,
  17548. this.center = null,
  17549. this.boundingBox = new n.Box3,
  17550. this.size = null,
  17551. this.hidden = !1,
  17552. this.conservativeBoundingBox = new n.Box3,
  17553. this.debugColor = 16777215 * Math.random(),
  17554. this.transition = null
  17555. }
  17556. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17557. this.model.setFloor(this, e)
  17558. }
  17559. ,
  17560. u.prototype.hide = function(e) {
  17561. if (!this.hidden || this.transition) {
  17562. this.chunks.forEach(function(e) {
  17563. e.material.transparent = !0
  17564. }),
  17565. l.cancel(this.transition);
  17566. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17567. , i = e ? 0 : r.hideFloorDelay / t;
  17568. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17569. this.hidden = !0
  17570. }
  17571. .bind(this), i, c.easeInOutQuad)
  17572. }
  17573. }
  17574. ,
  17575. u.prototype.show = function(e) {
  17576. if (this.hidden || this.transition) {
  17577. this.hidden = !1,
  17578. l.cancel(this.transition);
  17579. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17580. , i = e ? 0 : r.showFloorDelay / t;
  17581. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17582. this.hidden || this.chunks.forEach(function(e) {
  17583. e.material.transparent = !1
  17584. })
  17585. }
  17586. .bind(this), i, c.easeInOutQuad)
  17587. }
  17588. }
  17589. ,
  17590. u.prototype.toggle = function(e, t) {
  17591. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17592. }
  17593. ,
  17594. u.prototype.containsPoint = function(t) {
  17595. return this.collider.children.some(function(e) {
  17596. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17597. e.geometry.boundingBox.containsPoint(t)
  17598. })
  17599. }
  17600. ,
  17601. u.prototype.distanceToPoint = function(i) {
  17602. var n = null
  17603. , r = 1 / 0;
  17604. return this.collider.children.forEach(function(e) {
  17605. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17606. var t = e.geometry.boundingBox.distanceToPoint(i);
  17607. (!n || t < r) && (r = t,
  17608. n = e)
  17609. }),
  17610. r
  17611. }
  17612. ,
  17613. u.prototype.addChunk = function(e) {
  17614. e.renderOrder = h.ghostFloor,
  17615. this.add(e),
  17616. this.chunks.push(e),
  17617. this.boundingBox.union(e.geometry.boundingBox),
  17618. this.size = this.boundingBox.size(),
  17619. this.colliderBuilder.add(e.geometry)
  17620. }
  17621. ,
  17622. u.prototype.addPano = function(e) {
  17623. this.panos.push(e),
  17624. this.add(e.skyboxMesh),
  17625. e.marker && this.add(e.marker);
  17626. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17627. var t = new n.Vector3(1,1,1)
  17628. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17629. this.boundingBox.union(i)
  17630. }
  17631. }
  17632. ,
  17633. u.prototype.build = function() {
  17634. this.collider = this.colliderBuilder.build(!0),
  17635. this.add(this.collider),
  17636. this.center = this.boundingBox.center(),
  17637. this.conservativeBoundingBox.copy(this.boundingBox),
  17638. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17639. return e.geometry.boundingBox.min.y
  17640. }), 5),
  17641. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17642. return e.geometry.boundingBox.max.y
  17643. }), 5),
  17644. this.colliderBuilder = null
  17645. }
  17646. ,
  17647. u.prototype.toShortString = function() {
  17648. return o.nth(this.floorIndex + 1)
  17649. }
  17650. ,
  17651. u.prototype.toString = function() {
  17652. return this.name
  17653. }
  17654. ,
  17655. t.exports = u
  17656. }
  17657. , {
  17658. "../enum/RenderOrder": 42,
  17659. "../localization/localize": 108,
  17660. "./strings-cn-CN": 109,
  17661. "../objects/Panorama": 148,
  17662. "../settings": 166,
  17663. "../util/common": 185,
  17664. "../util/easing": 186,
  17665. "../util/lerp": 188,
  17666. "../util/transitions": 195,
  17667. "./ChunkedCollider": 145,
  17668. three: 217
  17669. }],
  17670. 147: [function(e, t, i) {
  17671. "use strict";
  17672. function n(e) {
  17673. this.player = e,
  17674. this.obj3d = null,
  17675. this.UP = new u.Vector3(0,1,0)
  17676. }
  17677. var u = e("three")
  17678. , d = e("../settings");
  17679. n.prototype.prefs = {
  17680. linewidth: 3,
  17681. height: .07,
  17682. opacity: .45,
  17683. endScale: .05
  17684. },
  17685. n.prototype.discard = function() {
  17686. if (this.obj3d) {
  17687. var e = this.obj3d.parent;
  17688. e && e.remove(this.obj3d)
  17689. }
  17690. this.obj3d = null
  17691. }
  17692. ,
  17693. n.prototype.draw = function() {
  17694. if (this.discard(),
  17695. d.showNeighbors) {
  17696. var e = this.player.currentPano.floor;
  17697. this.obj3d = new u.Object3D;
  17698. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17699. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17700. i.y += this.prefs.height;
  17701. var n = .1525
  17702. , r = new u.Matrix4;
  17703. for (var o in t)
  17704. if (t[o]) {
  17705. var a = this.player.model.panos.get(o)
  17706. , s = (a.position.clone().sub(this.player.model.position),
  17707. a.position.clone().sub(a.floorPosition))
  17708. , l = a.floorPosition.clone().sub(this.player.model.position);
  17709. l.y += this.prefs.height;
  17710. var c = new u.Geometry;
  17711. 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)),
  17712. 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)),
  17713. r.identity().setPosition(s),
  17714. c.applyMatrix(r),
  17715. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17716. 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)),
  17717. r.lookAt(l, i, this.UP).setPosition(l),
  17718. c.applyMatrix(r),
  17719. c.vertices.push(l, i);
  17720. var h = new u.Line(c,new u.LineBasicMaterial({
  17721. color: a.debugColor.getHex(),
  17722. transparent: !0,
  17723. opacity: this.prefs.opacity,
  17724. depthWrite: !1,
  17725. name: "sLine" + o,
  17726. linewidth: this.prefs.linewidth
  17727. }));
  17728. this.obj3d.add(h)
  17729. }
  17730. e.add(this.obj3d)
  17731. }
  17732. }
  17733. ,
  17734. n.prototype.update = function() {
  17735. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17736. }
  17737. ,
  17738. t.exports = n
  17739. }
  17740. , {
  17741. "../settings": 166,
  17742. three: 217
  17743. }],
  17744. 148: [function(S, M, e) {
  17745. (function(e) {
  17746. "use strict";
  17747. function r(e, t, i, n) {
  17748. this.model = e,
  17749. this.id = t,
  17750. this.alignmentType = i.alignmentType || c.ALIGNED,
  17751. this.neighbourUUIDs = i.neighbours,
  17752. this.neighbourPanos = null,
  17753. this.floor = null,
  17754. this.floorIndex = i.floor,
  17755. this.failedLoadingAt = 0,
  17756. this.maxLoadRetries = 4,
  17757. this.origin = i.position.clone(),
  17758. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17759. this.quaternion = i.quaternion.clone(),
  17760. this.skyboxMesh = new s.Mesh(E),
  17761. this.skyboxMesh.position.copy(this.position),
  17762. this.skyboxMesh.quaternion.copy(this.quaternion),
  17763. this.skyboxMesh.name = "skybox",
  17764. this.skyboxMesh.visible = !1,
  17765. this.skyboxMesh.updateMatrix(),
  17766. this.skyboxMesh.updateMatrixWorld(),
  17767. this.marker = null,
  17768. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker
  17769. if(this.isAligned() ){
  17770. this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17771. map: b,
  17772. side: s.DoubleSide,
  17773. opacity: 0,
  17774. transparent: !0,
  17775. depthWrite: !1
  17776. })),
  17777. this.marker.visible = false //改:先不显示,之后根据opacity显示
  17778. this.marker.renderOrder = l.panoMarker,
  17779. this.marker.name = "marker",
  17780. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17781. this.marker.updateMatrixWorld()
  17782. if(!window.DATA.hideFloorMarker){//xzw
  17783. let opa = this.marker.material.opacity
  17784. Object.defineProperty(this.marker.material, 'opacity', {
  17785. get: function () {
  17786. return opa
  17787. },
  17788. set: (o)=>{
  17789. opa = o
  17790. //if(o>0)console.log('o>0',this.pano.id)
  17791. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o != 0)
  17792. },
  17793. })
  17794. }
  17795. a.colorMarkerOnLoad && this.on("load", function() {
  17796. this.marker.material.color.set(65280)
  17797. })
  17798. }
  17799. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17800. this.floorPosition = i.puck ? i.puck.clone() : null,
  17801. this.tiled = n,
  17802. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17803. this.solidSkybox.flipY = !1,
  17804. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17805. this.solidSkybox.magFilter = s.LinearFilter,
  17806. this.solidSkybox.generateMipmaps = !1)),
  17807. this.zoomed = !1,
  17808. this.panoRenderer = null,
  17809. this.qualityManager = null,
  17810. this.tileDownloader = null,
  17811. this.tiledPanoRenderTarget = null,
  17812. this.minimumTiledPanoLoaded = !1,
  17813. this.highestPartialTileRenderOpCompleted = 0,
  17814. this.highestFullTileRenderOpCompleted = 0,
  17815. this.shouldRedrawOnBaseLoaded = !1,
  17816. this.lockUntilRenderingComplete = !1,
  17817. a.colorMarkerOnLoad && this.on("load", function() {
  17818. this.marker.material.color.set(65280)
  17819. }),
  17820. (e = new s.TextureLoader).setCrossOrigin(!0);
  17821. var r = e.load("images/texture.jpg");
  17822. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17823. color: 16777215,
  17824. transparent: !0,
  17825. opacity: .75,
  17826. map: r
  17827. })),
  17828. this.vrMarker.boluoType = "vr",
  17829. this.vrMarker.position.z = 1,
  17830. this.vrMarker.enabled = !0,
  17831. this.vrMarker.visible = !1,
  17832. window.vrMarkers = window.vrMarkers || [],
  17833. window.vrMarkers.push(this.vrMarker),
  17834. this.marker && this.marker.add(this.vrMarker),
  17835. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17836. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17837. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17838. this.adjustAngleEnable) {
  17839. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17840. this.skyboxMesh.quaternion.multiply(i);
  17841. var o = new s.Quaternion;
  17842. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17843. this.skyboxMesh.quaternion.multiply(o),
  17844. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17845. this.skyboxMesh.quaternion.multiply(n),
  17846. this.skyboxMesh.updateMatrix(),
  17847. this.skyboxMesh.updateMatrixWorld(),
  17848. this.model.updateProjectedPanos()
  17849. }
  17850. }
  17851. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17852. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17853. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17854. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17855. S("../enum/GLCubeFaces"),
  17856. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.35,.35,1,1), b = d.load("images/marker.png");
  17857. b.anisotropy = 4; //add
  17858. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17859. function() {
  17860. this.setZoomed(!1),
  17861. this.emit("enter", {
  17862. oldPano: t,
  17863. newPano: this
  17864. }),
  17865. t = this
  17866. }
  17867. ),
  17868. r.prototype.exit = function() {
  17869. this.tiled ? (this.clearWaitDeferreds(),
  17870. this.minimumTiledPanoLoaded = !1,
  17871. this.tiledPanoRenderTarget = null,
  17872. this.setZoomed(!1),
  17873. this.panoRenderer.deactivateTiledPano(this),
  17874. this.highestPartialTileRenderOpCompleted = 0,
  17875. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17876. this.solidSkybox.loaded = !1,
  17877. this.solidSkybox.version = 0),
  17878. this.emit("exit")
  17879. }
  17880. ,
  17881. r.prototype.hoverOn = function(e) {
  17882. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17883. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17884. }
  17885. ,
  17886. r.prototype.hoverOff = function(e) {
  17887. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17888. }
  17889. ,
  17890. r.prototype.build1 = function() {
  17891. this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position), //改
  17892. this.floor.addPano(this)
  17893. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17894. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17895. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17896. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  17897. }
  17898. ,
  17899. r.prototype.build2 = function() {
  17900. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17901. this.height = this.position.distanceTo(this.floorPosition),
  17902. this.placeMarker()
  17903. }
  17904. ,
  17905. r.prototype.interpolateFloorPosition = function() {
  17906. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17907. return !!e.floorPosition
  17908. }).sort(function(e, t) {
  17909. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17910. }
  17911. .bind(this))
  17912. , t = this.position.clone();
  17913. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17914. t
  17915. }
  17916. ,
  17917. r.prototype.raycastFloorPosition = function() {
  17918. I.warn("Performance warning: Raycasting to find floor position");
  17919. var e = this.floor && this.floor.collider && this.floor.collider.children && this.floor.collider.children.length ? this.floor.collider.children : this.model.colliders
  17920. , t = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(e, !0);
  17921. return t.length ? t[0].point : null
  17922. }
  17923. ,
  17924. 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)],
  17925. function() {
  17926. I.warn("Performance warning: Raycasting to find floor index");
  17927. for (var e = 0; e < i.length; e++) {
  17928. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17929. if (t.length)
  17930. return t[0].object.parent.parent
  17931. }
  17932. return null
  17933. }
  17934. ),
  17935. r.prototype.placeMarker = function() {
  17936. this.marker && (this.marker.position.copy(this.floorPosition),
  17937. this.marker.position.y += .1, //经常有marker比地面低,所以多往上调5cm
  17938. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17939. }
  17940. ,
  17941. r.prototype.translate = function(e) {
  17942. this.position.add(e),
  17943. this.floorPosition.add(e),
  17944. this.baseFloorPosition && this.baseFloorPosition.add(e)
  17945. }
  17946. ,
  17947. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17948. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17949. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17950. }
  17951. ,
  17952. r.prototype.attachToPanoRenderer = function(e) {
  17953. this.panoRenderer = e,
  17954. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17955. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17956. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17957. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17958. }
  17959. ;
  17960. var w, T, x = {};
  17961. r.prototype.getWaitDeferred = function(e) {
  17962. var t = x[this.id];
  17963. t || (t = {},
  17964. x[this.id] = t);
  17965. var i = t[e];
  17966. return i || (i = {
  17967. deferred: $.Deferred(),
  17968. active: !1
  17969. },
  17970. t[e] = i),
  17971. i
  17972. }
  17973. ,
  17974. r.prototype.resetWaitDeferred = function(e) {
  17975. var t = this.getWaitDeferred(e);
  17976. t.active = !1,
  17977. t.deferred = $.Deferred()
  17978. }
  17979. ,
  17980. r.prototype.clearWaitDeferreds = function() {
  17981. var e = x[this.id];
  17982. for (var t in e || (e = {},
  17983. x[this.id] = e),
  17984. e)
  17985. if (e.hasOwnProperty(t)) {
  17986. var i = e[t];
  17987. i.active = !1,
  17988. i.deferred = $.Deferred()
  17989. }
  17990. }
  17991. ,
  17992. r.prototype.loadTiledPano = (new s.Vector3,
  17993. w = [],
  17994. T = [],
  17995. function(e, t, i, n, r, o) {
  17996. null != n || (n = !0),
  17997. null != r || (r = !0);
  17998. var a = this.getWaitDeferred(e)
  17999. , s = a.deferred
  18000. , l = null
  18001. , c = null;
  18002. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18003. c = i.vFov)),
  18004. !this.isLoaded(e)) {
  18005. if (!a.active) {
  18006. if (a.active = !0,
  18007. i) {
  18008. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18009. w[this.id + ":" + e] = {
  18010. tileCount: 0,
  18011. targetTileCount: h
  18012. },
  18013. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18014. }
  18015. T[this.id] || (T[this.id] = !0,
  18016. this.on(f.LoadComplete, function(e, t) {
  18017. var i = this.getWaitDeferred(e).deferred;
  18018. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18019. this.resetWaitDeferred(e))
  18020. }
  18021. .bind(this)),
  18022. this.on(f.LoadFailed, function(e) {
  18023. var t = this.getWaitDeferred(e).deferred;
  18024. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18025. this.resetWaitDeferred(e))
  18026. }
  18027. .bind(this)),
  18028. this.on(f.TileLoaded, function(e, t, i) {
  18029. var n = this.getWaitDeferred(e).deferred;
  18030. if (n && "pending" === n.state()) {
  18031. n.notify(e, t, i);
  18032. var r = w[this.id + ":" + e];
  18033. r && (r.tileCount++,
  18034. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18035. n.resolve(e, i),
  18036. this.resetWaitDeferred(e)))
  18037. }
  18038. }
  18039. .bind(this)))
  18040. }
  18041. this.tileDownloader.clearForceQueue(),
  18042. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18043. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18044. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18045. }
  18046. return s.promise()
  18047. }
  18048. ),
  18049. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18050. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18051. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18052. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18053. }
  18054. ,
  18055. r.prototype.onTileRendered = function(e, t, i, n) {
  18056. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18057. }
  18058. ,
  18059. r.prototype.onPanoRendered = function(e, t, i, n) {
  18060. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18061. this.updateSkyboxForZoomLevel(),
  18062. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18063. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18064. this.emit("load", t),
  18065. this.model.emit("load", this),
  18066. this.emit(f.LoadComplete, t, i))
  18067. }
  18068. ,
  18069. r.prototype.setZoomed = function(e) {
  18070. this.zoomed = e,
  18071. this.updateSkyboxForZoomLevel()
  18072. }
  18073. ,
  18074. r.prototype.ensureSkyboxReadyForRender = function() {
  18075. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18076. this.solidSkybox.loaded = !0)
  18077. }
  18078. ,
  18079. r.prototype.updateSkyboxForZoomLevel = function() {
  18080. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18081. }
  18082. ,
  18083. r.prototype.getSkyboxTexture = function() {
  18084. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18085. }
  18086. ,
  18087. r.prototype.onTileRenderFail = function(e, t, i) {
  18088. e === this.id && this.emit(f.LoadFailed, t)
  18089. }
  18090. ,
  18091. r.prototype.isLoaded = function(e) {
  18092. if (this.tiled) {
  18093. if (e && "string" == typeof e)
  18094. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18095. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18096. }
  18097. if (e && "number" == typeof e)
  18098. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18099. return !!this.solidSkybox.high || e in this.solidSkybox
  18100. }
  18101. ,
  18102. r.prototype.loadCube = function(a) {
  18103. if (this.isLoaded(a))
  18104. return I.info("Skipping load of pano, already loaded"),
  18105. $.when();
  18106. this.emit("loading", a),
  18107. this.model.emit("loading", this);
  18108. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18109. , e = n.filter(function(e) {
  18110. return !e
  18111. });
  18112. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18113. a = "high",
  18114. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18115. var t = 0
  18116. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18117. return u.getImage(n[t])
  18118. }
  18119. .bind(this));
  18120. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18121. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18122. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18123. this.solidSkybox.low = null),
  18124. this.solidSkybox.needsUpdate = !0,
  18125. this.emit("load", a),
  18126. this.model.emit("load", this),
  18127. this
  18128. }
  18129. .bind(this), function() {
  18130. I.error("Downloading cubemap for pano", this.id, "failed"),
  18131. this.failedLoadingAt = Date.now()
  18132. }
  18133. .bind(this), function() {
  18134. return $.when(++t, 6)
  18135. })
  18136. }
  18137. ,
  18138. r.raycastsSkipped = 0,
  18139. r.raycastsDone = 0,
  18140. r.prototype.findNeighourPanos = function() {
  18141. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18142. this.model.panos.forEach(function(e) {
  18143. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18144. var t = this.position.distanceTo(e.position);
  18145. if (t > a.panoramaNeighbourMaxDistance)
  18146. return this.model.panos.setNeighbour(this, e, !1),
  18147. void r.raycastsSkipped++;
  18148. var i = e.position.clone().sub(this.position).normalize()
  18149. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18150. r.raycastsDone++,
  18151. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18152. 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)))
  18153. }
  18154. }
  18155. .bind(this)),
  18156. this.model.panos.neighbourMap[this.id]
  18157. }
  18158. ,
  18159. r.prototype.worldPosition = function() {
  18160. return this.position
  18161. }
  18162. ,
  18163. /*r.prototype.addTextSprite = function(text, color, parent, scale=1) {
  18164. this.removeTextSprite();
  18165. var ratio = 16;
  18166. var i = document.createElement("canvas")
  18167. , n = i.getContext("2d");
  18168. i.width = 1024,
  18169. i.height = i.width / ratio;
  18170. n.font = " 30px Arial",
  18171. n.fillStyle = "white";
  18172. var r = n.measureText(e).width;
  18173. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18174. var o = new s.Texture(i);
  18175. o.needsUpdate = !0;
  18176. var a = new s.SpriteMaterial({
  18177. map: o,
  18178. color: color || 16428055,
  18179. depthTest:false
  18180. });
  18181. this.text3d = new s.Sprite(a)
  18182. if(parent){
  18183. parent.add(this.text3d)
  18184. }else{
  18185. this.text3d.position.copy(this.skyboxMesh.position)
  18186. this.floor.add(this.text3d)
  18187. }
  18188. this.text3d.scale.y = scale/ratio
  18189. this.text3d.scale.x = scale
  18190. }
  18191. r.prototype.removeTextSprite = function() {
  18192. this.text3d && (this.text3d.parent.remove(this.text3d),
  18193. this.text3d.material.map.dispose(),
  18194. this.text3d = null)
  18195. } */
  18196. r.prototype.addTextSprite = function(text = this.id, color, parent, scale=1) {
  18197. this.removeTextSprite()
  18198. this.label = new TextSprite({
  18199. /* sizeInfo: {
  18200. minSize: 50,
  18201. maxSize: 300,
  18202. nearBound: 0.2,
  18203. farBound: Math.max(20, this.model.size.length() / 3),
  18204. farBoundPlan: 250,
  18205. }, */
  18206. renderOrder: 8,
  18207. backgroundColor:{r: 255, g: 255, b: 255, a: 0 },
  18208. textColor: { r: 255, g: 255, b: 255, a: 1 },
  18209. textshadowColor: '#888',
  18210. text,
  18211. fontsize: 20*scale,
  18212. })
  18213. if(color){
  18214. this.label.children[0].material.color.set(color)
  18215. }
  18216. if(parent){
  18217. parent.add(this.label)
  18218. this.label.position.z = 0.1
  18219. }else{
  18220. let position = this.floorPosition.clone()
  18221. position.y += 0.4
  18222. this.label.position.copy(position)
  18223. this.floor.add(this.label2)
  18224. }
  18225. }
  18226. ,
  18227. r.prototype.removeTextSprite = function() {
  18228. this.label && this.label.dispose()
  18229. }
  18230. ,
  18231. r.prototype.isAligned = function() {
  18232. return this.alignmentType === c.ALIGNED
  18233. }
  18234. ,
  18235. r.filters = {
  18236. inDirection: function(t, i, n) {
  18237. return function(e) {
  18238. return e.position.clone().sub(t).normalize().dot(i) > n
  18239. }
  18240. },
  18241. inFloorDirection: function(t, i, n) {
  18242. return function(e) {
  18243. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18244. }
  18245. },
  18246. inPanoDirection: function(n, r, o) {
  18247. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18248. function(e) {
  18249. var t = e.floorPosition.clone().sub(n).normalize()
  18250. , i = e.position.clone().sub(n).normalize();
  18251. return t.dot(r) > o || i.dot(r) > o
  18252. }
  18253. },
  18254. atFloor: function(t) {
  18255. return function(e) {
  18256. return !t || e.floor === t
  18257. }
  18258. },
  18259. not: function(t) {
  18260. return function(e) {
  18261. return e !== t
  18262. }
  18263. },
  18264. notIn: function(t) {
  18265. return function(e) {
  18266. return -1 === t.indexOf(e)
  18267. }
  18268. },
  18269. isLoaded: function() {
  18270. return function(e) {
  18271. return e.isLoaded()
  18272. }
  18273. },
  18274. isNotLoaded: function() {
  18275. return function(e) {
  18276. return !e.isLoaded()
  18277. }
  18278. },
  18279. isCloseEnoughTo: function(t, i) {
  18280. return function(e) {
  18281. return t.distanceTo(e.floorPosition) < i
  18282. }
  18283. },
  18284. hasMinimumHeightDifferenceTo: function(t, i) {
  18285. return function(e) {
  18286. return Math.abs(e.position.y - t.y) > i
  18287. }
  18288. },
  18289. isNotBehindNormal: function(t, i) {
  18290. var n = new s.Vector3;
  18291. return i = i.clone(),
  18292. function(e) {
  18293. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18294. }
  18295. },
  18296. isNeighbourPanoTo: function(t) {
  18297. return function(e) {
  18298. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18299. }
  18300. },
  18301. isNeighbourOfNeighbourTo: function(n) {
  18302. return function(i) {
  18303. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18304. var t = n.model.panos.get(e);
  18305. return !!t && t.neighbourPanos[i.id]
  18306. })
  18307. }
  18308. },
  18309. isNotRecentlyFailed: function(t) {
  18310. return function(e) {
  18311. return Date.now() - e.failedLoadingAt > t
  18312. }
  18313. },
  18314. isOnVisibleFloor: function() {
  18315. return function(e) {
  18316. return !e.floor.hidden
  18317. }
  18318. },
  18319. isPanoAligned: function() {
  18320. return function(e) {
  18321. return e.isAligned()
  18322. }
  18323. }
  18324. },
  18325. r.sortFunctions = {
  18326. distanceToPoint: function(i) {
  18327. return function(e, t) {
  18328. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18329. }
  18330. },
  18331. floorDistanceToPoint: function(i) {
  18332. return function(e, t) {
  18333. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18334. }
  18335. },
  18336. choose: function(i) {
  18337. return function(e, t) {
  18338. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18339. }
  18340. }
  18341. },
  18342. r.scoreFunctions = {
  18343. distance: function(t, i) {
  18344. return i = i || a.navigation.distanceFactor,
  18345. function(e) {
  18346. return t ? t.position.distanceTo(e.position) * i : 0
  18347. }
  18348. },
  18349. distanceSquared: function(t, i) {
  18350. return i = i || a.navigation.distanceFactor,
  18351. function(e) {
  18352. return t ? t.position.distanceToSquared(e.position) * i : 0
  18353. }
  18354. },
  18355. direction: function(t, i) {
  18356. return function(e) {
  18357. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18358. }
  18359. },
  18360. angle: function(t, i) {
  18361. return function(e) {
  18362. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18363. }
  18364. },
  18365. inFieldOfView: function(t, i) {
  18366. return function(e) {
  18367. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18368. }
  18369. },
  18370. optionality: function(t) {
  18371. return function(e) {
  18372. return e.neighbourUUIDs.filter(function(e) {
  18373. return !(e in t.neighbourUUIDs) && e !== t.id
  18374. }).length * a.navigation.optionalityFactor
  18375. }
  18376. },
  18377. penalizeHeightDifferenceUnder: function(t, i) {
  18378. return function(e) {
  18379. return t.y - e.position.y < i ? -20 : 0
  18380. }
  18381. }
  18382. },
  18383. M.exports = r
  18384. }
  18385. ).call(this, "/js/objects/Panorama.js")
  18386. }
  18387. , {
  18388. "../enum/AlignmentType": 17,
  18389. "../enum/GLCubeFaces": 25,
  18390. "../enum/PanoRendererEvents": 35,
  18391. "../enum/PanoSizeClass": 36,
  18392. "../enum/PanoramaEvents": 37,
  18393. "../enum/RenderLayers": 41,
  18394. "../enum/RenderOrder": 42,
  18395. "../enum/TileDownloaderEvents": 45,
  18396. "../enum/Viewmode": 51,
  18397. "../exception/BasicException": 55,
  18398. "../scene/SceneRenderer": 158,
  18399. "../settings": 166,
  18400. "../tile/TileUtils": 174,
  18401. "../util/ajax": 181,
  18402. "../util/common": 185,
  18403. "../util/lerp": 188,
  18404. "../util/logger": 189,
  18405. "../util/panorama": 191,
  18406. "../util/texture": 194,
  18407. "../util/transitions": 195,
  18408. events: 202,
  18409. three: 217
  18410. }],
  18411. 149: [function(e, t, i) {
  18412. "use strict";
  18413. function n(e) {
  18414. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18415. t.map.value = d,
  18416. t.opacity.value = 0,
  18417. t.color.value.set(o.reticuleColor),
  18418. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18419. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18420. side: r.DoubleSide,
  18421. depthWrite: !1,
  18422. depthTest: !1,
  18423. transparent: !0,
  18424. vertexShader: c.waypoint.vertexShader,
  18425. fragmentShader: c.waypoint.fragmentShader,
  18426. uniforms: t,
  18427. name: "waypoint",
  18428. opacity: 0,
  18429. visible: t.showMouseMarker
  18430. })),
  18431. this.layers.set(h.RETICULE),
  18432. this.renderOrder = u.reticule,
  18433. this.player = e,
  18434. this.direction = new r.Vector3,
  18435. this.hidden = !0,
  18436. this.mouseLastMoveTime = Date.now()
  18437. }
  18438. var r = e("three")
  18439. , o = e("../settings")
  18440. , a = e("../util/transitions")
  18441. , s = e("../util/texture")
  18442. , l = e("../util/lerp")
  18443. , c = e("../shaders")
  18444. , h = e("../enum/RenderLayers")
  18445. , u = e("../enum/RenderOrder")
  18446. , d = s.load("images/reticule.png");
  18447. d.anisotropy = 4; //各向异性
  18448. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18449. this.hidden = i,
  18450. this.mouseLastMoveTime = Date.now()
  18451. }
  18452. ,
  18453. n.prototype.hide = function() {
  18454. this.hidden || (this.hidden = !0,
  18455. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18456. }
  18457. ,
  18458. n.prototype.show = function() {
  18459. this.hidden = !1,
  18460. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18461. }
  18462. ,
  18463. n.prototype.update = function() {
  18464. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18465. }
  18466. ,
  18467. n.prototype.updatePosition = function(e, t) {
  18468. if (!this.hidden) {
  18469. if (!t)
  18470. return this.hide();
  18471. var i = t.point
  18472. , n = e.distanceTo(i)
  18473. , r = 1 + .01 * n;
  18474. n < 1 && (r -= 1 - n),
  18475. this.show(),
  18476. this.scale.set(r, r, r),
  18477. this.direction = this.direction.multiplyScalar(.8),
  18478. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18479. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18480. this.lookAt(this.position.clone().add(this.direction))
  18481. }
  18482. }
  18483. ,
  18484. n.prototype.writeAstag = function() {
  18485. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18486. , t = new Date;
  18487. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18488. var i = {
  18489. enabled: !0,
  18490. version: "0",
  18491. created: t.toISOString(),
  18492. created_by: "APITest",
  18493. position: this.position.clone(),
  18494. stem: {
  18495. enabled: o.tags.pole.enabled,
  18496. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18497. },
  18498. label: "tag " + this.tagCount,
  18499. description: "Description " + e,
  18500. floor: function(e) {
  18501. if (e.currentFloor) {
  18502. var t = e.floors.indexOf(e.currentFloor);
  18503. return -1 < t ? t : void 0
  18504. }
  18505. }(this.player.model),
  18506. type: "info",
  18507. metadata: {
  18508. preferred_camera: {
  18509. mode: this.player.mode
  18510. }
  18511. }
  18512. };
  18513. console.log("--------------------------"),
  18514. console.log(JSON.stringify(i));
  18515. var n = this.player.model.addtag(e, i).build();
  18516. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18517. n.visible || n.show(o.tags.startup.fadeInDuration))
  18518. }
  18519. ,
  18520. t.exports = n
  18521. }
  18522. , {
  18523. "../enum/RenderLayers": 41,
  18524. "../enum/RenderOrder": 42,
  18525. "../settings": 166,
  18526. "../shaders": 167,
  18527. "../util/lerp": 188,
  18528. "../util/texture": 194,
  18529. "../util/transitions": 195,
  18530. three: 217
  18531. }],
  18532. 150: [function(e, t, i) {
  18533. "use strict";
  18534. function n(e, t) {
  18535. this.chunks = [],
  18536. this.floorId = e,
  18537. this.roomId = t,
  18538. this.position = new l.Vector3
  18539. }
  18540. var l = e("three");
  18541. n.prototype.addChunk = function(e) {
  18542. this.chunks.push(e)
  18543. }
  18544. ,
  18545. n.prototype.calcBoundaries = function() {
  18546. 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++) {
  18547. var a = this.chunks[o].geometry.attributes.position;
  18548. if (a)
  18549. for (var s = 0; s < a.array.length; s += 3)
  18550. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18551. t.add(e),
  18552. 0 === s ? (i.copy(e),
  18553. n.copy(e)) : (i.max(e),
  18554. n.min(e)),
  18555. r++
  18556. }
  18557. 0 < r ? (t.multiplyScalar(1 / r),
  18558. this.average = t) : this.average = null,
  18559. this.boundsMax = i,
  18560. this.boundsMin = n,
  18561. this.center = new l.Vector3,
  18562. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18563. }
  18564. ,
  18565. t.exports = n
  18566. }
  18567. , {
  18568. three: 217
  18569. }],
  18570. 151: [function(o, v, e) {
  18571. (function(e) {
  18572. "use strict";
  18573. function t(e, t, i) {
  18574. this.obj3d = null,
  18575. this.nodes = [],
  18576. this.colorHull = [],
  18577. this.shortPaths = {},
  18578. this.floorHull = null,
  18579. this.cameraHull = null,
  18580. this.floorPathDistance = 0,
  18581. this.floorCurvePoints = null,
  18582. this.floorCurveColors = null,
  18583. this.camCurvePoints = null,
  18584. this.warpDestHeroLoc = null,
  18585. this.warpDestPano = null,
  18586. this.warpPathPoints = null,
  18587. this.warpPathLengths = [0],
  18588. this.warpLength = 0,
  18589. this.closeWarpDistance = 4,
  18590. this.UP = U.UP.clone(),
  18591. this.longestStep = 0,
  18592. this.upcomingTransType = null,
  18593. this.burnsDir = 1,
  18594. this.prevNextDist = 0,
  18595. this.nextI = 0,
  18596. this.activeTransType = null,
  18597. this.lastTransType = null,
  18598. this.bunnyObj = null,
  18599. this.director = e,
  18600. this.player = t,
  18601. this.playerControls = i,
  18602. this.modelManager = t.modelManager,
  18603. this.updateModel(),
  18604. this.updateDefaultsFromModelData(),
  18605. this.bindEvents(),
  18606. this.warping = !1,
  18607. this.waitingToWarp = !1,
  18608. this.warpInterrupted = !1,
  18609. this.warpInterruptionBlackoutStyle = null,
  18610. this.warpInterruptionTravelTime = null
  18611. }
  18612. 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"),
  18613. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18614. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18615. 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"),
  18616. pathEnd: n.load("images/End.png"),
  18617. 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==")
  18618. };
  18619. t.prototype.setScene = function(e) {
  18620. this.createCpm(e),
  18621. this.createBunnyObj(e)
  18622. }
  18623. ,
  18624. t.prototype.updateModel = function() {
  18625. this.model = this.modelManager.getActiveModel()
  18626. }
  18627. ,
  18628. t.prototype.bindEvents = function() {
  18629. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18630. }
  18631. ,
  18632. t.prototype.updateDefaultsFromModelData = function() {
  18633. this.model.data
  18634. }
  18635. ,
  18636. t.prototype.pointPathDistance = function(e) {
  18637. for (var t = 0, i = 1; i < e.length; i += 1)
  18638. t += e[i - 1].distanceTo(e[i]);
  18639. return t
  18640. }
  18641. ,
  18642. t.prototype.pointPathLengths = function(e) {
  18643. for (var t = [0], i = 1; i < e.length; i += 1)
  18644. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18645. return t
  18646. }
  18647. ,
  18648. t.prototype.interpAlongPath = function(e, t, i) {
  18649. var n, r = new P.Vector3, o = t[t.length - 1];
  18650. if (i < 1) {
  18651. n = i * o;
  18652. for (var a = 1; a < t.length; a += 1)
  18653. if (t[a] > n) {
  18654. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18655. return r.copy(e[a]),
  18656. r.sub(e[a - 1]),
  18657. r.multiplyScalar(s),
  18658. r.add(e[a - 1]),
  18659. r
  18660. }
  18661. } else
  18662. r.copy(e[e.length - 1]);
  18663. return r
  18664. }
  18665. ,
  18666. t.prototype.pathHeight = function() {
  18667. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18668. }
  18669. ,
  18670. t.prototype.createBunnyObj = function(e) {
  18671. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18672. this.bunnyObj.visible = D.warp.showBunny),
  18673. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18674. e.add(this.bunnyObj)
  18675. }
  18676. ,
  18677. t.prototype.createCpm = function(e) {
  18678. if (!this.currentPanoMarker) {
  18679. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18680. t.material.uniforms.opacity.value = 0,
  18681. this.currentPanoMarker = {
  18682. mesh: t,
  18683. placed: !1
  18684. }
  18685. }
  18686. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18687. this.placeCpm(),
  18688. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18689. }
  18690. ,
  18691. t.prototype.shouldHideCpmAtCurrentPano = function() {
  18692. return this.player && this.player.mode === O.PANORAMA && this.player.currentPano && this.player.currentPano.isAligned()
  18693. }
  18694. ,
  18695. t.prototype.syncCpmVisibility = function() {
  18696. if (!this.currentPanoMarker || !this.currentPanoMarker.mesh)
  18697. return;
  18698. var e = this.shouldHideCpmAtCurrentPano();
  18699. this.currentPanoMarker.mesh.visible = !e,
  18700. e && this.currentPanoMarker.mesh.material && this.currentPanoMarker.mesh.material.uniforms && this.currentPanoMarker.mesh.material.uniforms.opacity && (this.currentPanoMarker.mesh.material.uniforms.opacity.value = 0)
  18701. }
  18702. ,
  18703. t.prototype.placeCpm = function() {
  18704. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18705. var e = this.player.currentPano.floor;
  18706. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18707. e.add(this.currentPanoMarker.mesh)),
  18708. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18709. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18710. this.currentPanoMarker.placed = !0,
  18711. this.syncCpmVisibility()
  18712. } else
  18713. this.popOutCpm()
  18714. }
  18715. ,
  18716. t.prototype.fadeInCpm = function(e) {
  18717. if (this.shouldHideCpmAtCurrentPano())
  18718. return void this.syncCpmVisibility();
  18719. D.path.mapGuides && this.currentPanoMarker.placed && (this.currentPanoMarker.mesh.visible = !0,
  18720. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e))
  18721. }
  18722. ,
  18723. t.prototype.fadeOutCpm = function(e) {
  18724. this.currentPanoMarker && this.currentPanoMarker.mesh && this.currentPanoMarker.mesh.material && this.currentPanoMarker.mesh.material.uniforms && this.currentPanoMarker.mesh.material.uniforms.opacity && (this.currentPanoMarker.mesh.material.uniforms.opacity.value = 0),
  18725. this.syncCpmVisibility()
  18726. }
  18727. ,
  18728. t.prototype.popInCpm = function() {
  18729. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18730. }
  18731. ,
  18732. t.prototype.popOutCpm = function() {
  18733. this.fadeOutCpm(2)
  18734. }
  18735. ,
  18736. t.prototype.brushPrefs = {
  18737. linewidth: 7,
  18738. strokeWidth: 15,
  18739. cvSegments: 48,
  18740. paveStep: .1,
  18741. paveWidth: .2,
  18742. lookBlendDist: 3,
  18743. maxTurn: P.Math.degToRad(2)
  18744. },
  18745. t.prototype.panoPathDistance = function(e) {
  18746. var t = this.model.panos;
  18747. if (!e || e.length < 2)
  18748. return 0;
  18749. for (var i = [], n = 0; n < e.length; n += 1)
  18750. i.push(t.get(e[n]).floorPosition);
  18751. return this.pointPathDistance(i)
  18752. }
  18753. ,
  18754. t.prototype.loadTileTexture = function(t) {
  18755. var e = n.load(t, function(e) {
  18756. e.wrapS = P.RepeatWrapping,
  18757. e.wrapT = P.RepeatWrapping,
  18758. e.needsUpdate = !0,
  18759. H.debug('path texture "' + t + '" is ready')
  18760. }, function() {
  18761. H.error('path texture "' + t + '" failed')
  18762. });
  18763. return e.mapping = P.UVMapping,
  18764. e
  18765. }
  18766. ,
  18767. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18768. return new l({
  18769. cameraMode: n,
  18770. position: e,
  18771. quaternion: t,
  18772. panoId: i,
  18773. orthoZoom: o,
  18774. floorVisibility: r,
  18775. thumbUrl: null,
  18776. name: null
  18777. })
  18778. }
  18779. ,
  18780. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18781. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18782. }
  18783. ,
  18784. t.prototype.setWarpDestination = function(e) {
  18785. this.warpDestHeroLoc = e
  18786. }
  18787. ,
  18788. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18789. var t = this.getHeroDescriptorByHeroIndex(e);
  18790. return null !== t && (this.setWarpDestination(t),
  18791. !0)
  18792. }
  18793. ,
  18794. t.prototype.setWarpDestinationByPano = function(e, t) {
  18795. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18796. }
  18797. ,
  18798. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18799. var i = this.model.panos.get(e);
  18800. if (i) {
  18801. t = t || new P.Quaternion;
  18802. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18803. return this.setWarpDestination(n),
  18804. !0
  18805. }
  18806. return !1
  18807. }
  18808. ,
  18809. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18810. var t = this.model.heroCount();
  18811. if (null !== this.warpDestHeroLoc && t < 1)
  18812. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18813. this.model.getHeroDescriptorByIndex(0);
  18814. var i = this.model.getHeroDescriptorByIndex(e);
  18815. if (i) {
  18816. var n = i.isPano() ? i.panoId : i.cameraMode;
  18817. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18818. }
  18819. return i
  18820. }
  18821. ,
  18822. t.prototype.getHeroDescriptorByPano = function(e) {
  18823. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18824. }
  18825. ,
  18826. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18827. var t = this.getHeroIndexFromPanoId(e);
  18828. return this.getHeroDescriptorByHeroIndex(t)
  18829. }
  18830. ,
  18831. t.prototype.getHeroIndexFromPanoId = function(e) {
  18832. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18833. var i = this.model.heroLocations[t]
  18834. , n = this.getHeroId(i);
  18835. if (n && n === e)
  18836. return t
  18837. }
  18838. return -1
  18839. }
  18840. ,
  18841. t.prototype.getHeroPano = function(e) {
  18842. if (null === e)
  18843. return H.warn("getHeroPano(): no destination"),
  18844. null;
  18845. var t = this.getHeroId(e)
  18846. , i = this.model.panos.get(t);
  18847. return void 0 === i && (i = null,
  18848. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18849. i
  18850. }
  18851. ,
  18852. t.prototype.getHeroId = function(e) {
  18853. return e.panoId
  18854. }
  18855. ,
  18856. t.prototype.setWarpDestPano = function() {
  18857. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18858. this.warpDestPano
  18859. }
  18860. ,
  18861. t.prototype.brushToWarpPano = function(e, t) {
  18862. if (this.discardPathObject(),
  18863. !this.setWarpDestPano())
  18864. return !1;
  18865. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18866. !this.warpDestPano)
  18867. return H.info("No brush"),
  18868. !1;
  18869. if (!this.player.currentPano)
  18870. return H.debug("No current pano, visibility undefined"),
  18871. !1;
  18872. if (!this.warpDestPano)
  18873. return H.info("No wPano, visibility undefined"),
  18874. !1;
  18875. if (!this.warpDestPano.isAligned())
  18876. return H.debug("Cannot brush to unaligned pano"),
  18877. !1;
  18878. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18879. , n = !0;
  18880. if (this.player.currentPano.id === this.warpDestPano.id)
  18881. H.debug("Already at destination pano");
  18882. else {
  18883. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18884. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18885. this.obj3d = new P.Object3D,
  18886. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18887. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18888. e = t) : (this.setPathHulls(this.nodes),
  18889. this.setFloorCurves(),
  18890. 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)))),
  18891. this.player.currentPano.floor.add(this.obj3d);
  18892. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18893. , o = e === L.STD;
  18894. if (!n && (i || o)) {
  18895. if (r) {
  18896. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18897. this.obj3d.add(a)
  18898. }
  18899. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18900. this.obj3d.add(s)
  18901. }
  18902. this.appearSlow()
  18903. }
  18904. return this.upcomingTransType = e,
  18905. !n
  18906. }
  18907. ,
  18908. t.prototype.findShortestPath = function(e, t) {
  18909. if (!e || !t)
  18910. return null;
  18911. var i = D.warp.walkExtraPanosDistance
  18912. , n = e.id + ":" + t.id + ":" + i;
  18913. if (this.shortPaths.hasOwnProperty(n))
  18914. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18915. var r = t.id + ":" + e.id + ":" + i;
  18916. if (this.shortPaths.hasOwnProperty(r))
  18917. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18918. var o = this.model.panos.aStarSearch(e, t);
  18919. return this.model.panos.includeNodesNearPath(o, i),
  18920. this.shortPaths[n] = o ? o.slice() : null,
  18921. o
  18922. }
  18923. ,
  18924. t.prototype.makePathHulls = function(e) {
  18925. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18926. r = (t = h.get(e[0])).floor.floorIndex;
  18927. for (var u = 0; u < e.length; u += 1)
  18928. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18929. s.push(i),
  18930. l.push(t.position.clone()),
  18931. n = t.floor.floorIndex,
  18932. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18933. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18934. return a > this.longestStep && (this.longestStep = a,
  18935. H.debug("path contains " + a + " meter segment")),
  18936. {
  18937. floor: s,
  18938. camera: l,
  18939. color: c
  18940. }
  18941. }
  18942. ,
  18943. t.prototype.makeFloorCurves = function(e, t, i) {
  18944. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18945. , r = this.pointPathDistance(e) - 2 * n
  18946. , o = e.slice(0)
  18947. , a = o[1].clone().sub(o[0]);
  18948. a.y = 0,
  18949. a.normalize().multiplyScalar(n),
  18950. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18951. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18952. a.normalize().multiplyScalar(n),
  18953. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18954. var s = new P.CatmullRomCurve3(o)
  18955. , l = Math.floor(r / i);
  18956. l = 4 * Math.floor(l / 4),
  18957. l = Math.max(4, l);
  18958. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18959. h = 0,
  18960. c = u[f].distanceTo(e[0]);
  18961. for (var g = 1; g < e.length; g += 1)
  18962. p.copy(u[f]).sub(e[g]),
  18963. p.y *= 4,
  18964. p.length() < c && (h = g);
  18965. d.push(t[h])
  18966. }
  18967. return {
  18968. distance: r,
  18969. points: u,
  18970. colors: d
  18971. }
  18972. }
  18973. ,
  18974. t.prototype.makeCameraCurvePoints = function(e, t) {
  18975. var i = this.pointPathDistance(e);
  18976. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18977. }
  18978. ,
  18979. t.prototype.makeCameraCurveTangents = function(e, t) {
  18980. var i = this.pointPathDistance(e)
  18981. , n = new P.CatmullRomCurve3(e)
  18982. , r = Math.max(2, Math.floor(i / t));
  18983. r = r || 5;
  18984. for (var o = [], a = 0; a <= r; a++)
  18985. o.push(n.getTangentAt(a / r));
  18986. return o
  18987. }
  18988. ,
  18989. t.prototype.setPathHulls = function(e) {
  18990. var t = this.makePathHulls(e);
  18991. this.floorHull = t.floor,
  18992. this.cameraHull = t.camera,
  18993. this.colorHull = t.color
  18994. }
  18995. ,
  18996. t.prototype.setFloorCurves = function() {
  18997. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18998. this.floorPathDistance = e.distance,
  18999. this.floorCurvePoints = e.points,
  19000. this.floorCurveColors = e.colors
  19001. }
  19002. ,
  19003. t.prototype.setCameraCurvePoints = function() {
  19004. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19005. }
  19006. ,
  19007. t.prototype.chooseWarpPath = function(e) {
  19008. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  19009. if (this.player.currentPano === this.warpDestPano || !e)
  19010. return this.warpPathPoints = null,
  19011. this.warpLength = 0,
  19012. !1;
  19013. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19014. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  19015. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  19016. t.multiplyScalar(.15).add(r.position),
  19017. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19018. t.y = r.position.y,
  19019. i.y = this.warpDestPano.position.y,
  19020. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  19021. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19022. this.setCameraCurvePoints(),
  19023. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19024. this.warpLength = 0,
  19025. this.warpPathLengths = [0];
  19026. 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) {
  19027. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19028. var h = o.length();
  19029. o.y *= D.warp.climbEffort;
  19030. var u = o.length() / h;
  19031. if (1 < c) {
  19032. o.setY(0).normalize(),
  19033. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19034. var d = Math.min(1, o.dot(a))
  19035. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19036. u = Math.max(p, u)
  19037. }
  19038. this.warpLength += h * u,
  19039. this.warpPathLengths[c] = this.warpLength
  19040. }
  19041. return !0
  19042. }
  19043. ,
  19044. t.prototype.drawPathRibbon = function(e, t) {
  19045. /* let map = Texture.load('images/arrow.png')
  19046. map.anisotropy = 4
  19047. map.repeat.set(1, 6)
  19048. map.wrapS = THREE.RepeatWrapping
  19049. map.wrapT = THREE.RepeatWrapping
  19050. map.needsUpdate = true
  19051. */
  19052. this.bunnyObj.visible = D.warp.showBunny;
  19053. 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) {
  19054. a.copy(e[s]),
  19055. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19056. a.normalize(),
  19057. n.crossVectors(a, U.UP),
  19058. n.multiplyScalar(i);
  19059. var l = (new P.Vector3).copy(e[s]).add(r);
  19060. l.sub(n),
  19061. o.vertices.push(l),
  19062. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19063. o.vertices.push(l)
  19064. }
  19065. var c, h, u, d = 0;
  19066. for (s = 0; s < e.length - 1; s += 1) {
  19067. var p = 2 * s
  19068. , f = d
  19069. , g = d += e[s + 1].distanceTo(e[s])
  19070. , m = t[s]
  19071. , v = t[s + 1];
  19072. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19073. o.faces.push(c),
  19074. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19075. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19076. o.faces.push(c),
  19077. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19078. }
  19079. o.computeFaceNormals(),
  19080. o.computeVertexNormals(),
  19081. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19082. u.opacity.value = 0,
  19083. u.color.value.set(D.path.color),
  19084. new P.RawShaderMaterial({
  19085. side: P.DoubleSide,
  19086. depthWrite: !1,
  19087. transparent: !0,
  19088. vertexShader: C.ribbon.vertexShader,
  19089. fragmentShader: C.ribbon.fragmentShader,
  19090. uniforms: u,
  19091. name: "ribbonT",
  19092. opacity: 0
  19093. })) : new P.MeshBasicMaterial({
  19094. color: 16777215,
  19095. side: P.DoubleSide,
  19096. name: "ribbonOut",
  19097. vertexColors: P.VertexColors,
  19098. /* transparent:true,
  19099. map */
  19100. });
  19101. var y = new P.Mesh(o,h);
  19102. return y.name = "ribbon",
  19103. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19104. y
  19105. }
  19106. ,
  19107. t.prototype.drawPathPavement = function(e) {
  19108. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19109. r.copy(e[o]),
  19110. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19111. r.normalize(),
  19112. i.crossVectors(r, U.UP),
  19113. i.multiplyScalar(this.brushPrefs.paveWidth),
  19114. (t = (new P.Vector3).copy(e[o])).sub(i),
  19115. n.vertices.push(t),
  19116. n.vertices.push((new P.Vector3).copy(e[o])),
  19117. (t = (new P.Vector3).copy(e[o])).add(i),
  19118. n.vertices.push(t);
  19119. var a, s, l;
  19120. for (o = 0; o < e.length - 1; o += 1)
  19121. a = 3 * o + 1,
  19122. l = .25 + (s = .25 * o),
  19123. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19124. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19125. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19126. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19127. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19128. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19129. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19130. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19131. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19132. color: D.path.color,
  19133. side: P.DoubleSide,
  19134. transparent: !0,
  19135. depthWrite: !1,
  19136. opacity: 0,
  19137. name: "paveT",
  19138. map: I.path
  19139. }) : new P.MeshBasicMaterial({
  19140. color: D.path.color,
  19141. side: P.DoubleSide,
  19142. transparent: !0,
  19143. depthWrite: !1,
  19144. opacity: 1,
  19145. name: "paveO",
  19146. map: I.path
  19147. });
  19148. return new P.Mesh(n,c)
  19149. }
  19150. ,
  19151. t.prototype.hintPrefs = {
  19152. rad: .18,
  19153. width: .0125,
  19154. depth: .0625,
  19155. setBack: -.04,
  19156. markRad: .25,
  19157. markInnerRad: .16
  19158. },
  19159. t.prototype.makeWaypointObj = function(e, t) {
  19160. var i = new P.Geometry
  19161. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19162. , r = this.pathHeight();
  19163. 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)),
  19164. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19165. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19166. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19167. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19168. o.map.value = e,
  19169. o.opacity.value = 0,
  19170. o.color.value.set(D.path.color);
  19171. var a = {
  19172. side: P.DoubleSide,
  19173. depthWrite: !1,
  19174. transparent: !0,
  19175. vertexShader: C.waypoint.vertexShader,
  19176. fragmentShader: C.waypoint.fragmentShader,
  19177. uniforms: o,
  19178. name: "waypoint",
  19179. opacity: 0
  19180. };
  19181. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19182. a.name = "wayPtOut");
  19183. var s = new P.RawShaderMaterial(a)
  19184. , l = new P.Mesh(i,s);
  19185. return l.name = t,
  19186. l
  19187. }
  19188. ,
  19189. t.prototype.makeStartMarker = function(e, t) {
  19190. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19191. i.y = 0,
  19192. i.normalize();
  19193. var n = Math.acos(i.x)
  19194. , r = this.makeWaypointObj(I.pathStart, "Start");
  19195. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19196. r.position.copy(e),
  19197. r
  19198. }
  19199. ,
  19200. t.prototype.makeEndMarker = function(e) {
  19201. var t = this.makeWaypointObj(I.pathEnd, "End")
  19202. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19203. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19204. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19205. t.position.copy(e),
  19206. t
  19207. }
  19208. ,
  19209. t.prototype.pathClean = function(e) {
  19210. if (e) {
  19211. for (var t in e.children)
  19212. this.pathClean(e.children[t]);
  19213. e.geometry && e.geometry.dispose(),
  19214. e.material && e.material.dispose()
  19215. }
  19216. }
  19217. ,
  19218. t.prototype.discardPathObject = function() {
  19219. if (this.obj3d) {
  19220. var e = this.obj3d.parent;
  19221. e && e.remove(this.obj3d),
  19222. this.pathClean(this.obj3d)
  19223. }
  19224. this.obj3d = null,
  19225. this.popInCpm()
  19226. }
  19227. ,
  19228. t.prototype.discardSlow = function() {
  19229. if (this.obj3d) {
  19230. if (this.player.mode !== O.PANORAMA)
  19231. return void this.discardPathObject();
  19232. for (var e, t = 0, i = function() {
  19233. this.discardPathObject()
  19234. }
  19235. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19236. 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]),
  19237. t += 1,
  19238. i = null);
  19239. 0 === t && this.discardPathObject(),
  19240. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19241. }
  19242. }
  19243. ,
  19244. t.prototype.appearSlow = function() {
  19245. var e;
  19246. this.fadeOutCpm(D.path.fadeInTime);
  19247. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19248. 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]))
  19249. }
  19250. ,
  19251. t.prototype.update = function() {
  19252. this.obj3d && this.obj3d.updateMatrixWorld()
  19253. }
  19254. ,
  19255. t.prototype.calcBurnsAmount = function(e) {
  19256. var n = P.Math.degToRad(D.warp.burnsAngle);
  19257. if (this.player.mode !== O.PANORAMA)
  19258. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19259. var t = this.burnsDir * n;
  19260. if (this.upcomingTransType === L.BLACK)
  19261. return t;
  19262. var i = e;
  19263. if (null === i)
  19264. return H.warn("Transition request for non-highlight"),
  19265. t;
  19266. var r = this.getHeroDescriptorByHeroIndex(i);
  19267. if (null === r)
  19268. return t;
  19269. if (!r.isPano())
  19270. return t;
  19271. function o(e) {
  19272. var t = Math.acos(Math.min(1, e.dot(l)))
  19273. , i = (new P.Vector3).crossVectors(l, e);
  19274. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19275. }
  19276. var a = this.getHeroPano(r)
  19277. , s = this.playerControls.cameras[O.PANORAMA]
  19278. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19279. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19280. if (a === this.player.currentPano)
  19281. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19282. var h = this.findShortestPath(this.player.currentPano, a);
  19283. if (null == h || h.length < 1)
  19284. return H.debug("Empty path ahead..."),
  19285. t;
  19286. var u = this.makePathHulls(h)
  19287. , d = new P.CatmullRomCurve3(u.camera)
  19288. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19289. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19290. }
  19291. ,
  19292. t.prototype.waitNextStep = function(e, t, i) {
  19293. var o = null == i ? D.warp.tourStepDelay : i;
  19294. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19295. var a = new P.Euler
  19296. , s = new P.Vector3;
  19297. H.debug("Starting wait: " + (void 0 !== t));
  19298. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  19299. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19300. , c = function() {
  19301. this.endWarpState(),
  19302. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19303. t && t()
  19304. }
  19305. .bind(this)
  19306. , n = function(e, t) {
  19307. if (this.warpInterrupted)
  19308. return c(),
  19309. !0;
  19310. var i = t || 1e3 / 60;
  19311. if (D.warp.doBurns && !currentLocation.dontRot )
  19312. if (this.player.mode === O.PANORAMA) {
  19313. var n = this.playerControls.cameras[O.PANORAMA];
  19314. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19315. var r = o == 0 ? l : i * l / o;
  19316. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19317. a.y += r,
  19318. s.set(0, 0, -1),
  19319. s.applyEuler(a),
  19320. s.add(n.position),
  19321. n.controls.lookAt(s),
  19322. n.controls.lookVector.copy(s),
  19323. n.lookAt(s)
  19324. } else
  19325. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19326. }
  19327. .bind(this);
  19328. this.startWarpState(),
  19329. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19330. }
  19331. ,
  19332. t.prototype.warpToNonPano = function(e) {
  19333. if (this.discardPathObject(),
  19334. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19335. var t = function() {
  19336. e && e()
  19337. }
  19338. .bind(this);
  19339. this.player.flyToNewMode({
  19340. mode: this.warpDestHeroLoc.cameraMode,
  19341. duration: D.warp.outsideTime,
  19342. warpDest: this.warpDestHeroLoc,
  19343. callback: t,
  19344. force: !0
  19345. })
  19346. } else
  19347. H.warn("no warp destination!!!"),
  19348. e && e()
  19349. }
  19350. ,
  19351. t.prototype._resetWarpShaderParams = function(e) {
  19352. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19353. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19354. }
  19355. ,
  19356. t.prototype._clearWarpShading = function() {
  19357. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19358. this._resetWarpShaderParams(e[t]),
  19359. e[t].visible = !0;
  19360. this._resetWarpShaderParams(this.model.skybox)
  19361. }
  19362. ,
  19363. t.prototype._warpStopFlying = function() {
  19364. this.activeTransType = null,
  19365. this.placeCpm()
  19366. }
  19367. ,
  19368. t.prototype._wrapupTravelOnlyBits = function() {
  19369. this._warpStopFlying(),
  19370. this.warpPathPoints && (this.player.currentPano.exit(),
  19371. this.warpDestPano.enter(),
  19372. this.player.currentPano = this.warpDestPano),
  19373. this.player.spider.draw(),
  19374. this.placeCpm()
  19375. }
  19376. ,
  19377. t.prototype._wrapupTravel = function(e) {
  19378. this._wrapupTravelOnlyBits(),
  19379. this.warpCameraAim(e)
  19380. }
  19381. ,
  19382. t.prototype._wrapupWarpShading = function(e) {
  19383. this._clearWarpShading(),
  19384. this._wrapupTravel(e)
  19385. }
  19386. ,
  19387. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19388. t !== z.END && this._clearWarpShading(),
  19389. this._wrapupTravelOnlyBits(),
  19390. this.upcomingTransType = null,
  19391. e && e()
  19392. }
  19393. ,
  19394. t.prototype._warpCameraAim = function(e, t) {
  19395. var i = this.warpDestHeroLoc.quaternion
  19396. , n = this.playerControls.cameras[O.PANORAMA]
  19397. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19398. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19399. , a = P.Math.radToDeg(Math.acos(o))
  19400. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19401. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19402. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19403. c.y = N.constrainedTurn(c.y),
  19404. this.burnsDir = Math.sign(c.y);
  19405. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19406. , u = new P.Vector3
  19407. , d = function(e, t) {
  19408. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19409. h.y = l.y + e * c.y,
  19410. h.z = l.z + e * c.z,
  19411. u.set(0, 0, -1),
  19412. u.applyEuler(h),
  19413. u.add(n.position),
  19414. n.controls.lookAt(u),
  19415. n.controls.lookVector.copy(u),
  19416. void n.lookAt(u))
  19417. }
  19418. .bind(this);
  19419. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19420. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19421. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19422. )
  19423. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19424. void (t && t())) */
  19425. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19426. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19427. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19428. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19429. void (t && t()))
  19430. }
  19431. ,
  19432. t.prototype._warpBendAim = function(e, t, i, n) {
  19433. var r = n || 0
  19434. , o = this.playerControls.cameras[O.PANORAMA]
  19435. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19436. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19437. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19438. l.y = N.constrainedTurn(l.y);
  19439. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19440. l.x = c * Math.sign(l.x),
  19441. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19442. this.burnsDir = Math.sign(l.y),
  19443. c *= Math.sign(l.y),
  19444. l.y = c;
  19445. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19446. , u = new P.Vector3
  19447. , d = function(e, t) {
  19448. if (e < .5)
  19449. h.x = s.x + e * l.x,
  19450. h.y = s.y + e * l.y,
  19451. h.z = s.z + e * l.z;
  19452. else {
  19453. var i = (1 - e) * D.warp.softBendEnd;
  19454. h.x = a.x - i * l.x,
  19455. h.y = a.y - i * l.y,
  19456. h.z = a.z - i * l.z
  19457. }
  19458. u.set(0, 0, -1),
  19459. u.applyEuler(h),
  19460. u.add(o.position),
  19461. o.controls.lookAt(u),
  19462. o.controls.lookVector.copy(u),
  19463. o.lookAt(u)
  19464. }
  19465. .bind(this);
  19466. if(window.DATA.momentTourBlackNewType){
  19467. d(1)
  19468. }else return V.start(d, t, i, r, B[D.warp.movementEasing])
  19469. }
  19470. ,
  19471. t.prototype._warpStepCameraAim = function(e, t, i) {
  19472. var n = this.playerControls.cameras[O.PANORAMA]
  19473. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19474. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19475. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19476. a.y = N.constrainedTurn(a.y),
  19477. this.burnsDir = Math.sign(a.y);
  19478. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19479. , l = new P.Vector3
  19480. , c = function(e, t) {
  19481. e < .5 ? s.copy(o) : s.copy(r),
  19482. l.set(0, 0, -1),
  19483. l.applyEuler(s),
  19484. l.add(n.position),
  19485. n.controls.lookAt(l),
  19486. n.controls.lookVector.copy(l),
  19487. n.lookAt(l)
  19488. }
  19489. .bind(this);
  19490. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19491. }
  19492. ,
  19493. t.prototype.setBurnsDir = function() {
  19494. var e = this.playerControls.cameras[O.PANORAMA]
  19495. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19496. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19497. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19498. n.y = N.constrainedTurn(n.y),
  19499. this.burnsDir = Math.sign(n.y)
  19500. }
  19501. ,
  19502. t.prototype.stepWarpPath = function(firstPos, e ) {
  19503. var i = this.playerControls.cameras[O.PANORAMA];
  19504. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19505. if (!n){
  19506. return i.position.copy(this.warpDestPano.position),
  19507. !0;
  19508. }
  19509. /* if (!this.warpPathPoints)
  19510. return i.position.copy(this.warpDestPano.position),
  19511. !0;
  19512. var n = this.warpPathPoints[0] */
  19513. var r = this.warpDestPano.position;
  19514. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19515. var o = new P.Vector3;
  19516. 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),
  19517. i.position.copy(o)
  19518. } else
  19519. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19520. }
  19521. ,
  19522. t.prototype.interruptAndFastForward = function(e, t) {
  19523. this.warping && (this.warpInterrupted = !0,
  19524. this.warpInterruptionBlackoutStyle = e,
  19525. this.warpInterruptionTravelTime = t,
  19526. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19527. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19528. }
  19529. ,
  19530. t.prototype.warpCameraAim = function(e) {
  19531. var t = D.warp.minWarpTime;
  19532. if (this.upcomingTransType === L.BLACK)
  19533. t = D.warp.teleportTime;
  19534. else {
  19535. var i = this.playerControls.cameras[O.PANORAMA]
  19536. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19537. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19538. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19539. o.y = N.constrainedTurn(o.y);
  19540. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19541. t = Math.max(t, a)
  19542. }
  19543. var s = function() {
  19544. this._warpStopFlying(),
  19545. this.discardSlow(),
  19546. e && e()
  19547. }
  19548. .bind(this);
  19549. this._warpCameraAim(t, s)
  19550. }
  19551. ,
  19552. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19553. this.model.skybox.material.uniforms.blackout.value = n;
  19554. var r = F.uniform(this.model.skybox, "progress", 1)
  19555. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19556. , a = !1
  19557. , s = function() {
  19558. if (this.warpInterrupted)
  19559. return a = !0
  19560. }
  19561. .bind(this)
  19562. , l = function(e, t) {
  19563. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19564. }
  19565. .bind(this)
  19566. , c = function(e, t) {
  19567. return i && a ? (o(0),
  19568. !0) : void o(e, t)
  19569. }
  19570. .bind(this);
  19571. V.start(s, e, null, t, null, "safeHaltWatch"),
  19572. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19573. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19574. }
  19575. ,
  19576. t.prototype.warpTravel_STD = function(e) {
  19577. 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),
  19578. 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;
  19579. t += this.warpLength * D.warp.timePerMeter,
  19580. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19581. function n(e) {
  19582. var t = i;
  19583. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19584. }
  19585. var y = !1
  19586. , r = this.warpDestHeroLoc.quaternion
  19587. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19588. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19589. , a = A.dot(o)
  19590. , C = P.Math.radToDeg(Math.acos(a))
  19591. , s = function() {
  19592. return m.lookAt(g, l, U.UP),
  19593. u.setFromRotationMatrix(m, D.warp.eOrder),
  19594. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19595. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19596. N.constrainedTurn(v.y)
  19597. }
  19598. .bind(this)
  19599. , I = function(e, t) {
  19600. if (this.warpInterrupted)
  19601. return y = !0
  19602. }
  19603. .bind(this)
  19604. , E = function(e, t) {
  19605. return y || !this.warpPathPoints ? (k.blur(0),
  19606. !0) : void k.blur(e)
  19607. }
  19608. .bind(this)
  19609. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19610. , b = function(e, t) {
  19611. return y || !this.warpPathPoints ? (_(0),
  19612. !0) : void _(e, t)
  19613. }
  19614. .bind(this)
  19615. , w = function(e, t) {
  19616. if (!this.warpPathPoints)
  19617. return h.position.copy(this.warpDestPano.position),
  19618. !0;
  19619. if (y)
  19620. return !0;
  19621. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19622. h.position.copy(i),
  19623. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19624. }
  19625. .bind(this)
  19626. , T = function(e, t) {
  19627. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19628. !0)
  19629. }
  19630. .bind(this)
  19631. , x = function(e, t) {
  19632. if (y)
  19633. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19634. !0;
  19635. if (!this.warpPathPoints)
  19636. return !0;
  19637. var i = this.warpLength * e
  19638. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19639. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19640. D.warp.matchCam && (n *= 1 - r),
  19641. m.lookAt(g, l, U.UP),
  19642. u.setFromRotationMatrix(m, D.warp.eOrder),
  19643. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19644. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19645. v.y = N.constrainedTurn(v.y),
  19646. u.x = p.x + n * v.x,
  19647. u.y = p.y + n * v.y,
  19648. u.z = p.z + n * v.z,
  19649. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19650. v.y = N.constrainedTurn(v.y);
  19651. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19652. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19653. f.x = f.x + v.x * D.warp.turnFriction,
  19654. f.y = f.y + v.y * D.warp.turnFriction,
  19655. f.z = f.z + v.z * D.warp.turnFriction,
  19656. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19657. var a = l.clone().sub(g).normalize();
  19658. if (C < D.warp.maxAimRotation && 0 < r) {
  19659. var s = 1 - r;
  19660. a.x = a.x * s + r * A.x,
  19661. a.y = a.y * s + r * A.y,
  19662. a.z = a.z * s + r * A.z,
  19663. a.normalize()
  19664. }
  19665. this.bunnyObj.position.copy(h.position).add(a),
  19666. d.set(0, 0, -1).applyEuler(f).normalize(),
  19667. d.multiplyScalar(8),
  19668. d.add(h.position),
  19669. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19670. h.controls.lookVector.copy(d),
  19671. h.lookAt(d))
  19672. }
  19673. .bind(this)
  19674. , S = function() {
  19675. y ? (this.discardSlow(),
  19676. this.upcomingTransType = L.BLACK,
  19677. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19678. }
  19679. .bind(this);
  19680. T(0);
  19681. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19682. , R = M / (t += M);
  19683. this.warpCommonParameters(t, R, !0, z.NONE),
  19684. V.start(I, t, null, 0, null, "_haltWatcher"),
  19685. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19686. V.start(E, t, null, R, n, "blurring")),
  19687. V.start(b, t, null, R, n, "modelAlpha"),
  19688. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19689. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19690. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19691. }
  19692. ,
  19693. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19694. var r = e || 0;
  19695. null !=
  19696. t || (t = D.warp.teleportTime)
  19697. //add
  19698. player.model.hotGroup.visible = false
  19699. let oldPano = this.player.currentPano
  19700. let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
  19701. this.player.emit("pano.chosen", oldPano, toPano)
  19702. var done = ()=>{
  19703. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
  19704. player.model.hotGroup.visible = true
  19705. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19706. }})
  19707. this.player.emit("flying.ended",toPano.position, oldPano.position,toPano, oldPano)
  19708. }
  19709. if(window.DATA.momentTourBlackNewType){
  19710. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  19711. var camera = this.playerControls.cameras['panorama'];
  19712. var end = this.warpDestHeroLoc.position
  19713. camera.position.copy(end)
  19714. setTimeout(()=>{
  19715. player.sceneRenderer.effects.fastTranMaskPass.stop()
  19716. this.wrapupWarpShadingOnly(n, i);
  19717. done()
  19718. },t)
  19719. }else{
  19720. var o = function() {
  19721. this.wrapupWarpShadingOnly(n, i);
  19722. done()
  19723. }
  19724. .bind(this);
  19725. var firstPos = this.player.position.clone()//add
  19726. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19727. }
  19728. this.warpCommonParameters(t, r, !1, i)
  19729. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  19730. if(window.DATA.momentTourBlackNewType){
  19731. e.material.uniforms.blackout.value = 5//i 改
  19732. //e.material.defines.newBlack = ''
  19733. //e.material.needsUpdate = true
  19734. }else{
  19735. e.material.uniforms.blackout.value = i
  19736. }
  19737. }),
  19738. this._warpBendAim(null, t, null, r);
  19739. /* this.warpCommonParameters(t, r, !1, i)
  19740. this.model.chunks.forEach(function(e) {
  19741. e.material.uniforms.blackout.value = i
  19742. }),
  19743. this._warpBendAim(null, t, null, r);
  19744. //add
  19745. var done = ()=>{
  19746. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19747. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19748. }
  19749. var o = function() {
  19750. this.wrapupWarpShadingOnly(n, i)
  19751. done()
  19752. }
  19753. .bind(this);
  19754. var firstPos = this.player.position.clone()//add
  19755. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19756. */
  19757. }
  19758. ,
  19759. t.prototype.flightStepWalk = (a = new P.Vector3,
  19760. s = new P.Vector3,
  19761. function(e, t, i) {
  19762. if (this.warpInterrupted)
  19763. i && i();
  19764. else if (this.activeTransType !== L.WALK)
  19765. this._clearWarpShading(),
  19766. this._warpStopFlying(),
  19767. this.player.spider.draw(),
  19768. this.placeCpm(),
  19769. i && i();
  19770. else if (this.player.currentPano !== e) {
  19771. var n = {
  19772. pano: e,
  19773. lookAtPoint: t,
  19774. duration: null,
  19775. maxDistanceOverride: D.warp.walkMaxDist,
  19776. skipWarpingCheck: !1,
  19777. constantMoveSpeed: !0
  19778. };
  19779. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19780. n.zoomLevel = this.warpDestHeroLoc.zoom
  19781. }
  19782. n.duration = function(e, t) {
  19783. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19784. s.copy(U.FORWARD),
  19785. this.player.getDirection(s),
  19786. a.copy(t).sub(e.position).normalize();
  19787. var n = a.dot(s)
  19788. , r = Math.acos(n)
  19789. , o = r / i;
  19790. .001 < o && (i *= o / .001, //-----这是什么????
  19791. r < 1 && (i *= 1.2))
  19792. return i / DATA.tourWalkSpeed * 100
  19793. }
  19794. .call(this, e, t),
  19795. this.player.nonInterruptingFlyToPano(n, i)
  19796. } else
  19797. i && i()
  19798. }
  19799. ),
  19800. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19801. return this.flightStepWalk.bind(this, e, t, i)
  19802. }
  19803. ,
  19804. t.prototype.warpTravel_WALK = (f = [],
  19805. function(e) {
  19806. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19807. var o = this.nodes[r]
  19808. , a = t.get(o);
  19809. this.nodes.length,
  19810. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19811. i && n || (f.push(o),
  19812. i = a)
  19813. }
  19814. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19815. var s = f.length
  19816. , l = t.get(f[s - 1])
  19817. , c = new Array(s + 1);
  19818. c[c.length - 1] = function() {
  19819. e && e()
  19820. }
  19821. .bind(this);
  19822. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19823. var d = f[h];
  19824. l = t.get(d);
  19825. var p = new P.Vector3;
  19826. this.getLookAtForWalkingTourNode(f, h, p),
  19827. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19828. h--
  19829. }
  19830. c[0]()
  19831. }
  19832. ),
  19833. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19834. h = new P.Vector3,
  19835. u = new P.Vector3,
  19836. d = new P.Vector3,
  19837. p = new P.Vector3,
  19838. function(e, t, i) {
  19839. var n = e.length;
  19840. if (n <= t)
  19841. return !1;
  19842. var r = 1
  19843. , o = 1;
  19844. h.set(0, 0, 0),
  19845. p.set(0, 0, 0);
  19846. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19847. if (a = this.player.model.panos.get(e[s]),
  19848. this.getOrientationForWalkingTourNode(e, s, u),
  19849. s === t && c.copy(u),
  19850. d.copy(u),
  19851. t < s) {
  19852. var l = d.dot(c) < .65;
  19853. r *= l ? .2 : .75,
  19854. o *= l ? .2 : .4
  19855. }
  19856. u.multiplyScalar(r),
  19857. h.add(u),
  19858. p.lerp(a.position, o)
  19859. }
  19860. return h.normalize(),
  19861. i.copy(p),
  19862. i.add(h),
  19863. !0
  19864. }
  19865. ),
  19866. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19867. var n = e.length;
  19868. if (n <= t)
  19869. return !1;
  19870. if (t === n - 1)
  19871. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19872. else {
  19873. var r = this.player.model.panos.get(e[t])
  19874. , o = this.player.model.panos.get(e[t + 1]);
  19875. i.copy(o.position).sub(r.position)
  19876. }
  19877. return i.normalize(),
  19878. !0
  19879. }
  19880. ,
  19881. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19882. if (this.activeTransType = this.upcomingTransType,
  19883. this.lastTransType = this.activeTransType,
  19884. this.upcomingTransType = null,
  19885. e)
  19886. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19887. this._clearWarpShading(),
  19888. this._warpStopFlying(),
  19889. this.player.spider.draw(),
  19890. this.placeCpm(),
  19891. n && n()
  19892. }
  19893. .bind(this)) : this.warpTravel_STD(n);
  19894. else {
  19895. var r = function() {
  19896. this._wrapupTravel(n)
  19897. }
  19898. .bind(this)
  19899. , o = {
  19900. pano: this.warpDestPano,
  19901. lookAtPoint: null,
  19902. duration: null,
  19903. maxDistanceOverride: null,
  19904. skipWarpingCheck: !1
  19905. };
  19906. this.player.flyToPano(o, r)
  19907. }
  19908. }
  19909. ,
  19910. t.prototype.startWarpState = function() {
  19911. this.warping = !0,
  19912. this.warpInterrupted = !1,
  19913. this.warpInterruptionBlackoutStyle = null,
  19914. this.warpInterruptionTravelTime = null
  19915. }
  19916. ,
  19917. t.prototype.endWarpState = function() {
  19918. this.warping = !1
  19919. }
  19920. ,
  19921. t.prototype.warpToPano = function(e, t, i, n) {
  19922. if (this.warping)
  19923. H.warn("Cannot warp when already warping");
  19924. else {
  19925. if (this.upcomingTransType = e,
  19926. this.activeTransType = null,
  19927. !this.setWarpDestPano())
  19928. return this.upcomingTransType = null,
  19929. void this.warpToNonPano(n);
  19930. if (this.player.mode !== O.PANORAMA)
  19931. return this.upcomingTransType = null,
  19932. this.discardSlow(),
  19933. void this.player.flyToNewMode({
  19934. mode: O.PANORAMA,
  19935. pano: this.warpDestPano,
  19936. duration: D.warp.outsideTime,
  19937. warpDest: this.warpDestHeroLoc,
  19938. callback: n,
  19939. force: !0
  19940. });
  19941. if (!this.warpDestPano)
  19942. return H.warn("no warp destination, callback dropped"),
  19943. void (this.upcomingTransType = null);
  19944. 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)
  19945. , o = this.chooseWarpPath(r);
  19946. if (o && this.upcomingTransType !== L.WALK) {
  19947. var a = function() {
  19948. this.waitingToWarp = !1,
  19949. this.warpToPano(e, t, i, n)
  19950. }
  19951. .bind(this);
  19952. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19953. return void (this.waitingToWarp = !0)
  19954. }
  19955. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19956. this.player.currentPano = this.warpDestPano,
  19957. this.placeCpm(),
  19958. this.fadeOutCpm(D.path.fadeOutTime),
  19959. this.player.spider.draw()),
  19960. H.debug("Warping to pano ", this.warpDestPano.position),
  19961. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19962. this.startWarpState();
  19963. var s = function() {
  19964. this.endWarpState(),
  19965. n && n()
  19966. }
  19967. .bind(this);
  19968. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19969. }
  19970. }
  19971. ,
  19972. v.exports = t
  19973. }
  19974. ).call(this, "/js/objects/ShowPath.js")
  19975. }
  19976. , {
  19977. "../constants": 8,
  19978. "../effects": 16,
  19979. "../enum/BlackoutStyle": 18,
  19980. "../enum/ModelManagerEvents": 33,
  19981. "../enum/PlayerEvents": 40,
  19982. "../enum/RenderOrder": 42,
  19983. "../enum/Vectors": 50,
  19984. "../enum/Viewmode": 51,
  19985. "../enum/WarpStyle": 52,
  19986. "../gui/gui": 65,
  19987. "../model/ModelManager": 140,
  19988. "../objects/Snapshot": 153,
  19989. "../settings": 166,
  19990. "../shaders": 167,
  19991. "../util/easing": 186,
  19992. "../util/lerp": 188,
  19993. "../util/logger": 189,
  19994. "../util/math": 190,
  19995. "../util/texture": 194,
  19996. "../util/transitions": 195,
  19997. three: 217
  19998. }],
  19999. 152: [function(e, t, i) {
  20000. "use strict";
  20001. function n() {
  20002. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20003. , t = new r.RawShaderMaterial({
  20004. fragmentShader: o.skysphere.fragmentShader,
  20005. vertexShader: o.skysphere.vertexShader,
  20006. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20007. side: r.BackSide,
  20008. name: "skysphere"
  20009. });
  20010. t.uniforms.radius.value = e.parameters.radius,
  20011. r.Mesh.call(this, e, t)
  20012. }
  20013. var r = e("three")
  20014. , o = e("../shaders")
  20015. , a = e("../settings");
  20016. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  20017. t.exports = n
  20018. }
  20019. , {
  20020. "../settings": 166,
  20021. "../shaders": 167,
  20022. three: 217
  20023. }],
  20024. 153: [function(r, o, e) {
  20025. (function(e) {
  20026. "use strict";
  20027. function t(e) {
  20028. n.call(this, e),
  20029. this.sid = e.sid,
  20030. this.panoId = e.panoId,
  20031. this.orthoZoom = e.orthoZoom,
  20032. this.floorVisibility = e.floorVisibility,
  20033. this.thumbUrl = e.thumbUrl,
  20034. this.name = e.name,
  20035. this.zoom = e.zoom
  20036. }
  20037. var i = (r("three"),
  20038. r("../util/logger"))
  20039. , n = (r("../settings"),
  20040. r("../enum/Viewmode"),
  20041. r("../util/common"),
  20042. r("../util/transitions"),
  20043. r("../util/lerp"),
  20044. r("../util/ajax"),
  20045. r("../util/texture"),
  20046. r("./View"));
  20047. r("events").EventEmitter,
  20048. new i(e),
  20049. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20050. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20051. }
  20052. ,
  20053. o.exports = t
  20054. }
  20055. ).call(this, "/js/objects/Snapshot.js")
  20056. }
  20057. , {
  20058. "../enum/Viewmode": 51,
  20059. "../settings": 166,
  20060. "../util/ajax": 181,
  20061. "../util/common": 185,
  20062. "../util/lerp": 188,
  20063. "../util/logger": 189,
  20064. "../util/texture": 194,
  20065. "../util/transitions": 195,
  20066. "./View": 154,
  20067. events: 202,
  20068. three: 217
  20069. }],
  20070. 154: [function(o, a, e) {
  20071. (function(e) {
  20072. "use strict";
  20073. function t(e) {
  20074. e = e || {},
  20075. this.position = new i.Vector3,
  20076. this.quaternion = new i.Quaternion,
  20077. this.update(e)
  20078. }
  20079. var i = o("three")
  20080. , n = o("../util/logger")
  20081. , r = (o("../settings"),
  20082. o("../enum/Viewmode"),
  20083. o("../util/common"),
  20084. o("../util/transitions"),
  20085. o("../util/lerp"),
  20086. o("../util/ajax"),
  20087. o("../util/texture"),
  20088. o("events").EventEmitter);
  20089. new n(e),
  20090. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20091. return !!this.cameraMode
  20092. }
  20093. ,
  20094. t.prototype.update = function(e) {
  20095. return this.cameraMode = e.cameraMode || this.cameraMode,
  20096. this.pano = e.pano || this.pano,
  20097. e.position && this.position.copy(e.position),
  20098. e.quaternion && this.quaternion.copy(e.quaternion),
  20099. this
  20100. }
  20101. ,
  20102. a.exports = t
  20103. }
  20104. ).call(this, "/js/objects/View.js")
  20105. }
  20106. , {
  20107. "../enum/Viewmode": 51,
  20108. "../settings": 166,
  20109. "../util/ajax": 181,
  20110. "../util/common": 185,
  20111. "../util/lerp": 188,
  20112. "../util/logger": 189,
  20113. "../util/texture": 194,
  20114. "../util/transitions": 195,
  20115. events: 202,
  20116. three: 217
  20117. }],
  20118. 155: [function(J, ee, e) {
  20119. (function(e) {
  20120. "use strict";
  20121. function t(e) {
  20122. this.currentPano = null,
  20123. this.nextPano = null,
  20124. this.camera = null,
  20125. this.paused = !1,
  20126. this.flying = !1,
  20127. this.sceneIntersectionPlane = null,
  20128. this.target = new B.Vector3,
  20129. this.mouse = new B.Vector3(1.1,1.1,.5),
  20130. this.mouseAtMouseDown = new B.Vector2,
  20131. this.mouseCouldBeClickToMove = !1,
  20132. this.mouseLastMoveTime = Date.now(),
  20133. this.mouseDown = !1,
  20134. this.mouseDownTimer = null,
  20135. this.couldBeLongTap = !1,
  20136. this.containsMouse = !0,
  20137. this.isTouchEvent = !1,
  20138. this.isPanoHover = !1,
  20139. this.reticule = new n(this),
  20140. this.panoMarkers = [],
  20141. this.spider = new s(this),
  20142. this.quaternion = new B.Quaternion,
  20143. this.position = new B.Vector3(15,10,15),
  20144. this.previousState = null,
  20145. this.lastInsideView = new o,
  20146. this.last360View = new o,
  20147. this.raycaster = new B.Raycaster,
  20148. this.intersect = null,
  20149. this.lastChangeTime = Date.now(),
  20150. this.history = new h,
  20151. this.cameraControls = null,
  20152. this.path = null,
  20153. this.model = null,
  20154. this.domElement = null,
  20155. this.cachedPanoCandidates = null,
  20156. this.basePanoSize = 0,
  20157. this.standardPanoSize = 0,
  20158. this.highPanoSize = 0,
  20159. this.ultraHighPanoSize = 0,
  20160. this.zoomLevel = 1,
  20161. this.zooming = 0,
  20162. this.zoomSpeed = .5,
  20163. this.scrollZoomSpeed = .06,
  20164. this.zoomSpeedAdjust = .05,
  20165. this.defaultZoomIncrement = .2,
  20166. this.baseFov = k.insideFOV,
  20167. this.zoomFov = this.baseFov,
  20168. this.zoomEnabled = !0,
  20169. this.preRenderingEnabled = !1,
  20170. this.setupCustomProperties(e),
  20171. this.zoomStats = new v,
  20172. this.modeTran = ''//'dollhouse-panorama'
  20173. this.currentCursor = '';
  20174. window.player = this
  20175. }
  20176. var B = J("three")
  20177. , i = J("./util/logger")
  20178. , n = J("./objects/Reticule")
  20179. , a = J("./objects/Panorama")
  20180. , r = J("./objects/ShowPath")
  20181. , o = J("./objects/View")
  20182. , s = (J("./objects/Snapshot"),
  20183. J("./objects/NSpider"))
  20184. , V = J("./enum/Viewmode")
  20185. , T = (J("./enum/TagStates"),
  20186. J("./enum/Vectors"))
  20187. , l = J("./enum/Keys")
  20188. , k = (J("./enum/AlignmentType"),
  20189. J("./settings"))
  20190. , x = J("./util/common")
  20191. , U = (J("./util/browser"),
  20192. J("./util/math"))
  20193. , H = J("./util/lerp")
  20194. , z = J("./util/easing")
  20195. , G = J("./util/transitions")
  20196. , c = J("events").EventEmitter
  20197. , h = (J("./shaders"),
  20198. J("./util/history"))
  20199. , S = (J("./util/camera"),
  20200. J("./model/ModelManager"),
  20201. J("./enum/PathDiscardMode"))
  20202. , M = J("./enum/PathDisplayMode")
  20203. , W = J("./enum/PlayerEvents")
  20204. , u = J("./enum/ControlEvents")
  20205. , d = J("./enum/ModelManagerEvents")
  20206. , R = J("./enum/WarpStyle")
  20207. , P = J("./enum/BlackoutStyle")
  20208. , p = J("./exception/BasicException")
  20209. , f = J("./enum/PanoSizeClass")
  20210. , g = (J("./tile/TileDownloader"),
  20211. J("./tile/TilePrioritizer"))
  20212. , m = (J("./enum/PanoramaEvents"),
  20213. J("./enum/ZoomEvents"))
  20214. , v = J("./util/ZoomStats")
  20215. , y = J("./constants")
  20216. , j = J("./util/common")
  20217. , A = J("./util/cameraLight")
  20218. //, C = J("hot")
  20219. , Y = new i(e)
  20220. , q = Object.freeze({
  20221. FlyToPano: G.getUniqueId(),
  20222. FlyToNewMode: G.getUniqueId(),
  20223. FlyToSameMode: G.getUniqueId(),
  20224. FlyToViewFloor: G.getUniqueId(),
  20225. LookTransition: G.getUniqueId(),
  20226. ZoomTransition: G.getUniqueId()
  20227. });
  20228. function I(e) {
  20229. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20230. o[r] = n.charCodeAt(r);
  20231. return new Blob([o],{
  20232. type: i
  20233. })
  20234. }
  20235. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20236. this.modelManager = e.modelManager,
  20237. this.tileDownloader = e.tileDownloader,
  20238. this.panoRenderer = e.panoRenderer,
  20239. this.qualityManager = e.qualityManager,
  20240. this.domElement = e.container,
  20241. this.camera = e.camera,
  20242. this.tagManager = e.tagManager,
  20243. this.cameraControls = e.controls,
  20244. this.path = new r(e.director,this,e.controls),
  20245. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20246. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20247. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20248. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20249. this.tileDownloader.processPriorityQueue = !1,
  20250. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20251. this.bindEvents(e.container),
  20252. this.updateModel()
  20253. //add
  20254. this.raycaster.linePrecision = 0.1
  20255. }
  20256. ,
  20257. t.prototype.screenShot = function(i) {
  20258. if (!this.flying && !this.flyingToTag) {
  20259. var n = this.sceneRenderer;
  20260. n.updateScreenSize(i)
  20261. this.model.panos.forEach(e=>{
  20262. if(e.marker){
  20263. e.marker.forceHide = e.marker.visible
  20264. e.marker.visible = !1;
  20265. }
  20266. })
  20267. /* for (var e in this.model.hots)
  20268. this.model.hots[e].mesh.visible = !1; */
  20269. player.model.hotGroup.visible = false
  20270. this.reticule.visible = !1,
  20271. this.reticule.forceUnvisible = !0,
  20272. this.path.currentPanoMarker.mesh.visible = !1,
  20273. setTimeout(function() {
  20274. n.renderer.clear(!0, !0, !0),
  20275. n.renderer.render(n.scene, n.camera);
  20276. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20277. i.f && i.f(e)
  20278. n.updateScreenSize({
  20279. resize: !0
  20280. })
  20281. this.reticule.visible = !0
  20282. player.model.hotGroup.visible = true
  20283. this.model.panos.forEach(e=>{
  20284. e.marker && (e.marker.visible = e.marker.forceHide);
  20285. })
  20286. this.path.currentPanoMarker.mesh.visible = !0,
  20287. n.renderer.render(n.scene, n.camera)
  20288. }
  20289. .bind(this), 30)
  20290. }
  20291. }
  20292. ;
  20293. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20294. t.prototype.getWrapShot = function() {
  20295. var i = this.getSnapAngleInfo()
  20296. , n = ",{\r\t" + i
  20297. , r = arguments[0];
  20298. this.screenShot({
  20299. width: g_snapShotWidth,
  20300. height: g_snapShotHeight,
  20301. type: "image/jpeg",
  20302. f: function(e) {
  20303. if (r && r.__callback)
  20304. return r.__callback(e, i);
  20305. var t = new Image;
  20306. t.src = e,
  20307. t.onload = function() {
  20308. var e = function(r, i) {
  20309. function n(e, t) {
  20310. var i = o || r
  20311. , n = document.createElement("canvas");
  20312. n.width = i.width,
  20313. n.height = i.height,
  20314. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20315. o = Q(e, n, t)
  20316. }
  20317. function e() {
  20318. var e = o || r
  20319. , t = I(e.src);
  20320. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20321. t = I(e.src)),
  20322. (o = o || new Image).base64Src = e.src,
  20323. o.src = window.URL.createObjectURL(t)
  20324. }
  20325. var o, t = Math.max(r.width, r.height);
  20326. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20327. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20328. e())),
  20329. o || r
  20330. }(this, {
  20331. maxSize: g_snapShotWidth,
  20332. oldType: "jpeg"
  20333. });
  20334. e.src.replace(function(e) {
  20335. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20336. }("image/jpeg"), "image/octet-stream");
  20337. var t = "snap" + (new Date).getTime();
  20338. !function(e, t) {
  20339. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20340. i.href = e,
  20341. i.download = t;
  20342. var n = document.createEvent("MouseEvents");
  20343. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20344. i.dispatchEvent(n)
  20345. }(e.src, t + ".jpg"),
  20346. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20347. n += '\r\t"sid":"' + t + '",',
  20348. n += '\r\t"name":"' + t + '"\r}',
  20349. logData(n)
  20350. }
  20351. }
  20352. })
  20353. }
  20354. /* ,
  20355. t.prototype.getSnapAngleInfo = function() {
  20356. var e = {}
  20357. , t = '"metadata":{'
  20358. , i = this.camera.quaternion.clone();
  20359. switch (this.mode) {
  20360. case "panorama":
  20361. e.scan_id = this.currentPano.id,
  20362. t += '"scan_id":"' + this.currentPano.id + '",';
  20363. break;
  20364. case "floorplan":
  20365. e.camera_mode = 1,
  20366. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20367. t += '"camera_mode":1,',
  20368. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20369. break;
  20370. case "dollhouse":
  20371. e.camera_mode = 2,
  20372. t += '"camera_mode":2,'
  20373. }
  20374. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20375. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20376. n.x *= -1,
  20377. n.w *= -1,
  20378. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20379. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20380. e.zoom = this.zoomLevel,
  20381. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20382. }
  20383. , */
  20384. t.prototype.getSnapAngleInfo = function(){
  20385. var info = {};
  20386. var str = '"metadata":{';
  20387. var q = this.camera.quaternion.clone();
  20388. switch (this.mode) {
  20389. case "panorama":
  20390. info.scan_id = this.currentPano.id;
  20391. str += ('"scan_id":"'+this.currentPano.id+'",');
  20392. break;
  20393. case "floorplan":
  20394. info.camera_mode = 1;
  20395. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20396. q.multiply(this.camera.quaternion);
  20397. str += ('"camera_mode":1,');
  20398. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20399. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20400. break;
  20401. case "dollhouse":
  20402. info.camera_mode = 2;
  20403. str += ('"camera_mode":2,');
  20404. break;
  20405. }
  20406. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20407. //console.log(info.camera_position)
  20408. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20409. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20410. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20411. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20412. out.x *= -1;
  20413. out.w *= -1;
  20414. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20415. }else{
  20416. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20417. } */
  20418. info.zoom = this.zoomLevel;
  20419. //console.log(info.camera_quaternion)
  20420. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20421. // fyz 扩展编辑页面, 加上导览点缩放值
  20422. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20423. console.log(str)
  20424. return str;
  20425. }
  20426. //------end
  20427. ,
  20428. t.prototype.setupCustomProperties = function(e) {
  20429. var i = e || V.PANORAMA;
  20430. Object.defineProperty(this, "mode", {
  20431. get: function() {
  20432. return i
  20433. },
  20434. set: function(e) {
  20435. var t = i;
  20436. i = e,
  20437. this.onModeUpdated(t, i)
  20438. }
  20439. })
  20440. }
  20441. ,
  20442. t.prototype.isInMode = function() {
  20443. for (var e = 0; e < arguments.length; e++)
  20444. if (this.mode === arguments[e])
  20445. return !0;
  20446. return !1
  20447. }
  20448. ,
  20449. t.prototype.isOutsideMode = function(e) {
  20450. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20451. }
  20452. ,
  20453. t.prototype.is360View = function(e, t) {
  20454. return e === V.PANORAMA && t && !t.isAligned()
  20455. }
  20456. ,
  20457. t.prototype.setScene = function(e) {
  20458. this.sceneIntersectionPlane = e.plane,
  20459. this.path.setScene(e),
  20460. this.moveReticuleToScene(e)
  20461. }
  20462. ,
  20463. t.prototype.moveReticuleToScene = function(e) {
  20464. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20465. e.add(this.reticule)
  20466. }
  20467. ,
  20468. t.prototype.updateModel = function() {
  20469. function n(e) {
  20470. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20471. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20472. , n = t.position.y + (e - i.target.y)
  20473. , r = k.showFloorDuration + k.showFloorDelay;
  20474. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20475. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20476. }
  20477. this.model = this.modelManager.getActiveModel(),
  20478. this.model.on("floor.changed", function(e, t, i) {
  20479. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20480. }
  20481. .bind(this)),
  20482. this.model.on("allfloors.toggled", function(e, t) {
  20483. if (this.mode === V.DOLLHOUSE) {
  20484. var i = e ? this.model.center.y : i = t.center.y;
  20485. n.call(this, i)
  20486. }
  20487. }
  20488. .bind(this)),
  20489. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20490. var t = this;
  20491. this.model.panos.list.forEach(function(e) {
  20492. e.vrMarker.addEventListener("click", function() {
  20493. t.flyToPano({
  20494. pano: e
  20495. })
  20496. })
  20497. })
  20498. }
  20499. ,
  20500. t.prototype.updateModelDependentData = function() {
  20501. this.cameraControls.setModelForControls(this.model),
  20502. this.getPanoMarkersFromModel(this.model)
  20503. }
  20504. ,
  20505. t.prototype.onModelChanged = function() {
  20506. this.updateModel(),
  20507. this.updateModelDependentData()
  20508. }
  20509. ,
  20510. t.prototype.getPanoMarkersFromModel = function(e) {
  20511. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20512. return t.marker ? e.concat(t.marker) : e
  20513. }, [])
  20514. }
  20515. ,
  20516. t.prototype.handleControlMove = function(e) {
  20517. this.emit(W.Move, e)
  20518. }
  20519. ,
  20520. t.prototype.handleControlInputStart = function(e) {
  20521. this.emit(W.InputStart, e)
  20522. }
  20523. ,
  20524. t.prototype.onModeUpdated = function(e, t) {
  20525. this.cameraControls.activateControls(t),
  20526. this.emit(W.ModeChanged, e, t)
  20527. }
  20528. ,
  20529. t.prototype.isWarping = function() {
  20530. return this.path.warping
  20531. }
  20532. ,
  20533. t.prototype.isWaitingToWarp = function() {
  20534. return this.path.waitingToWarp
  20535. }
  20536. ,
  20537. t.prototype.getLabelScaleFactor = function() {
  20538. if (this.isOutsideMode()) {
  20539. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20540. }
  20541. return .5
  20542. }
  20543. ,
  20544. t.prototype.bindEvents = function(e) {
  20545. e !== document && e.setAttribute("tabindex", -1),
  20546. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20547. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20548. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20549. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20550. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20551. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20552. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20553. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20554. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20555. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20556. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20557. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20558. document.addEventListener("pointerup", ()=>{//add
  20559. window.transformControls && transformControls.onPointerUp()
  20560. }),
  20561. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20562. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20563. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20564. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20565. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20566. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20567. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20568. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20569. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20570. window.getSeft && getSeft(this)
  20571. }
  20572. ,
  20573. t.prototype.onMouseDown = function(e) {
  20574. e.currentTarget !== document && e.currentTarget.focus(),
  20575. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20576. this.updateIntersect())
  20577. }
  20578. ,
  20579. t.prototype.onMouseMove = function(e) {
  20580. this.isTouchEvent = !1,
  20581. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20582. }
  20583. ,
  20584. t.prototype.onMouseOver = function(e) {
  20585. this.containsMouse = !0,
  20586. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20587. }
  20588. ,
  20589. t.prototype.onMouseOut = function(e) {
  20590. this.containsMouse = !1
  20591. }
  20592. ,
  20593. t.prototype.onMouseUp = function(e) {
  20594. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20595. }
  20596. ,
  20597. t.prototype.onTouchStart = function(e) {
  20598. if (e.currentTarget !== document && e.currentTarget.focus(),
  20599. !this.mouseDown) {
  20600. this.couldBeLongTap = !0;
  20601. var t = x.average(e.changedTouches, "clientX")
  20602. , i = x.average(e.changedTouches, "clientY");
  20603. this.handleInputStart.call(this, t, i, !0),
  20604. this.mouseDownTimer = setTimeout(function() {
  20605. this.updateIntersect(),
  20606. this.handleInputEnd.call(this, t, i, !0)
  20607. }
  20608. .bind(this), k.input.longTapThreshold)
  20609. }
  20610. }
  20611. ,
  20612. t.prototype.onTouchMove = function(e) {
  20613. var t = x.average(e.changedTouches, "clientX")
  20614. , i = x.average(e.changedTouches, "clientY");
  20615. this.handleInputMove.call(this, t, i, !0)
  20616. }
  20617. ,
  20618. t.prototype.onTouchEnd = function(e) {
  20619. if (clearTimeout(this.mouseDownTimer),
  20620. this.mouseDown) {
  20621. this.couldBeLongTap = !1,
  20622. this.updateIntersect();
  20623. var t = x.average(e.changedTouches, "clientX")
  20624. , i = x.average(e.changedTouches, "clientY");
  20625. this.handleInputEnd.call(this, t, i, !0)
  20626. }
  20627. }
  20628. ,
  20629. t.prototype.onPointerDown = function(e) {
  20630. return e.currentTarget !== document && e.currentTarget.focus(),
  20631. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20632. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20633. void (this.mouseDownTimer = setTimeout(function() {
  20634. this.updateIntersect(),
  20635. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20636. }
  20637. .bind(this), k.input.longTapThreshold)))
  20638. }
  20639. ,
  20640. t.prototype.onPointerMove = function(e) {
  20641. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20642. }
  20643. ,
  20644. t.prototype.onPointerUp = function(e) {
  20645. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20646. this.couldBeLongTap = !1,
  20647. this.updateIntersect(),
  20648. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20649. }
  20650. ,
  20651. t.prototype.onPointerOut = function(e) {
  20652. this.mouseDown = !1
  20653. }
  20654. ,
  20655. t.prototype.onPointerCancel = function(e) {
  20656. this.mouseDown = !1
  20657. }
  20658. ,
  20659. t.prototype.onKeyDown = function(e) {
  20660. var t = function() {
  20661. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20662. }
  20663. .bind(this)
  20664. , i = e.which;
  20665. switch (i) {
  20666. case l.F:
  20667. t(),
  20668. this.changeFloor(-1);
  20669. break;
  20670. case l.R:
  20671. t(),
  20672. this.changeFloor(1)
  20673. }
  20674. if (this.mode === V.PANORAMA)
  20675. switch (i) {
  20676. case l.UPARROW:
  20677. case l.W:
  20678. this.flyLocalDirection(T.FORWARD.clone());
  20679. break;
  20680. case l.DOWNARROW:
  20681. case l.S:
  20682. this.flyLocalDirection(T.BACK.clone());
  20683. break;
  20684. case l.A:
  20685. this.flyLocalDirection(T.LEFT.clone());
  20686. break;
  20687. case l.D:
  20688. this.flyLocalDirection(T.RIGHT.clone())
  20689. }
  20690. }
  20691. ,
  20692. t.prototype.handleScrollPinchZoom = function(e) {
  20693. var t = e
  20694. , i = this.zoomLevel;
  20695. this.zoomBy(t),
  20696. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20697. }
  20698. ,
  20699. t.prototype.handleControlPinch = function(e) {
  20700. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20701. }
  20702. ,
  20703. t.prototype.handleControlScroll = function(e) {
  20704. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20705. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20706. }
  20707. ,
  20708. t.prototype.handleInputStart = function(e, t, i) {
  20709. var n = this.handelPadding(e, t);
  20710. e = n.x,
  20711. t = n.y,
  20712. this.isTouchEvent = i,
  20713. U.convertScreenPositionToNDC(e, t, this.mouse),
  20714. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20715. this.mouseCouldBeClickToMove = !0,
  20716. this.mouseDown = !0
  20717. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20718. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20719. window.transformControls && transformControls.onPointerDown()
  20720. }
  20721. ,
  20722. t.prototype.handelPadding = function(e, t) {
  20723. return this.pad || (this.pad = {
  20724. x: dom.getOffset("left", $("#player")[0]),
  20725. y: dom.getOffset("top", $("#player")[0])
  20726. }),
  20727. {
  20728. x: e - this.pad.x,
  20729. y: t - this.pad.y
  20730. }
  20731. }
  20732. ,
  20733. t.prototype.handleInputMove = function(e, t, i) {
  20734. var n = this.handelPadding(e, t);
  20735. e = n.x,
  20736. t = n.y,
  20737. this.isTouchEvent = i,
  20738. U.convertScreenPositionToNDC(e, t, this.mouse);
  20739. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20740. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20741. this.couldBeLongTap = !1,
  20742. clearTimeout(this.mouseDownTimer)),
  20743. this.mouseLastMoveTime = Date.now(),
  20744. this.reticule.move(e, t, i)
  20745. window.transformControls && transformControls.onPointerMove()
  20746. }
  20747. ,
  20748. t.prototype.handleInputEnd = function(e, t, i) {
  20749. if (this.isTouchEvent = i,
  20750. this.mouseDown = !1,
  20751. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20752. !i && this.couldBeLongTap)
  20753. return !0;
  20754. if (this.handleLongTap())
  20755. return !0;
  20756. window.transformControls && transformControls.onPointerUp()
  20757. if (this.mouseCouldBeClickToMove) {
  20758. if (this.flying)
  20759. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20760. !0;
  20761. //add----
  20762. if (this.checkHotClick())
  20763. return !0;
  20764. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20765. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20766. return;
  20767. }
  20768. if (window.VisiSet && VisiSet.setTagVisible ) {
  20769. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(this.intersect.object.name);
  20770. return;
  20771. }
  20772. if (window.VisiSet && VisiSet.setPanoLog ) {
  20773. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  20774. return;
  20775. }
  20776. if (window.VisiSet && VisiSet.setGroundAdjust ) {
  20777. this.intersect && this.intersect.object.visible && VisiSet.dealGroundAdjustClick(this.intersect.object);
  20778. return;
  20779. }
  20780. if (window.VisiSet && VisiSet.setRoute) {
  20781. this.intersect && this.intersect.object.visible && VisiSet.dealRouteClick(this.intersect.object);
  20782. return;
  20783. }
  20784. if (window.VisiSet && VisiSet.setPanoArea ) {
  20785. this.intersect && this.intersect.object.visible && VisiSet.dealPanoAreaClick( this.intersect.object);
  20786. return;
  20787. }
  20788. if(this.hoveringPlane){
  20789. this.clickOverlay(this.hoveringPlane)
  20790. return;
  20791. }
  20792. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20793. return EditOverlay.addPlane({intersect:this.intersect});
  20794. }
  20795. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20796. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20797. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20798. } */
  20799. //----------
  20800. if(this.intersect){// for cad add door etc.
  20801. let result = {}
  20802. this.emit('getIntersect', this.intersect, (state)=>{//consume
  20803. result.consume = true
  20804. })
  20805. if(result.consume)return; //有效使用了,就return
  20806. }
  20807. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20808. this.history.invalidate(),
  20809. this.intersect)
  20810. return this.flyToPanoClosestToMouse();
  20811. if (this.mode === V.PANORAMA) {
  20812. var n = this.closestPanoInDirection(this.getMouseDirection());
  20813. return n ? this.flyToPano({
  20814. pano: n
  20815. }) : this.bump(this.getMouseDirection())
  20816. }
  20817. }
  20818. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20819. }
  20820. ,
  20821. t.prototype.handleLongTap = function() {
  20822. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20823. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20824. !0
  20825. }
  20826. ,
  20827. t.prototype.checktagClick = function() {
  20828. if (this.tagManager.intersectTag) {
  20829. var e = this.isTouchEvent
  20830. , t = this.tagManager.clickedOnTag(e, this);
  20831. return e || t || G.cancelById(q.LookTransition),
  20832. !0
  20833. }
  20834. if (this.tagManager.activeTag)
  20835. return this.tagManager.dismissActiveTag(),
  20836. !1
  20837. }
  20838. ,
  20839. t.prototype.rankedtagInDirection = function(e, t) {
  20840. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20841. }
  20842. ,
  20843. t.prototype.start = function(e) {
  20844. $(".toolLeft").removeClass("unable");
  20845. $(".toolTop").removeClass("unable");
  20846. //-------------------
  20847. window.initTransformCtl(B)
  20848. //this.model.loadOverlays()
  20849. //window.EditOverlay && window.EditOverlay.init(B);
  20850. window.VisiSet && VisiSet.init()
  20851. //-------------------
  20852. var t = e.mode
  20853. , i = e.pano
  20854. , n = e.position
  20855. , r = e.quaternion
  20856. , o = e.tag
  20857. , a = e.quickstart
  20858. , s = $.Deferred();
  20859. this.updateModelDependentData(),
  20860. this.updateFromControls(),
  20861. this.findDefaultViews();
  20862. var l = this.is360View(t, i);
  20863. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20864. s.done(function(e) {
  20865. this.emit(W.Ready, l, e, o)
  20866. }
  20867. .bind(this)),
  20868. s.promise()
  20869. }
  20870. ,
  20871. t.prototype.startOutside = function(e, t) {
  20872. var i = e.mode
  20873. , n = e.pano
  20874. , r = e.position
  20875. , o = e.quaternion
  20876. , a = e.zoom
  20877. , s = e.floorVisibility
  20878. , l = e.tag;
  20879. this.emit(W.StartOutside, k[i].transitionTime),
  20880. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20881. G.cancelById(q.FlyToViewFloor),
  20882. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20883. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20884. }
  20885. ,
  20886. t.prototype.startInside = function(e, t, i, n, r) {
  20887. r = r || $.Deferred();
  20888. var o = (this.currentPano = e) && !e.isAligned();
  20889. window.bus.dispatchEvent({type:'playerAndModelReady'})
  20890. this.ready = true
  20891. if (t = o ? e.position : t || e.position,
  20892. i = i || e.quaternion,
  20893. e) {
  20894. var a = this.startInside.bind(this, e, t, i, n, r);
  20895. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20896. return
  20897. }
  20898. //add
  20899. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20900. //this.updateHotVisible()
  20901. //EditOverlay.updatePano()
  20902. editTool.hotpoint.updatePano()
  20903. Hot.updateVisibles([this.currentPano])
  20904. return this.mode = V.PANORAMA,
  20905. e.floor.enter(this.mode),
  20906. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20907. this.switchCameraMode(this.mode, i),
  20908. this.emit(W.StartInside, o),
  20909. r.resolve(!0),
  20910. r
  20911. }
  20912. ,
  20913. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20914. if (r = r || $.Deferred(),
  20915. this.dollhouseMode(),
  20916. !i)
  20917. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20918. r.resolve(!1),
  20919. r;
  20920. e = e || i.position;
  20921. var o = n || this.cameraControls.activeControl.camera.quaternion
  20922. , a = i.position;
  20923. return this.fitDollhouse(a, e, o),
  20924. setTimeout(function(e) {
  20925. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20926. var t = {
  20927. mode: V.PANORAMA,
  20928. pano: i,
  20929. quaternion: n,
  20930. callback: function() {
  20931. this.emit(W.FlyinFinished),
  20932. r.resolve(!0)
  20933. }
  20934. .bind(this)
  20935. };
  20936. this.flyToNewMode(t)
  20937. }
  20938. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20939. r
  20940. }
  20941. ,
  20942. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20943. K = {},
  20944. function(t, e, i, n, r, o, a, s, l, c) {
  20945. if (function() {
  20946. for (var e in Z)
  20947. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20948. return !0;
  20949. return !1
  20950. }())
  20951. return !0;
  20952. var h = function(e, t, i) {
  20953. j.delayOneFrame(function() {
  20954. Z[e] = !1,
  20955. r && r(t, i)
  20956. }
  20957. .bind(this))
  20958. }
  20959. .bind(this, t.id)
  20960. , u = function(e, t) {
  20961. j.delayOneFrame(function() {
  20962. Z[e] = !1,
  20963. o && o(t)
  20964. }
  20965. .bind(this))
  20966. }
  20967. .bind(this, t.id);
  20968. try {
  20969. return null != s || (s = !0),
  20970. 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),
  20971. Z[t.id] && (K[t.id] = performance.now()),
  20972. Z[t.id]
  20973. } catch (e) {
  20974. throw Z[t.id] = !1,
  20975. K[t.id] = performance.now() - 5e3,
  20976. e
  20977. }
  20978. }
  20979. ),
  20980. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20981. if (!e)
  20982. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20983. return r && this.model.waitForLoad(e, function() {
  20984. return e.isLoaded(i)
  20985. }),
  20986. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20987. !0)
  20988. }
  20989. ,
  20990. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20991. function(e, t, i, n, r, o, a, s) {
  20992. if (!e)
  20993. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20994. return X.copy(T.FORWARD),
  20995. this.getDirection(X),
  20996. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20997. return e.isLoaded(t)
  20998. }),
  20999. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  21000. i && i(e, t)
  21001. }
  21002. .bind(this)).fail(function(e) {
  21003. n && n(e)
  21004. }
  21005. .bind(this)).progress(function(e, t, i) {
  21006. r && r(e, t, i)
  21007. }
  21008. .bind(this)),
  21009. !0)
  21010. }
  21011. ),
  21012. t.prototype.switchCameraMode = function(mode, quaternion, target, position, {currentScale, fitBoundSize}={}) {
  21013. var control = this.cameraControls.controls[mode]
  21014. , camera = control.camera;
  21015. if(mode == V.PANORAMA){
  21016. camera.position.copy(this.currentPano.position);
  21017. var r = quaternion ? T.FORWARD.clone().applyQuaternion(quaternion) : this.getDirection().setY(0).normalize();
  21018. control.lookAt(r.add(camera.position));
  21019. }else{
  21020. if (target) {
  21021. control.target.copy(target)
  21022. }
  21023. if (position) {
  21024. camera.position.copy(position)
  21025. }
  21026. if(mode == V.DOLLHOUSE){
  21027. var pos = this.position.clone();
  21028. if(this.mode === V.PANORAMA){
  21029. let vec = new B.Vector3(0,6,0).add(this.getDirection().multiplyScalar(-10))
  21030. if(target)vec.multiplyScalar(0.15) //编辑热点时飞出不要飞太远,只是飞出来就近观察一下热点
  21031. pos.add(vec)
  21032. }else{
  21033. pos.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6)
  21034. }
  21035. camera.position.copy(pos)
  21036. if(!target) target = this.target.clone().setY(this.model.center.y)
  21037. control.target.copy(target);
  21038. //for多楼层 且 让模型刚好适应屏幕
  21039. /* var box = this.model.boundingBox.clone();
  21040. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21041. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21042. var fov = A.getHFOVFromVFOV(k.insideFOV, camera.aspect, 1); //获得在当前窗口的横向的fov
  21043. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21044. console.log(boxSize.x,distance, boxSize.length() / 2)
  21045. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21046. if(this.mode === V.PANORAMA){
  21047. control.target.copy(this.model.center);
  21048. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21049. }else{
  21050. control.target.copy(this.target.clone().setY(this.model.center.y))
  21051. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21052. }
  21053. vec.multiplyScalar(distance )
  21054. camera.position.copy(control.target.clone().add(vec)) */
  21055. }if(mode == V.FLOORPLAN){
  21056. if(!target){
  21057. control.target.copy(this.model.center).setY(0)
  21058. }
  21059. if(!position){
  21060. camera.position.copy(control.target).setY(k.floorplan.cameraHeight),
  21061. control.rotateToView(this.model.size, this.getDirection())
  21062. }
  21063. if(currentScale){
  21064. control.currentScale = control.absoluteScale = currentScale
  21065. }else if (fitBoundSize) {
  21066. control.zoomToContain(fitBoundSize)
  21067. }else{
  21068. control.zoomToContain(this.model.size)
  21069. }
  21070. }
  21071. }
  21072. control.update(0)
  21073. }
  21074. ,
  21075. t.prototype.update = (new B.Vector3,
  21076. N = {},
  21077. F = [],
  21078. function(e) {
  21079. this.updatePersistentZooming(e),
  21080. this.updateFromControls(e),
  21081. this.getCurrentNodePanos(F)
  21082. if(this.hasChanged(N)){
  21083. this.lastChangeTime = Date.now(),
  21084. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21085. this.emit(W.ViewChanged, N)
  21086. //add:
  21087. if(N.cameraChanged){
  21088. Hot.updateHots()
  21089. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21090. }
  21091. }
  21092. this.model.supportsTiles && (this.updateTileDownloader(F),
  21093. this.updatePanoRenderer(F)),
  21094. this.updatePreRendering(F),
  21095. this.reticule.update(),
  21096. this.path.update(),
  21097. this.spider.update(),
  21098. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21099. this.updateControlLocks(),
  21100. this.model.supportsTiles && this.updateZoomPano()
  21101. }
  21102. ),
  21103. t.prototype.updatePersistentZooming = function(e) {
  21104. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21105. }
  21106. ,
  21107. t.prototype.updateControlLocks = function() {
  21108. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21109. }
  21110. ,
  21111. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21112. function(e) {
  21113. var t = this.nextPano || this.currentPano;
  21114. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21115. this.getDirection(D),
  21116. this.panoRenderer.updateDirection(D))
  21117. }
  21118. ),
  21119. t.prototype.cleanupInactivePanos = (O = [],
  21120. L = [],
  21121. function() {
  21122. O.length = 0,
  21123. O.push(this.currentPano),
  21124. this.nextPano && O.push(this.nextPano);
  21125. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21126. L.push(this.panoRenderer.activePanos[e]);
  21127. for (var t = 0; t < L.length; t++) {
  21128. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21129. i.id === O[r].id && (n = !1);
  21130. n && i.exit()
  21131. }
  21132. }
  21133. ),
  21134. t.prototype.updatePreRendering = (w = {},
  21135. function(e) {
  21136. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21137. var t = this.nextPano || this.currentPano;
  21138. if (t && e && 1 < e.length) {
  21139. var i = e.findIndex(function(e) {
  21140. if (e.id === t.id)
  21141. return !0
  21142. });
  21143. if (0 <= i && i + 1 < e.length) {
  21144. var n = e[i + 1];
  21145. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21146. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21147. window.setTimeout(function(e) {
  21148. w[e.id] = !1
  21149. }
  21150. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21151. }
  21152. .bind(this, n), k.tiling.panoPreRenderDelay),
  21153. w[n.id] = !0)
  21154. }
  21155. }
  21156. }
  21157. }
  21158. ),
  21159. t.prototype.enablePreRendering = function() {
  21160. this.preRenderingEnabled = !0
  21161. }
  21162. ,
  21163. t.prototype.disablePreRendering = function() {
  21164. this.preRenderingEnabled = !1,
  21165. this.cleanupInactivePanos()
  21166. }
  21167. ,
  21168. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21169. function(e) {
  21170. var t = this.nextPano || this.currentPano;
  21171. t && (b.copy(T.FORWARD),
  21172. this.getDirection(b),
  21173. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21174. this.tileDownloader.processPriorityQueue = !0)
  21175. }
  21176. ),
  21177. t.prototype.updateFromControls = function(e) {
  21178. null != e || (e = 0),
  21179. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21180. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21181. this.position.copy(this.cameraControls.activeControl.camera.position),
  21182. this.target.copy(this.cameraControls.activeControl.target),
  21183. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21184. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21185. this.camera.position.copy(this.position),
  21186. this.camera.quaternion.copy(this.quaternion),
  21187. this.camera.updateMatrix(),
  21188. this.camera.updateMatrixWorld()
  21189. }
  21190. ,
  21191. t.prototype.hasChanged = function(e) {
  21192. if (!this.previousState){
  21193. e.cameraChanged = true
  21194. return this.previousState = {
  21195. allFloorsVisible: this.model.allFloorsVisible,
  21196. position: this.position.clone(),
  21197. quaternion: this.quaternion.clone(),
  21198. mouse: this.mouse.clone(),
  21199. labelScaleFactor: this.getLabelScaleFactor(),
  21200. currentFloor: this.model.currentFloor,
  21201. projectionMatrix: this.camera.projectionMatrix.clone(),
  21202. worldMatrix: this.camera.matrixWorld.clone(),
  21203. mode: this.mode,
  21204. modelPosition: this.model.position.clone(),
  21205. modelCenter: this.model.center.clone(),
  21206. zoomLevel: this.zoomLevel
  21207. },
  21208. !0;
  21209. }
  21210. //许钟文改 分成相机是否改变cameraChanged 和其他
  21211. var a = this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion)&& this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.mode === this.previousState.mode && this.zoomLevel === this.previousState.zoomLevel && this.model.center.equals(this.previousState.modelCenter) && this.model.position.equals(this.previousState.modelPosition)
  21212. var t = a && this.mouse.equals(this.previousState.mouse) && this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ && this.model.currentFloor === this.previousState.currentFloor && null === this.nextPano ;
  21213. e.cameraChanged = !a;
  21214. //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;
  21215. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21216. e.moved = !this.position.equals(this.previousState.position),
  21217. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21218. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21219. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21220. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21221. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21222. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21223. e.modeChanged = this.mode !== this.previousState.mode,
  21224. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21225. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21226. e.nextPanoActive = null !== this.nextPano,
  21227. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21228. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21229. this.previousState.position.copy(this.position),
  21230. this.previousState.quaternion.copy(this.quaternion),
  21231. this.previousState.mouse.copy(this.mouse),
  21232. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21233. this.previousState.currentFloor = this.model.currentFloor,
  21234. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21235. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21236. this.previousState.mode = this.mode,
  21237. this.previousState.modelPosition.copy(this.model.position),
  21238. this.previousState.modelCenter.copy(this.model.center),
  21239. this.previousState.zoomLevel = this.zoomLevel,
  21240. !t
  21241. }
  21242. ,
  21243. t.prototype.updateIntersect = function() {
  21244. var e = this.flying || this.isWarping()
  21245. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21246. , i = G.getById(q.LookTransition);
  21247. e || t || this.isTouchEvent || i.length && i[0].running;
  21248. {//clear:
  21249. //if(this.intersectHot) this.intersectHot.hideTitle()
  21250. if(this.intersectHot) this.intersectHot.setHoverState(false)
  21251. this.intersectHot = null
  21252. //$("#player").css("cursor", "")
  21253. CursorDeal.remove('hoverFootIcon' )
  21254. CursorDeal.remove('hoverRouteLine' )
  21255. CursorDeal.remove('hoverHot' )
  21256. $(".toolRight .spotList ul li").removeClass("active")
  21257. }
  21258. var deal = ()=>{
  21259. if(this.intersect && this.intersect.object.visible ){
  21260. if("hotSprite" == this.intersect.object.type){
  21261. this.intersectHot = this.intersect.object
  21262. while(!(this.intersectHot instanceof Hot)){
  21263. this.intersectHot = this.intersectHot.parent
  21264. }
  21265. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21266. this.intersectHot.setHoverState(true)
  21267. }
  21268. }
  21269. }
  21270. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog || VisiSet.setGroundAdjust || VisiSet.setPanoArea && VisiSet.editPanoArea || VisiSet.setRoute )) {
  21271. let meshes = this.model.hotGroup.children.slice()
  21272. if(VisiSet.routeInfo?.operation == 'removeLink'){
  21273. meshes.push(...VisiSet.meshGroup.children.filter(e=>e.name.includes('routeLine:')))
  21274. }else{
  21275. VisiSet.footIcons && meshes.push(...VisiSet.footIcons)
  21276. }
  21277. this.intersect = this.getMouseIntersect(null, meshes );
  21278. deal()
  21279. if(this.intersect){
  21280. if(VisiSet.routeInfo?.operation == 'removeLink'){
  21281. CursorDeal.add('hoverRouteLine' )
  21282. }else{
  21283. CursorDeal.add('hoverFootIcon' ) //$("#player").css("cursor", "pointer");
  21284. }
  21285. }
  21286. if(this.intersectHot){
  21287. this.intersect = null
  21288. }
  21289. return
  21290. }else if (g_HotStatus) {//加热点
  21291. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21292. if(this.intersect){
  21293. //$("#player").css("cursor", "cell")
  21294. CursorDeal.remove('noIntersect' )
  21295. }else{
  21296. //$("#player").css("cursor", "not-allowed")
  21297. CursorDeal.add('noIntersect' )
  21298. }
  21299. return;
  21300. }else{
  21301. if(this.model.hotGroup){
  21302. if(editTool.atPanel == 'hotpoint'){
  21303. var hots = this.model.hotGroup.children
  21304. }else{
  21305. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21306. }
  21307. let colliders = this.model.floors.reduce(function(e, t) {
  21308. return t.hidden ? e : e.concat(t.collider.children)
  21309. }, this.mode === 'panorama' ? this.panoMarkers : []);
  21310. this.intersect = this.getMouseIntersect(null, hots.concat(colliders));
  21311. if(this.intersect){
  21312. deal()
  21313. this.intersectHot && CursorDeal.add('hoverHot' ) //$("#player").css("cursor", "pointer");
  21314. if(this.intersect){
  21315. deal()
  21316. let intersect = this.intersect
  21317. if(this.intersectHot){
  21318. this.intersect = null
  21319. $("#player").css("cursor", "pointer");
  21320. }else{
  21321. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  21322. this.intersect = null
  21323. }
  21324. }
  21325. }
  21326. }
  21327. }else{
  21328. this.intersect = this.getMouseIntersect()
  21329. }
  21330. }
  21331. this.intersect && this.updateClosestPano(this.intersect),
  21332. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21333. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21334. }
  21335. ,
  21336. t.prototype.checkHotClick = function() {
  21337. if (this.intersectHot){
  21338. if (window.VisiSet && VisiSet.setTagVisible ) {
  21339. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21340. return;
  21341. }else if(editTool.atPanel == 'hotpoint'){
  21342. let f = ()=>{editTool.hotpoint.editHot(this.intersectHot)}
  21343. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21344. editTool.hotpoint.unsaveWarn(f)
  21345. }else{
  21346. f()
  21347. }
  21348. }else{
  21349. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21350. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21351. }
  21352. this.intersectHot.examine()
  21353. }
  21354. return !0
  21355. }
  21356. }
  21357. ,
  21358. t.prototype.getMouseDirection = function(e) {
  21359. e = e || this.mouse;
  21360. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21361. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21362. }
  21363. ,
  21364. /* t.prototype.hoverOverlay = function(mesh){
  21365. if(!mesh){
  21366. this.hoveringPlane = null;
  21367. $("#player").css("cursor",this.currentCursor || "" );
  21368. }else{
  21369. var overlay = mesh.parent;
  21370. $("#player").css("cursor","pointer");
  21371. this.hoveringPlane = overlay;
  21372. return true;
  21373. }
  21374. }, */
  21375. t.prototype.clickOverlay = function(overlay){
  21376. if(this.openOverlay && !overlay)return;
  21377. var plane = overlay.plane;
  21378. if(overlay.texType == "video"){
  21379. overlay.switchPlay(!!overlay.pausedByUser)
  21380. }
  21381. if(window.EditOverlay && EditOverlay.editing){
  21382. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21383. var sure = confirm("是否保存当前展览?")
  21384. if(sure){
  21385. $("#overlayProp button.submit").click()
  21386. }else{
  21387. EditOverlay.closeOverlayPanel('cancel')
  21388. }
  21389. }
  21390. EditOverlay.beginEdit(overlay);
  21391. return;
  21392. }
  21393. },
  21394. t.prototype.getMouseIntersect = function(e, t1) {
  21395. e = e || this.mouse.clone()
  21396. var t = t1 || this.model.floors.reduce(function(e, t) {
  21397. return t.hidden ? e : e.concat(t.collider.children)
  21398. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21399. t = t.slice(0)
  21400. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21401. this.raycaster.set(i, this.getMouseDirection(e));
  21402. var n = this.raycaster.intersectObjects(t , true );//add true
  21403. var o = n[0];
  21404. if(o){
  21405. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21406. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21407. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21408. o.horizontal = .8 < o.normal.y);
  21409. return o
  21410. }
  21411. }
  21412. ,
  21413. t.prototype.updateClosestPano = function(e) {
  21414. var t = [a.filters.isPanoAligned()];
  21415. if (this.mode === V.PANORAMA) {
  21416. if (!this.currentPano)
  21417. return;
  21418. t.push(a.filters.not(this.currentPano)),
  21419. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21420. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21421. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21422. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21423. } else{
  21424. t.push(a.filters.isOnVisibleFloor()),
  21425. t.push(this.checkHasNeighbor)//add
  21426. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21427. }
  21428. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21429. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21430. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21431. this.closestPano = i,
  21432. this.closestPano && this.mode == 'panorama'? (CursorDeal.add('hoverPano' )/*, this.reticule.visible = false */)
  21433. : (CursorDeal.remove('hoverPano' )/*, this.reticule.visible = true */)
  21434. ) : this.isPanoHover = !1
  21435. }
  21436. ,
  21437. t.prototype.dollhouseMode = function(e, t) {
  21438. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21439. this.mode = V.DOLLHOUSE,
  21440. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21441. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21442. , n = new B.Vector3(15,10,15);
  21443. if (e && t) {
  21444. var r = T.FORWARD.clone().applyQuaternion(t)
  21445. , o = this.model.center.clone().sub(e).dot(r);
  21446. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21447. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21448. }
  21449. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21450. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21451. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21452. this.updateFromControls(),
  21453. this.model.alpha = 1,
  21454. this.model.skybox.material.uniforms.opacity.value = 0
  21455. }
  21456. ,
  21457. t.prototype.insideMode = function(e, t) {
  21458. var i = $.Deferred()
  21459. , n = t || null;
  21460. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21461. var r = [a.filters.isPanoAligned()];
  21462. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21463. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21464. this.flyToNewMode({
  21465. mode: V.PANORAMA,
  21466. pano: e,
  21467. callback: n
  21468. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21469. } else {
  21470. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21471. i.reject(o)
  21472. }
  21473. return i.promise()
  21474. }
  21475. ,
  21476. t.prototype.fitDollhouse = function(e, t, i) {
  21477. var maxY = this.model.boundingBox.max.y;//add
  21478. var n = T.FORWARD.clone().applyQuaternion(i);
  21479. i = n.clone().add(e);
  21480. this.cameraControls.activeControl.target.copy(i),
  21481. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21482. }
  21483. ,
  21484. t.prototype.floorplanMode = function(e, t, i) {
  21485. this.mode = V.FLOORPLAN;
  21486. var n = this.cameraControls.controls[V.FLOORPLAN];
  21487. n.reset();
  21488. var r = e || this.model.center;
  21489. if (n.target.copy(r).setY(0),
  21490. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21491. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21492. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21493. t) {
  21494. var o = T.LEFT.clone().applyQuaternion(t);
  21495. n.rotateLeft(-Math.atan2(o.x, o.z))
  21496. } else
  21497. n.rotateToView(this.model.size, this.getDirection());
  21498. n.update(0)
  21499. }
  21500. ,
  21501. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21502. return e.skipWarpingCheck = !0,
  21503. this.flyToPano(e, t)
  21504. }
  21505. ,
  21506. t.prototype.updateMarkerVisi = function() {//加
  21507. if(this.mode != "panorama")return;
  21508. this.model.panos.list.forEach((pano)=>{
  21509. if(!pano.marker)return;
  21510. var isCurrent = pano.id == this.currentPano.id;
  21511. var isNeighbour = !!pano.neighbourPanos[this.currentPano.id];
  21512. pano.marker.material.visible = !isCurrent && isNeighbour;
  21513. pano.marker.material.opacity = !isCurrent && isNeighbour ? _settings.panorama.markerOpacity : 0;
  21514. })
  21515. }
  21516. ,
  21517. /* t.prototype.updateHotVisible = function(pano){
  21518. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21519. var hots = this.model.hots;
  21520. pano = pano || this.currentPano;
  21521. for (var index in hots){
  21522. var visible;
  21523. if(this.mode != "panorama"){
  21524. visible = true;
  21525. }else{
  21526. //hots[index].mesh.material.depthTest = false;
  21527. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21528. }
  21529. hots[index].mesh.visible = visible;
  21530. }
  21531. }
  21532. */
  21533. t.prototype.flyToPano = function(e, t) {
  21534. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21535. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21536. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21537. if (aim){
  21538. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21539. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21540. }
  21541. else aimQua = aimQua
  21542. var zoomLevel = e.zoomLevel || 1 //add
  21543. if(this.flying) return t && t(e)
  21544. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21545. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21546. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21547. t && t(),
  21548. !1;
  21549. this.updateLastView()
  21550. if (this.mode !== V.PANORAMA)
  21551. return void this.flyToNewMode({
  21552. mode: V.PANORAMA,
  21553. pano: n,
  21554. duration: o,
  21555. quaternion: aimQua,
  21556. callback: t
  21557. });
  21558. if (!n || (h = x.deepExtend(e), u = function() {
  21559. j.delayOneFrame(function() {
  21560. this.flyToPano(h, t)
  21561. }.bind(this))
  21562. }.bind(this),
  21563. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21564. var d = function(e) {
  21565. t && t(e)
  21566. }
  21567. .bind(this);
  21568. this.currentPano || (this.currentPano = n,
  21569. this.path.placeCpm(),
  21570. this.path.fadeOutCpm(k.path.fadeOutTime),
  21571. this.spider.draw());
  21572. var p = o;
  21573. if ("number" != typeof o) {
  21574. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21575. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21576. }
  21577. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21578. zoomLevel !== this.zoomLevel)
  21579. switch (k.zoom.transitionStyle) {
  21580. case 1:
  21581. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21582. break;
  21583. case 2:
  21584. return h = x.deepExtend(e),
  21585. u = this.flyToPano.bind(this, h, t),
  21586. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21587. }
  21588. if (aimQua) {
  21589. G.cancelById(q.LookTransition),
  21590. p *= k.transition.aimSlowFactor;
  21591. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21592. , y = g.clone()
  21593. , A = new B.Vector3;
  21594. if (n === this.currentPano) {
  21595. var C = T.FORWARD.clone().applyQuaternion(g)
  21596. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21597. , E = C.angleTo(I);
  21598. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21599. void G.start(function(e) {
  21600. y.copy(g),
  21601. H.quaternion(y, aimQua)(e),
  21602. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21603. this.cameraControls.activeControl.lookAt(A)
  21604. }
  21605. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21606. }
  21607. }
  21608. if (n === this.currentPano )
  21609. return void d();
  21610. this.flying = !0;
  21611. var _ = this.position.clone()
  21612. , b = this.currentPano;
  21613. Y.debug("Flying to pano ", n.position);
  21614. this.emit(W.PanoChosen, this.currentPano, n);
  21615. this.emit(W.FlyingStarted, n.position, _, n, b);
  21616. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21617. Hot.updateVisibles([this.currentPano, n],'every')
  21618. aimQua && G.start(function(e) {
  21619. y.copy(g),
  21620. H.quaternion(y, aimQua)(e),
  21621. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21622. this.cameraControls.activeControl.lookAt(A)
  21623. }
  21624. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21625. var w = c ? null : z[k.transition.movementEasing];
  21626. this.nextPano = n;
  21627. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21628. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21629. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21630. this.flying = !1,
  21631. this.currentPano !== n && this.currentPano.exit(),
  21632. n.enter(),
  21633. this.currentPano = n,
  21634. this.nextPano = null,
  21635. this.path.placeCpm(),
  21636. this.path.fadeOutCpm(k.path.fadeOutTime),
  21637. this.spider.draw(),
  21638. this.emit(W.FlyingEnded, n.position, _, n, b),
  21639. this.updateMarkerVisi();//add
  21640. d(e)
  21641. if(this.mode == "panorama" ){
  21642. //EditOverlay.updatePano()
  21643. editTool.hotpoint.updatePano()
  21644. Hot.updateVisibles([this.currentPano])
  21645. this.model.fadePanoMarkers()//add
  21646. }
  21647. }
  21648. .bind(this), 0, w, "camFly", q.FlyToPano)
  21649. }
  21650. }
  21651. ,
  21652. t.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  21653. if(this.flying || this.isWarping() )return;
  21654. let pano = o.pano || this.model.panos.index[o.panoId]
  21655. if(this.mode != 'panorama'){
  21656. return this.flyToNewMode({
  21657. mode : 'panorama',
  21658. pano,
  21659. quaternion: o.quaternion
  21660. })
  21661. }
  21662. let oldPos = this.position.clone();
  21663. let oldPano = this.currentPano
  21664. this.path.warpDestPano = pano
  21665. var retry = ()=>{
  21666. this.waitingToWarp = !1,
  21667. this.blackToPano(o)
  21668. }
  21669. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  21670. return void (this.waitingToWarp = !0)
  21671. console.log('blackToPano')
  21672. this.flying = true
  21673. this.nextPano = pano //提前加载高清图片
  21674. this.path.warpDestHeroLoc = {
  21675. panoId : pano.id,
  21676. position: pano.position,
  21677. quaternion: o.quaternion || this.quaternion.clone()
  21678. }
  21679. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  21680. pano != this.currentPano && this.currentPano.exit()
  21681. pano.enter()
  21682. this.currentPano = pano
  21683. this.flying = false
  21684. this.nextPano = null
  21685. this.updateMarkerVisi();//add
  21686. console.log('blackToPano end')
  21687. } )
  21688. }
  21689. window._transitionPosId = 9999
  21690. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21691. G.cancelById(_transitionPosId)
  21692. var begin = function(object, pos, qua, scale){
  21693. if(pos){
  21694. if(!same(object.position, pos, 0.01)){
  21695. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21696. object.updateScale()
  21697. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21698. }
  21699. if(qua && !same(object.quaternion, qua, 1e-6)){
  21700. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21701. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21702. }
  21703. if(scale && !same(object.scale, scale, 0.001)){
  21704. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21705. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21706. }
  21707. }
  21708. }
  21709. var same = function(vec1, vec2, diff){
  21710. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21711. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21712. return s
  21713. }
  21714. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21715. for(let i in this.model.hots){//是否判断visible?
  21716. var hot = this.model.hots[i];
  21717. var panoData = hot.info.transformAtPanos[sid];
  21718. var useCustom = !panoData
  21719. //if(hot.usingTransformData || !useCustom){
  21720. var pos = useCustom ? hot.info.position : panoData.pos;
  21721. var qua = hot.isSprite ? null : (useCustom ? hot.info.quaternion : panoData.qua);
  21722. var scale = useCustom ? hot.info.scale : panoData.scale;
  21723. begin(hot, pos , qua, scale )
  21724. //}
  21725. //hot.usingTransformData = !useCustom;
  21726. }
  21727. if(o.callback){
  21728. setTimeout(()=>{
  21729. o.callback()
  21730. },o.dur + 16) ;//姑且这么写
  21731. }
  21732. }
  21733. window._tranOutsideFocus = 4399
  21734. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21735. //console.log("focusPoint")
  21736. if(this.mode == "floorplan"){
  21737. var control = player.cameraControls.controls.floorplan;
  21738. var currentTarget = control.target.clone()
  21739. if(!o.dontChangeScale){
  21740. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21741. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21742. var currentScale = control.absoluteScale;
  21743. }
  21744. G.cancelById(window._tranOutsideFocus, true);
  21745. G.start(function(progress){
  21746. o.dontChangeScale || (control.absoluteScale = absoluteScale*progress + currentScale*(1-progress))
  21747. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21748. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21749. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21750. }else if(player.mode == "dollhouse"){
  21751. var control = player.cameraControls.controls.dollhouse;
  21752. var radius = o.radius || 8;
  21753. var currentTarget = control.target.clone()
  21754. var dir = control.offset.clone().normalize()
  21755. var currentRadius = control.offset.length();
  21756. G.cancelById(window._tranOutsideFocus, true);
  21757. G.start(function(progress){
  21758. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21759. let radius_ = radius*progress+currentRadius*(1-progress)
  21760. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21761. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21762. }else if(this.mode == 'panorama'){
  21763. this.flyToPano({
  21764. lookAtPoint: o.aim.clone() ,
  21765. pano: this.currentPano,
  21766. aimDuration: o.dur || 600
  21767. })
  21768. }
  21769. }
  21770. t.prototype.fastForwardActivePanoFlight = function(e) {
  21771. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21772. G.adjustSpeed(q.FlyToPano, e),
  21773. G.adjustSpeed(q.LookTransition, e)
  21774. }
  21775. ,
  21776. t.prototype.flyToPanoClosestToMouse = function() {
  21777. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21778. this.intersect && this.updateClosestPano(this.intersect)),
  21779. this.closestPano)
  21780. return this.flyToPano({
  21781. pano: this.closestPano
  21782. });
  21783. var e = this.getMouseDirection();
  21784. this.flyDirection(e) || this.flyToPano({
  21785. pano: this.currentPano
  21786. })
  21787. }
  21788. ,
  21789. t.prototype.flyLocalDirection = function(e) {
  21790. var t = this.getDirection(e)
  21791. , i = 1 === e.z ? .4 : .75
  21792. , n = 1 === Math.abs(e.x);
  21793. return this.flyDirection(t, i, n)
  21794. }
  21795. ,
  21796. t.prototype.flyDirection = function(e, t, i) {
  21797. Hot.closePopup();//xzw add
  21798. var n = $.Deferred();
  21799. this.history.invalidate();
  21800. var r = this.closestPanoInDirection(e, t, i);
  21801. return r ? this.flyToPano({
  21802. pano: r
  21803. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21804. n.resolve(!1)),
  21805. n.promise()
  21806. }
  21807. ,
  21808. t.prototype.closestPanoInDirection = function(e, t, i) {
  21809. return this.rankedPanoInDirection(0, e, t, i)
  21810. }
  21811. ,
  21812. t.prototype.rankedPanoInDirection = (_ = {
  21813. pano: null,
  21814. candidates: []
  21815. },
  21816. function(e, t, i, n) {
  21817. e = e || 0,
  21818. i = void 0 !== i ? i : .75;
  21819. var r = n ? "angle" : "direction";
  21820. return this.model.panos.findRankedByScore(e,
  21821. [a.filters.isPanoAligned(),
  21822. a.filters.not(this.currentPano),
  21823. a.filters.isNeighbourPanoTo(this.currentPano),
  21824. a.filters.inPanoDirection(this.position, t, i)
  21825. ],
  21826. [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21827. this.cachedPanoCandidates = _.candidates,
  21828. _.pano
  21829. }
  21830. ),
  21831. t.prototype.bump = function(e) {
  21832. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21833. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21834. if (.5 < Math.abs(a))
  21835. t = function() {
  21836. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21837. }
  21838. .bind(this),
  21839. i = function() {
  21840. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21841. }
  21842. .bind(this);
  21843. else {
  21844. var s = this.camera.position.clone()
  21845. , l = e.clone();
  21846. this.raycaster.set(s, l);
  21847. var c = this.model.floors.reduce(function(e, t) {
  21848. return e.concat(t.collider.children)
  21849. }, [])
  21850. , h = this.raycaster.intersectObjects(c)
  21851. , u = 0 < h.length ? h[0].distance / 25 : .04
  21852. , d = s.clone().add(l.multiplyScalar(u));
  21853. t = function() {
  21854. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21855. }
  21856. .bind(this),
  21857. i = function() {
  21858. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21859. }
  21860. .bind(this)
  21861. }
  21862. n = function() {
  21863. this.flying = !1
  21864. }
  21865. .bind(this),
  21866. this.flying = !0,
  21867. t()
  21868. }
  21869. }
  21870. ,
  21871. t.prototype.changeFloor = function(e) {
  21872. if (!this.is360View(this.mode, this.currentPano))
  21873. if (this.mode === V.PANORAMA) {
  21874. var t = this.history.reversePano(e);
  21875. t && t.isAligned() ? this.flyToPano({
  21876. pano: t
  21877. }) : this.changeFloorByScore(e)
  21878. } else
  21879. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21880. }
  21881. ,
  21882. t.prototype.changeFloorByScore = (E = {
  21883. pano: null,
  21884. candidates: []
  21885. },
  21886. function(e) {
  21887. var t = this.model.nextFloor(e);
  21888. 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),
  21889. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21890. this.history.push(e, this.currentPano),
  21891. this.flyToPano({
  21892. pano: E.pano
  21893. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21894. }
  21895. ),
  21896. t.prototype.gotoFloor = function(e) {
  21897. var t = e - this.model.currentFloor.floorIndex;
  21898. this.changeFloor(t)
  21899. }
  21900. ,
  21901. t.prototype.getDirection = function(e) {
  21902. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21903. }
  21904. ,
  21905. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21906. if (r = r || $.Deferred(),
  21907. this.mode === V.TRANSITIONING)
  21908. return Y.warn("should not be transitioning here"),
  21909. n && n(!1),
  21910. r.reject().promise();
  21911. var o = i || !1
  21912. , a = i ? i.position : this.position
  21913. , s = this.position.clone()
  21914. , l = this.currentPano;
  21915. if (Y.debug("New pose in mode " + this.mode),
  21916. !e || (retryCallback = function() {
  21917. j.delayOneFrame(function() {
  21918. this.flyToSameMode(e, t, i, n, r)
  21919. }
  21920. .bind(this))
  21921. }
  21922. .bind(this),
  21923. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21924. var c = function() {
  21925. this.emit(W.FlyingEnded, a, s, e, l),
  21926. n && n(!0)
  21927. }
  21928. .bind(this)
  21929. , h = k[this.mode]
  21930. , u = void 0 !== t ? t : h.transitionTime
  21931. , d = new B.Vector3
  21932. , p = new B.Vector3;
  21933. if (this.emit(W.FlyingStarted, a, s, e, l),
  21934. this.mode === V.PANORAMA)
  21935. Y.warn("we should not be here for panorama views");
  21936. else if (this.mode === V.DOLLHOUSE)
  21937. if (o) {
  21938. var f = new B.Vector3(0,1,0);
  21939. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21940. this.model.warpDestFloors(i.floorVisibility),
  21941. p.copy(i.position);
  21942. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21943. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21944. , v = 3;
  21945. m.length ? (d.copy(m[0].point),
  21946. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21947. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21948. var y = (new B.Matrix4).lookAt(p, d, f)
  21949. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21950. , C = d.distanceTo(p)
  21951. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21952. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21953. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21954. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21955. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21956. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21957. this.path.burnsDir = Math.sign(b.y);
  21958. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21959. , T = new B.Vector3;
  21960. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21961. G.start(function(e, t) {
  21962. w.x = E.x + e * b.x,
  21963. w.y = E.y + e * b.y,
  21964. w.z = E.z + e * b.z;
  21965. var i = _ + e * (C - _);
  21966. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21967. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21968. }
  21969. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21970. G.start(function(e, t) {
  21971. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21972. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21973. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21974. }
  21975. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21976. } else
  21977. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21978. else if (this.path.placeCpm(),
  21979. this.path.fadeInCpm(k.path.fadeInTime),
  21980. i) {
  21981. this.model.warpDestFloors(i.floorVisibility);
  21982. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21983. , S = this.cameraControls.controls[V.FLOORPLAN]
  21984. , M = S.target.clone()
  21985. , R = i.position.clone().sub(M)
  21986. , P = x.position.clone().sub(S.target).length()
  21987. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21988. , L = Math.atan2(S.offset.x, S.offset.z)
  21989. , D = Math.atan2(O.x, O.z)
  21990. , N = S.absoluteScale
  21991. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21992. G.start(function(e, t) {
  21993. S.target.copy(R).multiplyScalar(e).add(M);
  21994. var i = L + (D - L) * e;
  21995. S.offset.x = P * Math.sin(i),
  21996. S.offset.z = P * Math.cos(i),
  21997. x.position.copy(S.target).add(S.offset),
  21998. S.absoluteScale = N + e * (F - N),
  21999. S.update(),
  22000. this.quaternion.copy(x.quaternion),
  22001. this.position.copy(x.position),
  22002. this.target.copy(S.target),
  22003. this.camera.projectionMatrix.copy(x.projectionMatrix)
  22004. }
  22005. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22006. } else
  22007. Y.info("flyToSameMode() funny floorplan view? skipping");
  22008. return G.setTimeout(function(e) {
  22009. this.mode = e,
  22010. c(),
  22011. r.resolve(!0)
  22012. }
  22013. .bind(this, this.mode), u, q.FlyToSameMode),
  22014. this.mode = V.TRANSITIONING,
  22015. r.promise()
  22016. }
  22017. }
  22018. ,
  22019. t.prototype.flyToNewMode = function(e, t) {
  22020. Hot.closePopup();//xzw add
  22021. var i = (e = e || {}).mode
  22022. , n = e.pano
  22023. , r = e.duration
  22024. , o = e.warpDest
  22025. , a = e.callback
  22026. , s = e.force
  22027. , l = e.quaternion;
  22028. if (t = t || $.Deferred(),
  22029. this.isWarping())
  22030. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22031. a && a(!1),
  22032. t.reject("Cannot change mode during tour transition").promise();
  22033. if (this.mode === V.TRANSITIONING)
  22034. return a && a(!1),
  22035. t.reject("Cannot change mode during mode transition").promise();
  22036. if (i === this.mode)
  22037. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22038. t.promise()) : (a && a(!1),
  22039. t.reject("Already in " + i + " mode").promise());
  22040. var c = o || !1;
  22041. Y.debug("Switching mode to " + i);
  22042. var h = function() {
  22043. j.delayOneFrame(function() {
  22044. this.flyToNewMode(e, t)
  22045. }
  22046. .bind(this))
  22047. }
  22048. .bind(this);
  22049. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  22050. return t.promise();
  22051. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)){
  22052. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22053. this.model.waitForLoad(this.model, function() {
  22054. return this.model.meshTexturesLoaded
  22055. }
  22056. .bind(this)),
  22057. this.model.loadMeshTextures().done(h),
  22058. t.promise();
  22059. }
  22060. this.history.invalidate()
  22061. this.updateLastView();
  22062. var u = this.mode
  22063. , d = this.cameraControls.cameras[i];
  22064. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  22065. var p = void 0 !== r ? r : e.transitionTime;
  22066. this.emit(W.ModeChanging, u, i, n, p)
  22067. n && (this.currentPano = n)
  22068. //----------改----------
  22069. let target,position,currentScale,fitBoundSize
  22070. if(editTool.hotpoint.editSpot){//focus
  22071. target = editTool.hotpoint.editSpot.position.clone()
  22072. let bound = editTool.hotpoint.editSpot.info.modelBound?.bound
  22073. if(bound){
  22074. bound = new THREE.Box3().copy(bound).applyMatrix4(editTool.hotpoint.editSpot.children[0].matrixWorld)
  22075. fitBoundSize = bound.size()
  22076. }else{
  22077. fitBoundSize = new THREE.Vector3(5,5,5)
  22078. }
  22079. }
  22080. this.switchCameraMode(i, l, target, position, {currentScale, fitBoundSize})
  22081. //----------------------
  22082. G.cancelById(q.LookTransition);
  22083. var f = (new B.Vector3).copy(this.position);
  22084. this.modeTran = this.mode + "-" + i;
  22085. /* if(editTool.atPanel == "screen"){
  22086. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22087. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22088. } */
  22089. if(i == "panorama"){
  22090. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  22091. }else{
  22092. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  22093. }
  22094. window.bus.dispatchEvent({type:'playerAndModelReady'})
  22095. this.ready = true
  22096. if (i === V.PANORAMA)
  22097. this.emit(W.PanoChosen, n, n),
  22098. setTimeout(function() {
  22099. n.floor.enter(i)
  22100. }
  22101. .bind(this), p / 2),
  22102. this.path.fadeOutCpm(k.path.fadeOutTime);
  22103. else if (i === V.DOLLHOUSE) {
  22104. if (c && (this.model.stayPut = !0),
  22105. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22106. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22107. this.path.placeCpm(),
  22108. this.path.fadeInCpm(k.path.fadeInTime),
  22109. c) {
  22110. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  22111. f.set(15, 10, 15);
  22112. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  22113. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  22114. v.length ? (g.copy(v[0].point),
  22115. f.copy(o.position),
  22116. 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),
  22117. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22118. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22119. f.add(this.model.position),
  22120. d.position.copy(f),
  22121. this.cameraControls.controls[V.DOLLHOUSE].update()
  22122. }
  22123. } else if (this.path.placeCpm(),
  22124. this.path.fadeInCpm(k.path.fadeInTime),
  22125. o) {
  22126. this.model.warpDestFloors(o.floorVisibility);
  22127. var y = this.cameraControls.cameras[V.FLOORPLAN]
  22128. , A = this.cameraControls.controls[V.FLOORPLAN]
  22129. , C = y.position.clone().sub(A.target)
  22130. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  22131. , E = Math.atan2(I.x, I.z);
  22132. A.target.copy(o.position);
  22133. var _ = C.length();
  22134. A.offset.x = _ * Math.sin(E),
  22135. A.offset.y = 0,
  22136. A.offset.z = _ * Math.cos(E),
  22137. y.position.copy(A.target).add(A.offset),
  22138. A.target.clone().sub(d.position),
  22139. d.quaternion.copy(o.quaternion),
  22140. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  22141. A.absoluteScale = A.currentScale,
  22142. A.update()
  22143. } else
  22144. this.model.currentFloor.enter(i);
  22145. var b = this.currentPano
  22146. , w = this.position.clone();
  22147. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22148. this.flying = !0,
  22149. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  22150. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22151. d.controls.update()),
  22152. e.blackoutStyle = P.FADEIN,
  22153. p = k.show360Views.transitionTime,
  22154. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  22155. this.mode = i,
  22156. this.path && this.path.popOutCpm(),
  22157. e.blackoutStyle = P.END,
  22158. p = k.show360Views.transitionTime,
  22159. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22160. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22161. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22162. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22163. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22164. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22165. G.setTimeout(function() {
  22166. this.flying = !1,
  22167. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22168. this.currentPano.enter(),
  22169. this.path.placeCpm(),
  22170. this.path.fadeOutCpm(k.path.fadeOutTime),
  22171. this.spider.draw()),
  22172. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22173. this.mode = i,
  22174. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22175. if (this.afterCModeFuc) {
  22176. //手动加的函数
  22177. var cf = this.afterCModeFuc;
  22178. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22179. cf();
  22180. }
  22181. this.updateMarkerVisi();//add
  22182. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22183. if(this.mode == V.PANORAMA){
  22184. //EditOverlay.updatePano()
  22185. editTool.hotpoint.updatePano()
  22186. this.model.fadePanoMarkers()
  22187. Hot.updateVisibles([this.currentPano])
  22188. }else{
  22189. Hot.updateVisibles(true)
  22190. this.model.hotGroup.children.forEach(overlay=>{
  22191. if(overlay.animateInfo){
  22192. GifTexDeal.start(overlay.animation)
  22193. }
  22194. })
  22195. }
  22196. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22197. t.resolve())
  22198. }
  22199. .bind(this), p, q.FlyToNewMode),
  22200. this.mode = V.TRANSITIONING,
  22201. //EditOverlay.updatePano(),//add
  22202. editTool.hotpoint.updatePano(),//add
  22203. //u == "panorama" && this.updateHotVisible(),
  22204. t.promise()
  22205. }
  22206. ,
  22207. t.prototype.fade360View = function(e, t, i) {
  22208. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22209. $(this.domElement).fadeOut(.5 * e, function() {
  22210. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22211. this.model.alpha = i.modelAlpha,
  22212. this.position.copy(t.position),
  22213. this.quaternion.copy(t.quaternion),
  22214. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22215. $(this.domElement).fadeIn(.5 * e)
  22216. }
  22217. .bind(this))
  22218. }
  22219. ,
  22220. t.prototype.findDefaultViews = function() {
  22221. this.findDefaultView(this.lastInsideView, !0),
  22222. this.findDefaultView(this.last360View, !1)
  22223. }
  22224. ,
  22225. t.prototype.findDefaultView = function(e, i) {
  22226. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22227. if (e.cameraMode !== V.PANORAMA)
  22228. return !1;
  22229. var t = r.get(e.panoId);
  22230. return t && t.isAligned() === i
  22231. });
  22232. 0 <= o ? (t = r.get(n[o].panoId),
  22233. e.update({
  22234. cameraMode: V.PANORAMA,
  22235. pano: t,
  22236. position: n[o].position,
  22237. quaternion: n[o].quaternion
  22238. })) : 0 <= (o = r.list.findIndex(function(e) {
  22239. return e.isAligned() === i
  22240. })) ? (t = r.list[o],
  22241. e.update({
  22242. cameraMode: V.PANORAMA,
  22243. pano: t,
  22244. position: t.position
  22245. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22246. }
  22247. ,
  22248. t.prototype.updateLastView = function() {
  22249. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22250. pano: this.currentPano,
  22251. position: this.position,
  22252. quaternion: this.quaternion
  22253. })
  22254. }
  22255. ,
  22256. t.prototype.goToLastView = function(e, t) {
  22257. var i = $.Deferred()
  22258. , n = i.resolve.bind(i)
  22259. , r = i.reject.bind(i)
  22260. , o = e ? this.lastInsideView : this.last360View;
  22261. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22262. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22263. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22264. mode: o.cameraMode,
  22265. pano: o.pano,
  22266. quaternion: o.quaternion,
  22267. callback: t
  22268. }).done(n).fail(r),
  22269. i.promise()
  22270. }
  22271. ,
  22272. t.prototype.fadeToView = function(e, t, i, n) {
  22273. var r = $.Deferred()
  22274. , o = r.resolve.bind(r)
  22275. , a = r.reject.bind(r);
  22276. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22277. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22278. a("Cannot go to illegal view"),
  22279. r.promise();
  22280. var s = (k[t.cameraMode],
  22281. function() {
  22282. $(this.domElement).fadeIn(.5 * i),
  22283. n && n(),
  22284. o()
  22285. }
  22286. .bind(this))
  22287. , l = e ? P.FADEIN : P.END;
  22288. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22289. $(this.domElement).fadeOut(.5 * i, function() {
  22290. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22291. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22292. pano: t.pano,
  22293. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22294. duration: 0
  22295. }, s) : this.flyToNewMode({
  22296. mode: t.cameraMode,
  22297. quaternion: t.quaternion,
  22298. duration: 0,
  22299. callback: s
  22300. })
  22301. }
  22302. .bind(this)),
  22303. r.promise()
  22304. }
  22305. ,
  22306. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22307. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22308. this.flying)
  22309. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22310. o && o(),
  22311. !1;
  22312. null != e || (e = M.Show),
  22313. this.history.invalidate(),
  22314. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22315. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22316. return this.emit(W.WarpStarted, a, i, n, r),
  22317. n = n || P.MIDDLE,
  22318. this.path.warpToPano(i, n, r, function() {
  22319. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22320. this.emit(W.WarpEnded, i),
  22321. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22322. o && o()
  22323. }
  22324. .bind(this)),
  22325. e === M.Hide && this.path.discardPathObject(),
  22326. !0
  22327. }
  22328. ,
  22329. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22330. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22331. s && s(),
  22332. !1)
  22333. }
  22334. ,
  22335. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22336. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22337. a && a(),
  22338. !1)
  22339. }
  22340. ,
  22341. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22342. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22343. }
  22344. ,
  22345. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22346. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22347. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22348. t && t(),
  22349. !1)
  22350. }
  22351. ,
  22352. t.prototype.aimTourCamera = function(e, t, i, n) {
  22353. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22354. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22355. }
  22356. ,
  22357. t.prototype.showPathToHeroLocation = function(e) {
  22358. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22359. }
  22360. ,
  22361. t.prototype.tourInterlude = function(e, t) {
  22362. this.history.invalidate(),
  22363. this.path.discardSlow();
  22364. var defaultRotTime = DATA.tourRotTime * 1000
  22365. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  22366. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  22367. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  22368. var rotTime
  22369. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22370. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  22371. var hasMusic = currentLocation0.musicInfo && currentLocation0.musicInfo.music
  22372. if(hasMusic){
  22373. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  22374. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22375. rotTime = currentLocation0.musicInfo.time - current
  22376. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22377. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22378. }
  22379. }else{
  22380. rotTime = defaultRotTime
  22381. }
  22382. rotTime = Math.max(0, rotTime)
  22383. //console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''))
  22384. }else{
  22385. rotTime = currentLocation.rotTime * 1000
  22386. //console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22387. }
  22388. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22389. t && t()
  22390. }
  22391. .bind(this), rotTime)
  22392. }
  22393. ,
  22394. t.prototype.stopInterlude = function() {
  22395. this.interruptAndFastForward(null, 0)
  22396. }
  22397. ,
  22398. t.prototype.interruptAndFastForward = function(e, t) {
  22399. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22400. this.flying && this.emit(W.FlyingInterrupted),
  22401. this.path.interruptAndFastForward(e, t)
  22402. }
  22403. ,
  22404. t.prototype.setSize = function(e, t) {
  22405. var i = e / t;
  22406. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22407. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22408. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22409. this.cameraControls.cameras) {
  22410. var o = this.cameraControls.cameras[r];
  22411. o.fov = this.baseFov * (1 / this.zoomLevel),
  22412. o.updateAspect(i)
  22413. }
  22414. }
  22415. ,
  22416. t.prototype.toJSON = function() {
  22417. var e = {};
  22418. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22419. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22420. return e.hidden ? 0 : 1
  22421. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22422. e
  22423. }
  22424. ,
  22425. t.prototype.getCurrentNodePanos = function(e) {
  22426. if (this.model.panos.map, e.length = 0, this.path.nodes)
  22427. for (var t = 0; t < this.path.nodes.length; t++) {
  22428. var i = this.path.nodes[t];
  22429. e.push(this.model.panos.get(i))
  22430. }
  22431. }
  22432. ,
  22433. t.prototype.zoomIncrementally = function(e) {
  22434. var t = this.zoomLevel;
  22435. this.zoomTo(this.zoomLevel + e),
  22436. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22437. }
  22438. ,
  22439. t.prototype.zoomInIncrementally = function(e) {
  22440. e = e || this.defaultZoomIncrement,
  22441. this.zoomIncrementally(e)
  22442. }
  22443. ,
  22444. t.prototype.zoomOutIncrementally = function(e) {
  22445. e = e || -this.defaultZoomIncrement,
  22446. this.zoomIncrementally(e)
  22447. }
  22448. ,
  22449. t.prototype.zoomBy = function(e) {
  22450. this.zoomTo(this.zoomLevel * e)
  22451. }
  22452. ,
  22453. t.prototype.zoomIn = function() {
  22454. this.zoomBy(1 + this.zoomSpeed)
  22455. }
  22456. ,
  22457. t.prototype.zoomOut = function() {
  22458. this.zoomBy(1 - this.zoomSpeed)
  22459. }
  22460. ,
  22461. t.prototype.zoomTo = function(e, t) {
  22462. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22463. e > k.zoom.max && (e = k.zoom.max),
  22464. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22465. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22466. e === k.zoom.min && this.emit(m.ZoomMin)),
  22467. this.cameraControls.activeControl)) {
  22468. var i = this.cameraControls.activeControl.camera;
  22469. this.zoomLevel = e,
  22470. i.fov = this.baseFov * (1 / this.zoomLevel),
  22471. i.updateProjectionMatrix(),
  22472. this.zoomFov = i.fov
  22473. }
  22474. }
  22475. ,
  22476. t.prototype.increaseZoomSpeed = function() {
  22477. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22478. }
  22479. ,
  22480. t.prototype.decreaseZoomSpeed = function() {
  22481. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22482. }
  22483. ,
  22484. t.prototype.clampZoomSpeed = function(e) {
  22485. return e < 0 ? 0 : e
  22486. }
  22487. ,
  22488. t.prototype.activatePersistentZooming = function(e) {
  22489. this.zooming = e ? 1 : -1
  22490. }
  22491. ,
  22492. t.prototype.deactivatePersistentZooming = function() {
  22493. this.zooming = 0
  22494. }
  22495. ,
  22496. t.prototype.zoomDefault = function() {
  22497. this.zoomTo(1, !0)
  22498. }
  22499. window.fovTranId = 333;//add
  22500. t.prototype.smoothZoomToDefault = function(e, t) {
  22501. G.cancelById(window.fovTranId)
  22502. var i, n = this.zoomLevel, r = function(e) {
  22503. 1 < e && (e = 1),
  22504. i = n * (1 - e) + e,
  22505. this.zoomTo(i, !0)
  22506. }
  22507. .bind(this), o = function() {
  22508. this.zoomDefault(),
  22509. t && window.setTimeout(t, 50)
  22510. }
  22511. .bind(this);
  22512. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22513. }
  22514. ,
  22515. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22516. G.cancelById(window.fovTranId)
  22517. var i,
  22518. n = this.zoomLevel,
  22519. aimLevel = zoomLevel || this.baseFov / fov
  22520. if (n == aimLevel) return
  22521. var fun = function (e) {
  22522. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22523. }.bind(this)
  22524. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22525. }
  22526. ,
  22527. t.prototype.updateZoomPano = function() {
  22528. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22529. var e = this.currentPano;
  22530. if (e) {
  22531. var t = this.zoomLevel > k.zoom.activationThreshold
  22532. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22533. t);
  22534. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22535. this.panoRenderer.setZoomingActive(i, e, !0);
  22536. var n = function(e, t) {
  22537. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22538. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22539. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22540. e.setZoomed(t)
  22541. }
  22542. .bind(this);
  22543. i && !e.zoomed ? (n(e, !0),
  22544. this.panoRenderer.enableUltraHighQualityMode(function() {
  22545. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22546. i && n(e, !0)
  22547. }
  22548. .bind(this))) : !t && e.zoomed && n(e, !1)
  22549. }
  22550. }
  22551. },
  22552. //--------
  22553. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22554. var f2;
  22555. if (this.mode == mode) {
  22556. f1 && f1()
  22557. } else {
  22558. f2 = f1;
  22559. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22560. this.afterCModeFuc = function() {
  22561. this.afterCModeFuc = f2
  22562. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22563. }.bind(this)
  22564. } else {
  22565. this.afterCModeFuc = f2;//飞入后执行
  22566. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22567. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22568. }catch(e){}
  22569. }
  22570. }
  22571. }
  22572. ,
  22573. t.prototype.checkHasNeighbor = function(pano){//add
  22574. for(var i in pano.neighbourPanos ){
  22575. if(i == pano.id)continue;
  22576. if(pano.neighbourPanos[i]){
  22577. return true;
  22578. }
  22579. }
  22580. }
  22581. ,
  22582. ee.exports = t
  22583. }
  22584. ).call(this, "/js/player.js")
  22585. }
  22586. , {
  22587. "./constants": 8,
  22588. "./enum/AlignmentType": 17,
  22589. "./enum/BlackoutStyle": 18,
  22590. "./enum/ControlEvents": 21,
  22591. "./enum/Keys": 30,
  22592. "./enum/ModelManagerEvents": 33,
  22593. "./enum/PanoSizeClass": 36,
  22594. "./enum/PanoramaEvents": 37,
  22595. "./enum/PathDiscardMode": 38,
  22596. "./enum/PathDisplayMode": 39,
  22597. "./enum/PlayerEvents": 40,
  22598. "./enum/TagStates": 44,
  22599. "./enum/Vectors": 50,
  22600. "./enum/Viewmode": 51,
  22601. "./enum/WarpStyle": 52,
  22602. "./enum/ZoomEvents": 53,
  22603. "./exception/BasicException": 55,
  22604. "./model/ModelManager": 140,
  22605. "./objects/NSpider": 147,
  22606. "./objects/Panorama": 148,
  22607. "./objects/Reticule": 149,
  22608. "./objects/ShowPath": 151,
  22609. "./objects/Snapshot": 153,
  22610. "./objects/View": 154,
  22611. "./settings": 166,
  22612. "./shaders": 167,
  22613. "./tile/TileDownloader": 171,
  22614. "./tile/TilePrioritizer": 172,
  22615. "./util/ZoomStats": 179,
  22616. "./util/browser": 182,
  22617. "./util/camera": 183,
  22618. "./util/cameraLight": 184,
  22619. "./util/common": 185,
  22620. "./util/easing": 186,
  22621. "./util/history": 187,
  22622. "./util/lerp": 188,
  22623. "./util/logger": 189,
  22624. "./util/math": 190,
  22625. "./util/transitions": 195,
  22626. // hot: "hot",
  22627. scaleImg: "scaleImg",
  22628. events: 202,
  22629. three: 217
  22630. }],
  22631. scaleImg: [function(e, t) {
  22632. var i = t;
  22633. (function() {
  22634. function e(e, t, i, n) {
  22635. function r() {
  22636. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22637. U.height = p,
  22638. H = U.getContext("2d")
  22639. }
  22640. function o(e) {
  22641. if (e) {
  22642. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22643. for (t = 0; t < ie; t += 4)
  22644. n[t] = e[t] * ne | 0,
  22645. n[t + 1] = e[t + 1] * ne | 0,
  22646. n[t + 2] = e[t + 2] * ne | 0,
  22647. n[t + 3] = e[t + 3] * ne | 0;
  22648. return delete e,
  22649. i
  22650. }
  22651. return H.getImageData(0, 0, d, p)
  22652. }
  22653. function a(e, t, i, n, r) {
  22654. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22655. }
  22656. var s, l;
  22657. if (t || (t = e.input,
  22658. i = e.output,
  22659. n = e.inputRemovable,
  22660. e.scale && (e = e.scale)),
  22661. t.src)
  22662. if (s = document.createElement("canvas"),
  22663. null != t.naturalWidth)
  22664. s.width = t.naturalWidth,
  22665. s.height = t.naturalHeight;
  22666. else if (null != t.runtimeStyle) {
  22667. var c = t.runtimeStyle
  22668. , h = c.width
  22669. , u = c.height;
  22670. c.width = "auto",
  22671. c.height = "auto",
  22672. s.width = t.width,
  22673. s.height = t.height,
  22674. c.width = h,
  22675. c.height = u
  22676. } else {
  22677. h = t.width,
  22678. u = t.height;
  22679. t.removeAttribute && (t.removeAttribute("width"),
  22680. t.removeAttribute("height")),
  22681. s.width = t.width,
  22682. s.height = t.height,
  22683. t.width = h,
  22684. t.height = u
  22685. }
  22686. else
  22687. s = t;
  22688. l = s.getContext("2d"),
  22689. t.src && l.drawImage(t, 0, 0);
  22690. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22691. if (!f || !g)
  22692. return !1;
  22693. (t.src || n) && s.clearRect(0, 0, f, g),
  22694. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22695. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22696. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22697. e * g + .5 | 0);
  22698. 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;
  22699. if (1 < re || 1 < oe)
  22700. for (r(),
  22701. G = (z = o()).data,
  22702. C = 0; C < p; C++)
  22703. for (V = (y = C / oe) - (w = 0 | y),
  22704. j = w * $,
  22705. W = w < 1 ? j : j - $,
  22706. w < g - 2 ? (Y = j + $,
  22707. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22708. A = 0; A < d; A++,
  22709. te += 4)
  22710. Z = (b = 0 | (v = A / re)) << 2,
  22711. b < f - 2 ? (K = Z + 4,
  22712. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22713. 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,
  22714. ++Z,
  22715. ++K,
  22716. ++Q,
  22717. 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,
  22718. ++Z,
  22719. ++K,
  22720. ++Q,
  22721. 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,
  22722. ++Z,
  22723. ++K,
  22724. ++Q,
  22725. 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,
  22726. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22727. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22728. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22729. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22730. else {
  22731. if (le.Float32Array)
  22732. L = new Float32Array(ie);
  22733. else
  22734. for (L = [],
  22735. te = 0; te < ie; ++te)
  22736. L[te] = 0;
  22737. for (y = 0; y < g; y++)
  22738. for (I = (_ = 0 | (C = y * oe)) * J,
  22739. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22740. R = C + oe - _ - 1),
  22741. v = 0; v < f; v++,
  22742. ee += 4)
  22743. switch (A = v * re,
  22744. E = 0 | A,
  22745. te = I + (E << 2),
  22746. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22747. P && (x = 1 + E - A,
  22748. S = A + re - E - 1),
  22749. D = m[ee],
  22750. F = m[ee + 1],
  22751. B = m[ee + 2],
  22752. N = m[ee + 3],
  22753. P + O) {
  22754. case 0:
  22755. L[te] += D * ae,
  22756. L[te + 1] += F * ae,
  22757. L[te + 2] += B * ae,
  22758. L[te + 3] += N * ae;
  22759. break;
  22760. case 1:
  22761. T = x * oe,
  22762. L[te] += D * T,
  22763. L[te + 1] += F * T,
  22764. L[te + 2] += B * T,
  22765. L[te + 3] += N * T,
  22766. T = S * oe,
  22767. L[te + 4] += D * T,
  22768. L[te + 5] += F * T,
  22769. L[te + 6] += B * T,
  22770. L[te + 7] += N * T;
  22771. break;
  22772. case 2:
  22773. T = re * M,
  22774. L[te] += D * T,
  22775. L[te + 1] += F * T,
  22776. L[te + 2] += B * T,
  22777. L[te + 3] += N * T,
  22778. T = re * R,
  22779. L[te += J] += D * T,
  22780. L[te + 1] += F * T,
  22781. L[te + 2] += B * T,
  22782. L[te + 3] += N * T;
  22783. break;
  22784. default:
  22785. T = x * M,
  22786. L[te] += D * T,
  22787. L[te + 1] += F * T,
  22788. L[te + 2] += B * T,
  22789. L[te + 3] += N * T,
  22790. T = S * M,
  22791. L[te + 4] += D * T,
  22792. L[te + 5] += F * T,
  22793. L[te + 6] += B * T,
  22794. L[te + 7] += N * T,
  22795. T = x * R,
  22796. L[te += J] += D * T,
  22797. L[te + 1] += F * T,
  22798. L[te + 2] += B * T,
  22799. L[te + 3] += N * T,
  22800. T = S * R,
  22801. L[te + 4] += D * T,
  22802. L[te + 5] += F * T,
  22803. L[te + 6] += B * T,
  22804. L[te + 7] += N * T
  22805. }
  22806. delete m,
  22807. r(),
  22808. z = o(L)
  22809. }
  22810. if (H.putImageData(z, 0, 0),
  22811. "string" == typeof i) {
  22812. var se;
  22813. if ("png" === i || "jpeg" === i)
  22814. return (se = n && t.src ? t : new Image).width = d,
  22815. se.height = p,
  22816. se.src = U.toDataURL("image/" + i, .85),
  22817. se;
  22818. if ("png-src" === i || "jpeg-src" === i)
  22819. return U.toDataURL("image/" + i.split("-")[0], .85)
  22820. }
  22821. return U
  22822. }
  22823. var le = this;
  22824. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22825. exports.scale = e) : c = e
  22826. }
  22827. ).call(this),
  22828. i.exports = c
  22829. }
  22830. , {}],
  22831. 156: [function(i, n, e) {
  22832. (function(e) {
  22833. "use strict";
  22834. function t(e, t) {
  22835. this.model = e,
  22836. this.panos = e.panos,
  22837. this.player = t,
  22838. this.imagePanos = this.listImagePanos(),
  22839. this.retryMinimumTime = 1e4
  22840. }
  22841. var r = (i("three"),
  22842. i("./enum/Viewmode"))
  22843. , o = (i("./settings"),
  22844. i("./objects/Panorama"))
  22845. , a = new (i("./util/logger"))(e);
  22846. t.prototype.start = function() {
  22847. this.loadNextPano(function(e) {
  22848. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22849. setTimeout(function() {
  22850. this.start()
  22851. }
  22852. .bind(this), 1e3))
  22853. }
  22854. .bind(this))
  22855. }
  22856. ,
  22857. t.prototype.validLoadTarget = function(e) {
  22858. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22859. }
  22860. ,
  22861. t.prototype.listImagePanos = function() {
  22862. var i = []
  22863. , n = this;
  22864. return this.model.images.forEach(function(e) {
  22865. if (e.metadata && e.metadata.scan_id) {
  22866. var t = n.model.panos.get(e.metadata.scan_id);
  22867. t && !t.isLoaded("high") && i.push(t)
  22868. }
  22869. }),
  22870. i
  22871. }
  22872. ,
  22873. t.prototype.nextNotLoadedImage = function() {
  22874. for (; 0 < this.imagePanos.length; ) {
  22875. var e = this.imagePanos[0];
  22876. if (!e.isLoaded("high"))
  22877. return e;
  22878. this.imagePanos.shift()
  22879. }
  22880. return null
  22881. }
  22882. ,
  22883. t.prototype.loadNextPano = function(e) {
  22884. var t, i, n = this.model.waitQueue.filter(function(e) {
  22885. return e.object instanceof o
  22886. });
  22887. 0 < n.length ? (t = n[0].object,
  22888. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22889. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22890. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22891. t = this.imagePanos[0],
  22892. 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),
  22893. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22894. a.debug("Preloading " + i + "-res pano " + t.id),
  22895. t.loadCube(i).done(e).fail(function() {
  22896. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22897. e()
  22898. })) : e && e(null)
  22899. }
  22900. ,
  22901. n.exports = t
  22902. }
  22903. ).call(this, "/js/preloaders.js")
  22904. }
  22905. , {
  22906. "./enum/Viewmode": 51,
  22907. "./objects/Panorama": 148,
  22908. "./settings": 166,
  22909. "./util/logger": 189,
  22910. three: 217
  22911. }],
  22912. 157: [function(a, s, e) {
  22913. (function(e) {
  22914. "use strict";
  22915. function t(e, t, i, n, r) {
  22916. this.qualityManager = e,
  22917. this.scene = t,
  22918. this.camera = i,
  22919. this.container = r,
  22920. this.controls = n,
  22921. this.controls.enabled = !0,
  22922. this.controls.locked = !0,
  22923. this.quickstartCamera = n.camera,
  22924. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22925. this.skybox = null
  22926. }
  22927. var i = a("three")
  22928. , n = a("../util/logger")
  22929. , o = a("../constants")
  22930. , h = (a("../util/transitions"),
  22931. a("../util/lerp"),
  22932. a("../util/easing"),
  22933. a("../enum/Vectors"))
  22934. , u = a("../enum/PanoSizeClass")
  22935. , r = (a("../materials/ModelTextureMaterial"),
  22936. a("../materials/CubemapMaterial"))
  22937. , d = (a("../cameras/PanoramaCamera"),
  22938. a("../controls/PanoramaControls"),
  22939. a("../tile/TileUtils"),
  22940. a("../util/camera"),
  22941. a("../util/cameraLight"))
  22942. , p = (a("../util/browser"),
  22943. a("../settings"),
  22944. a("../gui/helpManager"),
  22945. new n(e));
  22946. t.prototype.load = function(e) {
  22947. e.pano.shouldRedrawOnBaseLoaded = !0;
  22948. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22949. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22950. var a = this.qualityManager.getPanoSize(u.BASE)
  22951. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22952. if (e.pano.tiled) {
  22953. p.warn("Loading startPano, TILED", e.pano.id);
  22954. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22955. , c = this.quickstartCamera.fov;
  22956. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22957. t = e.pano.loadTiledPano(s, r, {
  22958. hFov: l,
  22959. vFov: c
  22960. }, !1, !1, !0),
  22961. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22962. } else
  22963. p.warn("Loading startPano", e.pano.id),
  22964. t = e.pano.loadCube("high");
  22965. return $.when(t).then(function() {
  22966. n.init(e.pano, e.quaternion),
  22967. e.pano.tiled ? i.done(function() {
  22968. e.pano.lockUntilRenderingComplete = !1,
  22969. this.controls.locked = !1
  22970. }
  22971. .bind(this)) : this.controls.locked = !1
  22972. }
  22973. .bind(this))
  22974. }
  22975. ,
  22976. t.prototype.init = function(e, t) {
  22977. p.info("Quickstart done loading, adding scene objects"),
  22978. e.lockUntilRenderingComplete = !0,
  22979. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22980. side: i.BackSide
  22981. })),
  22982. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22983. this.skybox.quaternion.copy(e.quaternion),
  22984. this.scene.add(this.skybox),
  22985. $(this.container).show()
  22986. }
  22987. ,
  22988. t.prototype.update = function(e) {
  22989. this.controls.update(e),
  22990. this.camera.copy(this.quickstartCamera)
  22991. }
  22992. ,
  22993. t.prototype.setSize = function(e, t) {
  22994. this.quickstartCamera.updateAspect(e / t)
  22995. }
  22996. ,
  22997. t.prototype.destroy = function() {
  22998. this.scene.remove(this.skybox)
  22999. }
  23000. ,
  23001. s.exports = t
  23002. }
  23003. ).call(this, "/js/scene/QuickstartManager.js")
  23004. }
  23005. , {
  23006. "../cameras/PanoramaCamera": 7,
  23007. "../constants": 8,
  23008. "../controls/PanoramaControls": 13,
  23009. "../enum/PanoSizeClass": 36,
  23010. "../enum/Vectors": 50,
  23011. "../gui/helpManager": 68,
  23012. "../materials/CubemapMaterial": 117,
  23013. "../materials/ModelTextureMaterial": 118,
  23014. "../settings": 166,
  23015. "../tile/TileUtils": 174,
  23016. "../util/browser": 182,
  23017. "../util/camera": 183,
  23018. "../util/cameraLight": 184,
  23019. "../util/easing": 186,
  23020. "../util/lerp": 188,
  23021. "../util/logger": 189,
  23022. "../util/transitions": 195,
  23023. three: 217
  23024. }],
  23025. 158: [function(e, t, i) {
  23026. "use strict";
  23027. function h(e, t, i) {
  23028. this.scene = e,
  23029. this.camera = t,
  23030. this.renderer = null,
  23031. this.effects = i,
  23032. this.animateCallback = null,
  23033. this.composer = null,
  23034. this.qualityManager = null,
  23035. e.renderWidth = 0,
  23036. e.renderHeight = 0,
  23037. this.updateClock = new M.Clock,
  23038. this.components = [],
  23039. this.updateListeners = [],
  23040. this.resizeListeners = [],
  23041. this.forceUpdateSize = !1,
  23042. this.started = !1,
  23043. this.textures = {},
  23044. this.suspendedObjects = []
  23045. }
  23046. 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;
  23047. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23048. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  23049. this.components.push(e),
  23050. e.update && this.updateListeners.push(e),
  23051. e.setSize && (this.resizeListeners.push(e),
  23052. this.forceUpdateSize = !0)
  23053. }
  23054. ,
  23055. h.prototype.removeComponent = function(t) {
  23056. function e(e) {
  23057. return e !== t
  23058. }
  23059. this.components = this.components.filter(e),
  23060. this.updateListeners = this.updateListeners.filter(e),
  23061. this.resizeListeners = this.resizeListeners.filter(e)
  23062. }
  23063. ,
  23064. h.prototype.start = function(e) {
  23065. if (this.started)
  23066. throw new l("Can't start SceneRenderer, already started");
  23067. this.createContext(e),
  23068. //u.isMobile() && this.boluoVrInit(),
  23069. this.initComposer(),
  23070. this.started = !0,
  23071. (b = b.bind(this))()
  23072. }
  23073. ,
  23074. h.prototype.createContext = function(e) {
  23075. try {
  23076. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  23077. this.renderer.autoClear = !0,
  23078. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23079. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  23080. this.emit(r.ContextCreated)
  23081. } catch (e) {
  23082. throw new c("Unable to create a WebGL rendering context")
  23083. }
  23084. d.profiling.enabled && this.overrideTextures(),
  23085. e.appendChild(this.renderer.domElement)
  23086. }
  23087. ,
  23088. h.prototype.overrideTextures = function() {
  23089. var d = this.renderer.context
  23090. , t = 0
  23091. , i = d.createTexture;
  23092. d.createTexture = function() {
  23093. var e = i.call(d);
  23094. return e.id = t++,
  23095. this.textures[e.id] = e
  23096. }
  23097. .bind(this);
  23098. var p = d.texImage2D;
  23099. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  23100. var c, h = this.getTextureTypeFromTarget(d, e);
  23101. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  23102. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  23103. s = r,
  23104. n = (l = o).naturalWidth,
  23105. r = l.naturalHeight,
  23106. p.call(d, e, t, i, a, s, l));
  23107. var u = this.textures[c.id];
  23108. u.width = h === f.TextureCube ? 6 * n : n,
  23109. u.height = r
  23110. }
  23111. .bind(this);
  23112. var n = d.deleteTexture;
  23113. d.deleteTexture = function(e) {
  23114. delete this.textures[e.id],
  23115. n.call(d, e)
  23116. }
  23117. .bind(this)
  23118. }
  23119. ,
  23120. h.prototype.updateTextureMemory = (n = null,
  23121. function() {
  23122. var e = 0;
  23123. for (var t in this.textures) {
  23124. var i = this.textures[t];
  23125. i.width && i.height && (e += i.width * i.height * 4)
  23126. }
  23127. e !== n && this.emit(r.MemoryUsageUpdated, e),
  23128. n = e
  23129. }
  23130. ),
  23131. h.prototype.getTextureTypeFromTarget = function(e, t) {
  23132. switch (t) {
  23133. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23134. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23135. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23136. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23137. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23138. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23139. return f.TextureCube;
  23140. case e.TEXTURE_2D:
  23141. return f.Texture2D;
  23142. default:
  23143. return null
  23144. }
  23145. }
  23146. ,
  23147. h.prototype.initComposer = function() {
  23148. this.composer = new M.EffectComposer(this.renderer),
  23149. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  23150. /* this.composer.addPass(this.effects.hblurPass),
  23151. this.composer.addPass(this.effects.vblurPass) */
  23152. this.composer.addPass(this.effects.fastTranMaskPass)//add
  23153. }
  23154. ,
  23155. h.prototype.setSize = function(e, t, i) {
  23156. this.renderWidth = e,
  23157. this.renderHeight = t,
  23158. this.effects.aspect = e / t,
  23159. this.renderer.setSize(e, t, !1, i),
  23160. this.composer.setSize(e, t);
  23161. for (var n = 0; n < this.resizeListeners.length; n++)
  23162. this.resizeListeners[n].setSize(e, t)
  23163. }
  23164. ,
  23165. h.prototype.render = function() {
  23166. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23167. }
  23168. ,
  23169. h.prototype.boluoVrInit = function() {
  23170. console.log("boluoVrInit"),
  23171. this.isHuawei5X = u.detectHUAWEI5X(),
  23172. this.oldRenderer = this.renderer,
  23173. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  23174. window.panoCamera = this.camera;
  23175. var i = this;
  23176. window._vrEnabled = !1,
  23177. Object.defineProperty(window, "vrEnabled", {
  23178. get: function() {
  23179. return window._vrEnabled
  23180. },
  23181. set: function(e) {
  23182. (e = !!e) ? (i.renderer = i.newRenderer,
  23183. window.vrMarkers.forEach(function(e) {
  23184. e.visible = !0
  23185. })) : (i.renderer = i.oldRenderer,
  23186. window.vrMarkers.forEach(function(e) {
  23187. e.visible = !1
  23188. })),
  23189. i.cursor.visible = e,
  23190. i.setSize($("#player").width(), $("#player").height()),
  23191. window._vrEnabled = e,
  23192. setTimeout(function() {
  23193. console.log(player.cameraControls.activeControl.camera.fov)
  23194. }, 500)
  23195. }
  23196. }),
  23197. this.createCursor(.5, !1, 1, 16777215, 0);
  23198. var e = {
  23199. setSize: function(e, t) {
  23200. i.camera.aspect = e / t
  23201. }
  23202. };
  23203. this.resizeListeners.push(e),
  23204. this.vrLoadingInit()
  23205. }
  23206. ,
  23207. h.prototype.vrLoadingInit = function() {
  23208. var e = new (e = function(camera) {
  23209. var t = this
  23210. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23211. , i = new M.MeshBasicMaterial({
  23212. color: 4967932,
  23213. side: M.DoubleSide
  23214. })
  23215. , n = new M.Mesh(e,i);
  23216. (this.mesh = n).position.z = -2,
  23217. n.scale.set(.08, .08, .08),
  23218. n.visible = !1,
  23219. //window.player.camera.add(n),
  23220. camera.add(n),
  23221. t.enabled = !1,
  23222. this.update = function(e) {
  23223. 1 == t.enabled && (n.rotation.z += 15 * e)
  23224. }
  23225. }
  23226. )(this.camera);
  23227. window.Loading = e,
  23228. this.updateListeners.push(e)
  23229. }
  23230. ,
  23231. h.prototype.createCursor = function(e, t, i, n, r) {
  23232. var o, a = new M.SpriteMaterial({
  23233. opacity: i,
  23234. color: n,
  23235. transparent: t,
  23236. map: this.boluoGetTexture("images/cursor.png"),
  23237. needsUpdate: !0,
  23238. side: M.DoubleSide
  23239. });
  23240. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23241. a.map.repeat = new M.Vector2(1 / 17,1),
  23242. a.depthTest = !1,
  23243. a.blending = M.AdditiveBlending,
  23244. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23245. o.position.z = -2,
  23246. o.visible = !1,
  23247. o.name = "cursor",
  23248. this.camera.add(o),
  23249. this.scene.add(this.camera),
  23250. this.cursor = o;
  23251. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23252. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23253. this.updateListeners.push(s)
  23254. }
  23255. ,
  23256. h.prototype.CursorAnimation = function(e, t, o) {
  23257. this.cursor = t,
  23258. this.raycaster = new M.Raycaster,
  23259. this.targetEventObj = {},
  23260. this.type = 1,
  23261. this.tweenFlag = !0;
  23262. var s = this;
  23263. this.target = o,
  23264. console.log(o.uuid),
  23265. this.euler = new M.Euler,
  23266. this.q0 = new M.Quaternion,
  23267. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23268. this.zee = new M.Vector3(0,0,1),
  23269. this.alpha = -1e3,
  23270. this.beta = -1e3,
  23271. this.gamma = -1e3,
  23272. this.orient = M.Math.degToRad(window.orientation || 0),
  23273. window.addEventListener("orientationchange", function() {
  23274. s.orient = M.Math.degToRad(window.orientation || 0)
  23275. }),
  23276. window.addEventListener("deviceorientation", function(e) {
  23277. var t = M.Math.degToRad(e.alpha)
  23278. , i = M.Math.degToRad(e.beta)
  23279. , n = M.Math.degToRad(e.gamma);
  23280. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23281. -1e3 === s.beta && (s.beta = i),
  23282. -1e3 === s.gamma && (s.gamma = n),
  23283. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23284. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23285. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23286. s.beta = i,
  23287. s.gamma = n),
  23288. h.vrDebug) {
  23289. $("#info-device-orientation").css("display", "block");
  23290. var r = "";
  23291. r += "alpha=(" + s.alpha + ")<BR/>",
  23292. r += "beta=(" + s.beta + ")<BR/>",
  23293. r += "gamma=" + s.gamma + "<BR/>",
  23294. document.getElementById("info-device-orientation").innerHTML = r
  23295. }
  23296. }),
  23297. this.setObjectQuaternion = function(e, t, i, n, r) {
  23298. s.euler.set(i, t, -n, "YXZ"),
  23299. e.setFromEuler(s.euler),
  23300. e.multiply(s.q1),
  23301. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23302. o.updateMatrixWorld()
  23303. }
  23304. ,
  23305. parent !== window && window.addEventListener("message", function(e) {
  23306. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23307. o && o.alpha && o.beta && o.gamma && (t = a,
  23308. i = M.Math.degToRad(o.alpha),
  23309. n = M.Math.degToRad(o.beta),
  23310. r = M.Math.degToRad(o.gamma),
  23311. t ? (-1e3 === s.alpha && (s.alpha = i),
  23312. -1e3 === s.beta && (s.beta = n),
  23313. -1e3 === s.gamma && (s.gamma = r),
  23314. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23315. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23316. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23317. s.beta = n,
  23318. s.gamma = r))
  23319. }),
  23320. this.update = function(e) {
  23321. TWEEN.update(),
  23322. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23323. this.triggerTargetEvent())
  23324. }
  23325. ,
  23326. this.triggerTargetEvent = function() {
  23327. var e = this.choseObj()
  23328. , t = e ? e.object : void 0;
  23329. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23330. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23331. t && t.enabled && this.startAnimate(function() {
  23332. this.clickCallback(t)
  23333. }
  23334. .bind(this))) : this.type,
  23335. this.targetEventObj.lastObj = t)
  23336. }
  23337. ,
  23338. this.choseObj = function() {
  23339. this.raycaster.setFromCamera({
  23340. x: 0,
  23341. y: 0
  23342. }, o);
  23343. var e = (this.raycaster.ray,
  23344. window.vrMarkers)
  23345. , t = this.raycaster.intersectObjects(e);
  23346. if (0 < t.length)
  23347. return t[0]
  23348. }
  23349. ,
  23350. this.clickCallback = function(e) {
  23351. this.runTHREEAction(e, "onclick")
  23352. }
  23353. ,
  23354. this.runTHREEAction = function(e, t) {
  23355. switch (t) {
  23356. case "onclick":
  23357. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23358. e()
  23359. });
  23360. break;
  23361. case "onhover":
  23362. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23363. e()
  23364. });
  23365. break;
  23366. case "onout":
  23367. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23368. e()
  23369. })
  23370. }
  23371. }
  23372. ,
  23373. this.startAnimate = function(e) {
  23374. this.tweenFlag && this.initAnimation(e)
  23375. }
  23376. ,
  23377. this.initAnimation = function(e) {
  23378. var t = this
  23379. , i = this.cursor.material.map.offset;
  23380. t.tweenFlag = !1,
  23381. this.cursorAnimate = new TWEEN.Tween(i).to({
  23382. x: 1
  23383. }, 1e3).onStart(function() {
  23384. t.tweenFlag = !1
  23385. }).onStop(function() {
  23386. t.tweenFlag = !0,
  23387. this.x = 0,
  23388. i.x = 0
  23389. }).onUpdate(function() {}).onComplete(function() {
  23390. e(),
  23391. i.x = 0,
  23392. setTimeout(function() {
  23393. t.tweenFlag = !0
  23394. }, 1500)
  23395. }),
  23396. this.cursorAnimate.easing(function(e) {
  23397. return Math.floor(17 * e) / 17
  23398. }),
  23399. this.cursorAnimate.start()
  23400. }
  23401. ,
  23402. this.autoCursorPosition = function(e) {
  23403. this.cursor.scale.set(.3, .3, .3)
  23404. }
  23405. }
  23406. ,
  23407. h.prototype.vrRenderer = function(a, i, e) {
  23408. var s = new i.vrCamera(e);
  23409. s.bananaAspect = .8,
  23410. this.width,
  23411. this.height;
  23412. i = this;
  23413. this.setSize = function(e, t) {
  23414. a.setSize.call(this, e, t),
  23415. i.width = e,
  23416. i.height = t
  23417. }
  23418. ,
  23419. this.render = function(e, t, i, n) {
  23420. var r, o;
  23421. if (window.cameraQua = t.quaternion.clone(),
  23422. t.__RESS__SKIP__STEREO__)
  23423. return a.render(e, t, i, n);
  23424. if ("PerspectiveCamera" === t.type)
  23425. r = s.cameraL,
  23426. o = s.cameraR,
  23427. e.updateMatrixWorld(),
  23428. null === t.parent && t.updateMatrixWorld(),
  23429. s.vrCameraUpdate(t);
  23430. else {
  23431. if ("OrthographicCamera" !== t.type)
  23432. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23433. r = o = t
  23434. }
  23435. a.setScissorTest(!0),
  23436. a.setScissor(0, 0, this.width / 2, this.height),
  23437. a.setViewport(0, 0, this.width / 2, this.height),
  23438. a.render.call(this, e, r, i, n),
  23439. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23440. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23441. a.render.call(this, e, o, i, n),
  23442. a.setScissorTest(!1)
  23443. }
  23444. ,
  23445. this.__proto__ = {
  23446. __proto__: a
  23447. }
  23448. }
  23449. ,
  23450. h.prototype.vrCamera = function(e) {
  23451. this.type = "StereoCamera",
  23452. this._aspect = 1,
  23453. this._overlap = .064,
  23454. this.cameraL = new M.PerspectiveCamera,
  23455. this.cameraL.layers.enable(1),
  23456. this.cameraL.matrixAutoUpdate = !1,
  23457. this.cameraR = new M.PerspectiveCamera,
  23458. this.cameraR.layers.enable(2),
  23459. this.cameraR.matrixAutoUpdate = !1,
  23460. this.eyeRight = new M.Matrix4,
  23461. this.eyeLeft = new M.Matrix4,
  23462. this.vrCameraNeedsUpdate = !0,
  23463. window.vrCameraL = this.cameraL,
  23464. Object.defineProperty(this, "bananaAspect", {
  23465. get: function() {
  23466. return this._aspect
  23467. },
  23468. set: function(e) {
  23469. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23470. this._aspect = e
  23471. }
  23472. }),
  23473. Object.defineProperty(this, "overlap", {
  23474. get: function() {
  23475. return this._overlap
  23476. },
  23477. set: function(e) {
  23478. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23479. this._overlap = e
  23480. }
  23481. }),
  23482. this.vrCameraUpdate = function(e) {
  23483. if (this.vrCameraNeedsUpdate = !0,
  23484. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23485. this.vrCameraNeedsUpdate) {
  23486. this.vrCameraNeedsUpdate = !1,
  23487. console.debug("vrCameraUpdate"),
  23488. this.bananaFocus = e.focus,
  23489. this.bananaFov = e.fov,
  23490. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23491. this.bananaNear = e.near,
  23492. this.bananaFar = e.far,
  23493. console.debug(e.aspect),
  23494. this.bananaFocus = 10;
  23495. 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);
  23496. this.eyeLeft.elements[12] = -r,
  23497. this.eyeRight.elements[12] = r,
  23498. t = -a * this.bananaReal_aspect + o,
  23499. i = a * this.bananaReal_aspect + o,
  23500. n.elements[0] = 2 * this.bananaNear / (i - t),
  23501. n.elements[8] = (i + t) / (i - t),
  23502. this.cameraL.projectionMatrix.copy(n),
  23503. t = -a * this.bananaReal_aspect - o,
  23504. i = a * this.bananaReal_aspect - o,
  23505. n.elements[0] = 2 * this.bananaNear / (i - t),
  23506. n.elements[8] = (i + t) / (i - t),
  23507. this.cameraR.projectionMatrix.copy(n)
  23508. }
  23509. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23510. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23511. }
  23512. }
  23513. ,
  23514. h.prototype.boluoGetTexture = function(e) {
  23515. var t = new M.TextureLoader;
  23516. return t.crossOrigin = "anonymous",
  23517. t.load(e)
  23518. }
  23519. ,
  23520. h.prototype.updateScreenSize = function(e) {
  23521. var t, i, n, r = !1;
  23522. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23523. n = e.height,
  23524. r = !0,
  23525. t = 1) : (i = $("#player").width(),
  23526. n = $("#player").height(),
  23527. e && e.resize && (o = this.renderWidth,
  23528. a = this.renderHeight),
  23529. i === o && n === a && !this.forceUpdateSize || (o = i,
  23530. a = n,
  23531. r = !0,
  23532. t = window.devicePixelRatio)),
  23533. r && (this.setSize(i, n, t),
  23534. this.forceUpdateSize = !1)
  23535. }
  23536. ,
  23537. h.prototype.updateComponents = function() {
  23538. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23539. this.updateListeners[t].update(e)
  23540. }
  23541. ,
  23542. h.prototype.suspend = function() {
  23543. this.started = !1,
  23544. this.suspendedObjects = this.scene.children.map(function(e) {
  23545. return this.scene.remove(e),
  23546. e
  23547. }
  23548. .bind(this)),
  23549. this.render()
  23550. }
  23551. ,
  23552. h.prototype.resume = function() {
  23553. this.suspendedObjects.forEach(function(e) {
  23554. this.scene.add(e)
  23555. }
  23556. .bind(this)),
  23557. this.suspendedObjects = [],
  23558. this.started = !0,
  23559. b()
  23560. }
  23561. ;
  23562. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23563. this.started && (window.requestAnimationFrame(b),
  23564. this.updateScreenSize(),
  23565. this.updateComponents(),
  23566. this.updateTextureMemory(),
  23567. this.render(),
  23568. this.emit(r.AfterRender))
  23569. };
  23570. h.prototype.getImageData = (E = document.createElement("canvas"),
  23571. _ = E.getContext("2d"),
  23572. function(e, t, i) {
  23573. return E.width === t && E.height === i || (E.width = t,
  23574. E.height = i),
  23575. _.drawImage(e, 0, 0, t, i),
  23576. _.getImageData(0, 0, t, i)
  23577. }
  23578. ),
  23579. h.prototype.initSizedTexture2D = function(e, t, i) {
  23580. var n = this.renderer
  23581. , r = n.context
  23582. , o = n.state
  23583. , a = new M.Texture(null);
  23584. !(a.flipY = !1) !== i && (i = !1),
  23585. a.generateMipmaps = i;
  23586. var s = n.paramThreeToGL(a.format)
  23587. , l = n.paramThreeToGL(a.type)
  23588. , c = n.properties.get(a)
  23589. , h = r.createTexture();
  23590. o.bindTexture(r.TEXTURE_2D, h),
  23591. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23592. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23593. a.wrapS = t,
  23594. a.wrapT = t;
  23595. var u = n.paramThreeToGL(t);
  23596. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23597. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23598. i ? (a.magFilter = M.LinearFilter,
  23599. a.minFilter = M.LinearMipMapLinearFilter,
  23600. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23601. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23602. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23603. a.minFilter = M.LinearFilter,
  23604. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23605. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23606. o.bindTexture(r.TEXTURE_2D, null),
  23607. c.__webglTexture = h,
  23608. a
  23609. }
  23610. ,
  23611. h.prototype.initSizedCubeMap = function(e, t) {
  23612. var i = this.renderer
  23613. , n = i.context
  23614. , r = i.state
  23615. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23616. o.flipY = !1,
  23617. o.generateMipmaps = t;
  23618. var a = i.paramThreeToGL(o.format)
  23619. , s = i.paramThreeToGL(o.type)
  23620. , l = i.properties.get(o)
  23621. , c = n.createTexture();
  23622. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23623. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23624. for (var h = 0; h < 6; h++)
  23625. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23626. return t ? (o.magFilter = M.LinearFilter,
  23627. o.minFilter = M.LinearMipMapLinearFilter,
  23628. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23629. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23630. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23631. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23632. o.minFilter = M.LinearFilter,
  23633. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23634. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23635. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23636. l.__image__webglTextureCube = c,
  23637. o
  23638. }
  23639. ,
  23640. h.prototype.deallocateCubeTexture = function(e) {
  23641. var t = this.renderer
  23642. , i = t.context
  23643. , n = t.properties.get(e);
  23644. i.deleteTexture(n.__image__webglTextureCube)
  23645. }
  23646. ,
  23647. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23648. var a = this.renderer
  23649. , s = a.context
  23650. , l = a.state
  23651. , c = a.properties.get(t);
  23652. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23653. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23654. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23655. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23656. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23657. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23658. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23659. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23660. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23661. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23662. l.bindTexture(s.TEXTURE_2D, null)
  23663. }
  23664. ,
  23665. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23666. var s = this.renderer
  23667. , l = s.context
  23668. , c = s.state
  23669. , h = s.properties.get(t);
  23670. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23671. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23672. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23673. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23674. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23675. }
  23676. ,
  23677. h.prototype.rebuildMipMaps2D = function(e) {
  23678. var t = this.renderer
  23679. , i = t.context
  23680. , n = t.state;
  23681. t.properties.get(e),
  23682. i.generateMipmap(i.TEXTURE_2D),
  23683. n.bindTexture(i.TEXTURE_2D, null)
  23684. }
  23685. ,
  23686. h.prototype.rebuildMipMaps3D = function(e) {
  23687. var t = this.renderer
  23688. , i = t.context
  23689. , n = t.state
  23690. , r = t.properties.get(e);
  23691. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23692. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23693. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23694. }
  23695. ,
  23696. h.prototype.renderToCubeMap = (P = !1,
  23697. F = N = D = L = O = null,
  23698. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23699. this.renderer.context,
  23700. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23701. (O = new M.Scene).add(L),
  23702. D = new M.ShaderMaterial({
  23703. uniforms: {
  23704. tDiffuse: {
  23705. type: "t",
  23706. value: null
  23707. },
  23708. alpha: {
  23709. type: "f",
  23710. value: 1
  23711. }
  23712. },
  23713. vertexShader: R.basicTextured.vertexShader,
  23714. fragmentShader: R.basicTextured.fragmentShader,
  23715. depthWrite: !1,
  23716. depthTest: !1,
  23717. side: M.DoubleSide
  23718. }),
  23719. N = new M.PlaneBufferGeometry(1,1),
  23720. (F = new M.Mesh(N,D)).position.z = 0,
  23721. O.add(F),
  23722. P = !0);
  23723. var m = N.getAttribute("uv");
  23724. m.setDynamic(!0),
  23725. m.needsUpdate = !0;
  23726. var v = m.array
  23727. , y = r / i
  23728. , A = o / n
  23729. , C = a / i
  23730. , I = s / n;
  23731. v[0] = y,
  23732. v[1] = A + I,
  23733. v[2] = y + C,
  23734. v[3] = A + I,
  23735. v[4] = y,
  23736. v[5] = A,
  23737. v[6] = y + C,
  23738. v[7] = A;
  23739. var E = N.getAttribute("position");
  23740. E.setDynamic(!0),
  23741. E.needsUpdate = !0;
  23742. var _ = E.array
  23743. , b = l / t.width - .5
  23744. , w = c / t.height - .5
  23745. , T = h / t.width
  23746. , x = u / t.height;
  23747. _[0] = b,
  23748. _[1] = w + x,
  23749. _[3] = b + T,
  23750. _[4] = w + x,
  23751. _[6] = b,
  23752. _[7] = w,
  23753. _[9] = b + T,
  23754. _[10] = w,
  23755. this.renderer.properties.get(e),
  23756. D.uniforms.tDiffuse.value = e,
  23757. D.blending = p || M.NoBlending,
  23758. D.transparent = !!f,
  23759. null != g || (g = 1),
  23760. D.uniforms.alpha.value = g,
  23761. D.needUpdate = !0,
  23762. t.activeCubeFace = d,
  23763. t.viewport.set(0, 0, t.width, t.height);
  23764. var S = this.renderer.autoClear;
  23765. this.renderer.autoClear = !1,
  23766. this.renderer.render(O, L, t, !1),
  23767. this.renderer.autoClear = S
  23768. }
  23769. ),
  23770. h.prototype.copyCubeMap = (g = !1,
  23771. C = A = y = v = m = null,
  23772. I = new M.Euler,
  23773. new M.Vector3,
  23774. function(e, t, i, n, r, o, a, s, l) {
  23775. this.renderer,
  23776. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23777. (m = new M.Scene).add(v),
  23778. y = new M.ShaderMaterial({
  23779. uniforms: {
  23780. tDiffuse: {
  23781. type: "t",
  23782. value: null
  23783. },
  23784. alpha: {
  23785. type: "f",
  23786. value: 1
  23787. }
  23788. },
  23789. vertexShader: R.copyCubeMap.vertexShader,
  23790. fragmentShader: R.copyCubeMap.fragmentShader,
  23791. depthWrite: !1,
  23792. depthTest: !1,
  23793. side: M.DoubleSide
  23794. }),
  23795. A = new M.BoxGeometry(2,2,2),
  23796. C = new M.Mesh(A,y),
  23797. m.add(C),
  23798. g = !0);
  23799. for (var c = 0; c < 6; c++)
  23800. h.getCubeOrientationForCubeFace(c, I),
  23801. C.rotation.copy(I),
  23802. C.matrixWorldNeedsUpdate = !0,
  23803. C.updateMatrixWorld(),
  23804. y.uniforms.tDiffuse.value = e,
  23805. y.blending = a || M.NoBlending,
  23806. y.transparent = !!s,
  23807. null != l || (l = 1),
  23808. y.uniforms.alpha.value = l,
  23809. y.needUpdate = !0,
  23810. t.activeCubeFace = c,
  23811. t.viewport.set(0, 0, r, o),
  23812. this.renderer.render(m, v, t, !1)
  23813. }
  23814. ),
  23815. h.getLookAtForCubeFace = function(e, t) {
  23816. switch (e) {
  23817. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23818. t.set(1, 0, 0);
  23819. break;
  23820. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23821. t.set(-1, 0, 0);
  23822. break;
  23823. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23824. t.set(0, 1, 0);
  23825. break;
  23826. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23827. t.set(0, -1, 0);
  23828. break;
  23829. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23830. t.set(0, 0, 1);
  23831. break;
  23832. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23833. t.set(0, 0, -1)
  23834. }
  23835. }
  23836. ,
  23837. h.getCubeOrientationForCubeFace = function(e, t) {
  23838. switch (e) {
  23839. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23840. t.set(0, -Math.PI / 2, 0);
  23841. break;
  23842. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23843. t.set(0, Math.PI / 2, 0);
  23844. break;
  23845. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23846. t.set(Math.PI / 2, Math.PI, 0);
  23847. break;
  23848. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23849. t.set(-Math.PI / 2, Math.PI, 0);
  23850. break;
  23851. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23852. t.set(0, -Math.PI, 0);
  23853. break;
  23854. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23855. t.set(0, 0, 0)
  23856. }
  23857. }
  23858. ,
  23859. t.exports = h
  23860. }
  23861. , {
  23862. "../enum/GLCubeFaces": 25,
  23863. "../enum/GLTextureType": 26,
  23864. "../enum/SceneRendererEvents": 43,
  23865. "../exception/BasicException": 55,
  23866. "../exception/RendererCreationException": 57,
  23867. "../settings": 166,
  23868. "../shaders": 167,
  23869. "../util/browser": 182,
  23870. events: 202,
  23871. three: 217
  23872. }],
  23873. 159: [function(e, t, i) {
  23874. "use strict";
  23875. function n(e) {
  23876. this.messenger = new a(e),
  23877. this.clientKey = null
  23878. }
  23879. var o = e("../util/ajax")
  23880. , r = e("./PostMessageType")
  23881. , a = e("./postmessage")
  23882. , s = e("./VersionInfo")
  23883. , l = e("events").EventEmitter
  23884. , c = window.location.origin + "/api/v1/user/";
  23885. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23886. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23887. }
  23888. ,
  23889. n.prototype.waitForConnection = function() {
  23890. return new Promise(function(t, i) {
  23891. this.messenger.on(r.CONNECT, function(e) {
  23892. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23893. }
  23894. .bind(this))
  23895. }
  23896. .bind(this))
  23897. }
  23898. ,
  23899. n.prototype.onConnectionReceived = function(i) {
  23900. return this.messenger.setTarget(i.source, i.origin),
  23901. this.verifyConnection(i).then(function(e, t) {
  23902. this.messenger.send({
  23903. type: r.ACCEPT,
  23904. toId: i.fromId,
  23905. warning: t
  23906. }),
  23907. this.clientKey = e,
  23908. this.messenger.removeAllListeners(r.CONNECT),
  23909. this.bindEvents()
  23910. }
  23911. .bind(this), function(e) {
  23912. this.messenger.send({
  23913. type: r.REJECT,
  23914. toId: i.fromId,
  23915. reason: e
  23916. }),
  23917. this.messenger.setTarget()
  23918. }
  23919. .bind(this))
  23920. }
  23921. ,
  23922. n.prototype.verifyConnection = function(r) {
  23923. return new Promise(function(e, t) {
  23924. var i;
  23925. if (s.isDeprecated(r.sdkVersion))
  23926. i = "这个版本正在被弃用";
  23927. else if (!s.isSupported(r.sdkVersion))
  23928. return t("不支持此版本的SDK");
  23929. var n = {
  23930. cache: !1,
  23931. headers: {
  23932. "X-port-Application-Key": r.applicationKey,
  23933. "X-port-Referrer": r.origin
  23934. }
  23935. };
  23936. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23937. }
  23938. )
  23939. }
  23940. ,
  23941. n.prototype.onMessageReceived = function(t) {
  23942. if (this.validateClientApplicationKey(t.applicationKey)) {
  23943. var i = this;
  23944. t.onDone = function(e) {
  23945. e.toId = t.fromId,
  23946. e.uid = t.uid,
  23947. e.type = r.RESPONSE,
  23948. i.messenger.send(e)
  23949. }
  23950. ,
  23951. this.emit(r.ACTION, t)
  23952. }
  23953. }
  23954. ,
  23955. n.prototype.validateClientApplicationKey = function(e) {
  23956. return this.clientKey === e
  23957. }
  23958. ,
  23959. n.prototype.sendEvent = function(e, t) {
  23960. this.messenger.send({
  23961. type: r.EVENT,
  23962. eventType: e,
  23963. eventData: t
  23964. })
  23965. }
  23966. ,
  23967. t.exports = n
  23968. }
  23969. , {
  23970. "../util/ajax": 181,
  23971. "./PostMessageType": 160,
  23972. "./VersionInfo": 163,
  23973. "./postmessage": 165,
  23974. events: 202
  23975. }],
  23976. 160: [function(e, t, i) {
  23977. "use strict";
  23978. t.exports = Object.freeze({
  23979. CONNECT: "postmessage.connect",
  23980. ACCEPT: "postmessage.accept",
  23981. REJECT: "postmessage.reject",
  23982. ACTION: "postmessage.action",
  23983. RESPONSE: "postmessage.response",
  23984. EVENT: "postmessage.event"
  23985. })
  23986. }
  23987. , {}],
  23988. 161: [function(e, t, i) {
  23989. "use strict";
  23990. t.exports = Object.freeze({
  23991. MOVE: "sdk.move",
  23992. ENTER_PANO: "sdk.enterpano",
  23993. MODEL_LOADED: "sdk.modelloaded"
  23994. })
  23995. }
  23996. , {}],
  23997. 162: [function(e, t, i) {
  23998. "use strict";
  23999. t.exports = Object.freeze({
  24000. FLY: "transition.fly",
  24001. FADEOUT: "transition.fade",
  24002. INSTANT: "transition.instant"
  24003. })
  24004. }
  24005. , {}],
  24006. 163: [function(e, t, i) {
  24007. "use strict";
  24008. t.exports = {
  24009. current: "1.0",
  24010. supported: ["1.0"],
  24011. deprecated: [],
  24012. isSupported: function(e) {
  24013. return -1 !== this.supported.indexOf(e)
  24014. },
  24015. isDeprecated: function(e) {
  24016. return -1 !== this.deprecated.indexOf(e)
  24017. },
  24018. isValid: function(e) {
  24019. return this.isSupported(e) || this.isDeprecated(e)
  24020. }
  24021. }
  24022. }
  24023. , {}],
  24024. 164: [function(q, X, e) {
  24025. (function(e) {
  24026. "use strict";
  24027. function r(e, t, i) {
  24028. e = e && e.toLowerCase().trim();
  24029. var n = new C.UP.clone
  24030. , r = Math.PI / 3
  24031. , o = Math.PI / 2;
  24032. switch (e) {
  24033. case "left":
  24034. i.copy(t),
  24035. i.applyAxisAngle(n, o);
  24036. break;
  24037. case "right":
  24038. i.copy(t),
  24039. i.applyAxisAngle(n, -o);
  24040. break;
  24041. case "forwardleft":
  24042. i.copy(t),
  24043. i.applyAxisAngle(n, r);
  24044. break;
  24045. case "forwardright":
  24046. i.copy(t),
  24047. i.applyAxisAngle(n, -r);
  24048. break;
  24049. case "forward":
  24050. default:
  24051. i.copy(t)
  24052. }
  24053. return i
  24054. }
  24055. function o(e, t) {
  24056. if (e) {
  24057. var i = {
  24058. pano: e,
  24059. lookAtPoint: null,
  24060. duration: null,
  24061. maxDistanceOverride: null,
  24062. skipWarpingCheck: !1
  24063. };
  24064. this.player.flyToPano(i, function() {
  24065. t && t({
  24066. success: !0,
  24067. message: "Transition complete."
  24068. })
  24069. })
  24070. } else
  24071. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24072. t && t({
  24073. success: !1,
  24074. error: "Unable to find pano."
  24075. })
  24076. }
  24077. function a(e, t) {
  24078. t.copy(C.FORWARD),
  24079. e.getDirection(t)
  24080. }
  24081. function c(i) {
  24082. return {
  24083. panos: i.panos.list.map(function(e) {
  24084. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24085. return {
  24086. uuid: e.id,
  24087. aligned: e.alignmentType === g.ALIGNED,
  24088. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24089. position: function(e) {
  24090. return e.alignmentType !== g.ALIGNED ? null : {
  24091. x: e.position.x,
  24092. y: e.position.y,
  24093. z: e.position.z
  24094. }
  24095. }(e),
  24096. rotation: function(e) {
  24097. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24098. return {
  24099. x: h.Math.radToDeg(t._x),
  24100. y: h.Math.radToDeg(t._y),
  24101. z: h.Math.radToDeg(t._z)
  24102. }
  24103. }(e),
  24104. thumbnail: t
  24105. }
  24106. })
  24107. }
  24108. }
  24109. 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"),
  24110. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  24111. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  24112. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  24113. N.angle = 0,
  24114. N.angleTravelled = 0,
  24115. N.playerDirection = new h.Vector3,
  24116. N.lastFacingDirection = new h.Vector3,
  24117. N.onDone = null,
  24118. N.player = null,
  24119. N.start = function(e, t, i, n) {
  24120. N.active = !0,
  24121. e && t && (t = 0),
  24122. N.angle = e || t,
  24123. N.xAngle = e,
  24124. N.yAngle = t,
  24125. N.angleTravelled = 0,
  24126. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24127. i.getDirection(N.playerDirection),
  24128. N.lastFacingDirection.copy(N.playerDirection),
  24129. N.projectVectors(),
  24130. N.onDone = n,
  24131. N.player = i,
  24132. N()
  24133. }
  24134. ,
  24135. N.projectVectors = function() {
  24136. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  24137. N.lastFacingDirection.projectOnPlane(C.UP))
  24138. }
  24139. ,
  24140. N), P = (i = new h.Vector3,
  24141. function(e) {
  24142. e ? (i.copy(e.position),
  24143. i.add(e.discPosition),
  24144. s.projectPositionToCanvas(i, this.player.camera, i),
  24145. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  24146. }
  24147. ), O = (l = new h.Vector3,
  24148. function(e) {
  24149. var t = this.player.getDirection();
  24150. l.copy(t);
  24151. var i = l.y;
  24152. l.y = 0,
  24153. l.normalize();
  24154. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  24155. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  24156. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24157. 0;
  24158. this.player.mode === I.DOLLHOUSE && (n = -n);
  24159. var r = function() {
  24160. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24161. }
  24162. .call(this) - .1
  24163. , o = function() {
  24164. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24165. }
  24166. .call(this) + .1
  24167. , a = n + e;
  24168. r < a ? a = r : a < o && (a = o);
  24169. var s = a - n;
  24170. return 0 < e && s < .01 && (s = 0),
  24171. e < 0 && -.01 < s && (s = 0),
  24172. s
  24173. }
  24174. ), L = (t = new h.Euler,
  24175. function(e) {
  24176. return t.setFromQuaternion(e.quaternion, "YXZ"),
  24177. {
  24178. position: {
  24179. x: e.position.x,
  24180. y: e.position.y,
  24181. z: e.position.z
  24182. },
  24183. rotation: {
  24184. x: h.Math.radToDeg(t.x),
  24185. y: h.Math.radToDeg(t.y),
  24186. z: 0
  24187. },
  24188. pano: e.currentPano ? e.currentPano.id : null,
  24189. mode: e.mode
  24190. }
  24191. }
  24192. ), D = null;
  24193. function N() {
  24194. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24195. N.player.getDirection(N.playerDirection),
  24196. N.projectVectors();
  24197. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24198. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24199. N.onDone && (0,
  24200. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24201. window.setTimeout(N, 4))
  24202. }
  24203. X.exports = {
  24204. init: function(e, t, i, n, r) {
  24205. Y.init(e, t, i, r),
  24206. D = new Promise(function(e, t) {
  24207. i.on(_.Ready, function() {
  24208. e()
  24209. })
  24210. }
  24211. .bind(this));
  24212. var o = new u(window)
  24213. , a = o.waitForConnection();
  24214. a.then(function(e) {
  24215. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24216. });
  24217. var s, l = (s = Date.now(),
  24218. function() {
  24219. if (!(Date.now() - s < 100)) {
  24220. var e = L(i);
  24221. o.sendEvent(b.MOVE, {
  24222. state: e
  24223. }),
  24224. s = Date.now()
  24225. }
  24226. }
  24227. );
  24228. i.on(_.Move, l),
  24229. i.on(_.ViewChanged, l),
  24230. n.on(p.ActiveModelChanged, function(e) {
  24231. function t(e) {
  24232. var t, i = e.newPano.id;
  24233. e.oldPano && (t = e.oldPano.id),
  24234. i !== t && o.sendEvent(b.ENTER_PANO, {
  24235. oldPano: t,
  24236. newPano: i
  24237. })
  24238. }
  24239. var i = e.model
  24240. , n = e.oldModel;
  24241. Y.model = i,
  24242. a.then(function() {
  24243. o.sendEvent(b.MODEL_LOADED, {
  24244. metadata: c(i)
  24245. })
  24246. }),
  24247. n && n.panos.forEach(function(e) {
  24248. e.removeEventListener("enter", t)
  24249. }),
  24250. i.panos.forEach(function(e) {
  24251. e.on("enter", t)
  24252. })
  24253. })
  24254. }
  24255. };
  24256. var F, B, V, k, U, H, z, G, W, j, Y = {
  24257. director: null,
  24258. player: null,
  24259. controls: null,
  24260. sceneRenderer: null,
  24261. model: null,
  24262. init: function(e, t, i, n) {
  24263. this.director = e,
  24264. this.player = i,
  24265. this.controls = t,
  24266. this.sceneRenderer = n
  24267. },
  24268. handleToObject: {},
  24269. objectToHandle: {},
  24270. handleCount: 0,
  24271. onMessageReceive: function(e) {
  24272. if (e) {
  24273. var t = e.targetFunction
  24274. , i = e.params
  24275. , n = e.onDone;
  24276. t && this[t] && this[t](i, n)
  24277. }
  24278. },
  24279. waitForInit: function(e, t) {
  24280. D.then(t.bind({
  24281. success: !0,
  24282. message: "Init complete."
  24283. }))
  24284. },
  24285. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24286. j = new h.Quaternion,
  24287. function(e, t) {
  24288. var i = e.pano
  24289. , n = e.rotation
  24290. , r = e.transition;
  24291. if (!this.model)
  24292. return t({
  24293. success: !1,
  24294. error: "The model has not been loaded yet"
  24295. });
  24296. var o = this.model.panos.get(i);
  24297. if (!o)
  24298. return t({
  24299. success: !1,
  24300. error: i + " does not exist in this model"
  24301. });
  24302. if (!n)
  24303. return t({
  24304. sucess: !1,
  24305. erorr: n + " is not a valid rotation"
  24306. });
  24307. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24308. console.log(n.z);
  24309. var a = {
  24310. success: !0,
  24311. message: i
  24312. };
  24313. if (r === v.FADEOUT)
  24314. j.setFromEuler(W),
  24315. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24316. else {
  24317. var s, l;
  24318. r === v.INSTANT && (l = s = 0);
  24319. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24320. this.player.flyToPano({
  24321. pano: o,
  24322. lookAtPoint: c,
  24323. duration: s,
  24324. aimDuration: l
  24325. }, t.bind(this, a))
  24326. }
  24327. }
  24328. ),
  24329. moveInDirection: function(e, t) {
  24330. var i = e.direction;
  24331. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24332. void (t && t({
  24333. success: !1,
  24334. error: "Invalid direction."
  24335. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24336. t(e ? {
  24337. success: !0,
  24338. message: "moved " + i
  24339. } : {
  24340. success: !1,
  24341. error: "Cannot move in direction: " + i
  24342. })
  24343. })
  24344. },
  24345. getPose: function(e, t) {
  24346. return this.player.camera.position,
  24347. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24348. t({
  24349. success: !0,
  24350. message: L(this.player)
  24351. })
  24352. },
  24353. takeScreenShot: (z = new h.PerspectiveCamera,
  24354. G = new h.WebGLRenderTarget,
  24355. function(e, t) {
  24356. if (!e.resolution)
  24357. return t({
  24358. success: !1,
  24359. error: "An invalid resolution was specified"
  24360. });
  24361. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24362. var i = this.sceneRenderer.renderer.getSize();
  24363. e.resolution.width = i.width,
  24364. e.resolution.height = i.height
  24365. }
  24366. z.layers.set(T.DEFAULT),
  24367. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24368. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24369. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24370. var n = e.resolution.width
  24371. , r = e.resolution.height
  24372. , o = n / r;
  24373. z.position.copy(this.sceneRenderer.camera.position),
  24374. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24375. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24376. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24377. G.setSize(n, r),
  24378. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24379. var a = new Uint8Array(n * r * 4);
  24380. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24381. var s = S.encode({
  24382. data: a,
  24383. width: n,
  24384. height: r,
  24385. heading: 180,
  24386. pitch: 0
  24387. }, {
  24388. quality: 75,
  24389. flipY: !0
  24390. });
  24391. t({
  24392. success: !0,
  24393. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24394. })
  24395. }
  24396. ),
  24397. findRankedPano: (U = new h.Vector3,
  24398. H = new h.Vector3,
  24399. function(e, t) {
  24400. a(this.player, H),
  24401. r(t, H, U);
  24402. var i = this.player.rankedPanoInDirection(e, U);
  24403. if (i) {
  24404. var n = this.objectToHandle[i.id];
  24405. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24406. this.handleToObject[n] = i),
  24407. n
  24408. }
  24409. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24410. -1
  24411. }
  24412. ),
  24413. findRankedtag: (V = new h.Vector3,
  24414. k = new h.Vector3,
  24415. function(e, t) {
  24416. a(this.player, k),
  24417. r(t, k, V);
  24418. var i = this.player.rankedtagInDirection(e, V);
  24419. if (i) {
  24420. var n = this.objectToHandle[i.sid];
  24421. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24422. this.handleToObject[n] = i),
  24423. n
  24424. }
  24425. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24426. -1
  24427. }
  24428. ),
  24429. clickNearesttag: function(e) {
  24430. this.clickRankedtag(0, e)
  24431. },
  24432. clickRankedtag: function(e, t) {
  24433. var i = function(e, t) {
  24434. var i = this.findRankedtag(e, t);
  24435. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24436. null)
  24437. }
  24438. .call(this, e, t);
  24439. i && P.call(this, i)
  24440. },
  24441. clickNearestPano: function(e, t) {
  24442. this.clickRankedPano(0, e, t)
  24443. },
  24444. clickRankedPano: function(e, t, i) {
  24445. var n = function(e, t) {
  24446. var i = this.findRankedPano(e, t);
  24447. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24448. null)
  24449. }
  24450. .call(this, e, t);
  24451. n ? o.call(this, n, i) : i(null)
  24452. },
  24453. clickPano: function(e, t) {
  24454. var i = this.handleTable[e];
  24455. i ? o.call(this, i, t) : t(null)
  24456. },
  24457. rotateDirection: function(e, t) {
  24458. var i = e.direction
  24459. , n = e.angle;
  24460. if (!R.active) {
  24461. var r = 0
  24462. , o = 0
  24463. , a = 0
  24464. , s = 0;
  24465. if (!n || isNaN(n))
  24466. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24467. void (t && t({
  24468. success: !1,
  24469. error: "Invalid rotation angle."
  24470. }));
  24471. if (this.player.mode === I.TRANSITIONING)
  24472. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24473. void (t && t({
  24474. success: !1,
  24475. error: "Cannot rotate while transitioning"
  24476. }));
  24477. if (i === m.RIGHT || i === m.LEFT)
  24478. i === m.RIGHT && (n = -n),
  24479. r = 0 < n ? -1 : 1,
  24480. a = n;
  24481. else {
  24482. if (i !== m.UP && i !== m.DOWN)
  24483. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24484. void (t && t({
  24485. success: !1,
  24486. error: "Invalid direction for rotation."
  24487. }));
  24488. if (this.player.mode === I.FLOORPLAN)
  24489. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24490. void (t && t({
  24491. success: !1,
  24492. error: "Cannot rotate " + i + " in floorplan mode"
  24493. }));
  24494. if (i === m.DOWN && (n = -n),
  24495. 0 === (n = O.call(this, n)))
  24496. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24497. void (t && t({
  24498. success: !1,
  24499. error: "Already at maximum rotation in direction: " + i
  24500. }));
  24501. o = 0 < n ? 1 : -1,
  24502. s = n
  24503. }
  24504. var l = n;
  24505. n = h.Math.degToRad(n),
  24506. a = h.Math.degToRad(a),
  24507. s = h.Math.degToRad(s);
  24508. var c = this.controls.activeControl;
  24509. c.startRotating(r, o),
  24510. R.start(a, s, this.player, function() {
  24511. c.stopRotating(!0),
  24512. t && t({
  24513. success: !0,
  24514. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24515. })
  24516. })
  24517. }
  24518. },
  24519. rotate: (F = new h.Vector3,
  24520. B = new h.Vector3,
  24521. function(e, t) {
  24522. var i = e.xAngle
  24523. , n = e.yAngle;
  24524. if (!R.active) {
  24525. if (i = i || 0,
  24526. n = n || 0,
  24527. isNaN(i) || isNaN(n))
  24528. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24529. void (t && t({
  24530. success: !1,
  24531. error: "Invalid rotation angle."
  24532. }));
  24533. if (this.player.mode === I.TRANSITIONING)
  24534. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24535. void (t && t({
  24536. success: !1,
  24537. error: "Cannot rotate while transitioning"
  24538. }));
  24539. Math.abs(i) < .01 && (i = 0),
  24540. Math.abs(n) < .01 && (n = 0);
  24541. var r = n;
  24542. n = O.call(this, n);
  24543. var o = 0 < r ? "UP" : "DOWN";
  24544. if (!(i = -i) && r && !n)
  24545. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24546. void (t && t({
  24547. success: !1,
  24548. error: "Already at maximum rotation in direction: " + o
  24549. }));
  24550. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24551. var a = n;
  24552. n = h.Math.degToRad(n),
  24553. i = h.Math.degToRad(i),
  24554. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24555. this.player.getDirection(F),
  24556. B.copy(F).applyAxisAngle(C.UP, i),
  24557. B.applyAxisAngle(C.RIGHT, n);
  24558. var s = (F.angleTo(B),
  24559. 0 < i ? -1 : i < 0 ? 1 : 0)
  24560. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24561. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24562. var c = this.controls.activeControl;
  24563. c.startRotating(s, l),
  24564. R.start(i, n, this.player, function() {
  24565. c.stopRotating(!0),
  24566. t && t({
  24567. success: !0,
  24568. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24569. })
  24570. })
  24571. }
  24572. }
  24573. ),
  24574. panCamera: function(e, i) {
  24575. function t(e) {
  24576. switch (r.removeAllListeners(w.AutoPanComplete),
  24577. r.removeAllListeners(w.AutoPanInterrupt),
  24578. r.removeAllListeners(w.AutoPanClamped),
  24579. e) {
  24580. case w.AutoPanInterrupt:
  24581. i({
  24582. success: !0,
  24583. message: "Camera panning interrupted."
  24584. });
  24585. break;
  24586. case w.AutoPanClamped:
  24587. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24588. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24589. return void i({
  24590. success: !1,
  24591. error: "Already at edge of current model bounds."
  24592. });
  24593. var t = "The view point is outside the bounds for the current model. ";
  24594. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24595. console.warn(t)
  24596. }
  24597. case w.AutoPanComplete:
  24598. i({
  24599. success: !0,
  24600. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24601. })
  24602. }
  24603. }
  24604. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24605. return i({
  24606. success: !1,
  24607. error: "Camera panning is not available in the current mode: " + this.player.mode
  24608. });
  24609. var n = e.position
  24610. , r = this.player.control;
  24611. r.setAutoPanPosition(n.x, n.z),
  24612. r.autoPan = !0;
  24613. var o = function(e, t) {
  24614. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24615. };
  24616. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24617. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24618. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24619. },
  24620. click: function(e, t) {
  24621. var i = e.x
  24622. , n = e.y;
  24623. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24624. n = n / 100 * $("#player").height()),
  24625. this.player.handleInputStart(i, n),
  24626. this.player.updateIntersect(),
  24627. this.player.handleInputEnd(i, n)
  24628. },
  24629. mouseOver: function(e, t) {
  24630. var i = e.x
  24631. , n = e.y;
  24632. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24633. n = n / 100 * $("#player").height()),
  24634. this.player.handleInputMove(i, n),
  24635. this.player.updateIntersect()
  24636. },
  24637. moveToMode: function(e, t) {
  24638. function i(e) {
  24639. t(e ? {
  24640. success: !1,
  24641. error: "Failed to load new mode: " + e
  24642. } : {
  24643. success: !0,
  24644. message: "Moved to new mode: " + n
  24645. })
  24646. }
  24647. var n = e.mode;
  24648. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24649. i()
  24650. }, function(e) {
  24651. i(e)
  24652. }) : t({
  24653. success: !1,
  24654. error: "Invalid mode selection"
  24655. })
  24656. }
  24657. }
  24658. }
  24659. ).call(this, "/js/sdk/automation.js")
  24660. }
  24661. , {
  24662. "../constants": 8,
  24663. "../enum/AlignmentType": 17,
  24664. "../enum/ControlEvents": 21,
  24665. "../enum/Direction": 22,
  24666. "../enum/GLCubeFaces": 25,
  24667. "../enum/Keys": 30,
  24668. "../enum/ModelManagerEvents": 33,
  24669. "../enum/PlayerEvents": 40,
  24670. "../enum/RenderLayers": 41,
  24671. "../enum/Vectors": 50,
  24672. "../enum/Viewmode": 51,
  24673. "../enum/WarpStyle": 52,
  24674. "../lib/jpeg_encoder": 94,
  24675. "../sdk/SdkEvents": 161,
  24676. "../settings": 166,
  24677. "../util/common": 185,
  24678. "../util/logger": 189,
  24679. "../util/math": 190,
  24680. "../util/panorama": 191,
  24681. "./ApiHost": 159,
  24682. "./PostMessageType": 160,
  24683. "./TransitionStyles": 162,
  24684. three: 217
  24685. }],
  24686. 165: [function(e, t, i) {
  24687. "use strict";
  24688. function n(e) {
  24689. this.sourceWindow = e,
  24690. this.targetWindow = null,
  24691. this.targetOrigin = null,
  24692. this.id = Math.floor(1e5 * Math.random()),
  24693. this.bindEvents()
  24694. }
  24695. var r = e("./PostMessageType")
  24696. , o = e("events").EventEmitter;
  24697. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24698. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24699. }
  24700. ,
  24701. n.prototype.setTarget = function(e, t) {
  24702. this.targetWindow = e,
  24703. this.targetOrigin = t
  24704. }
  24705. ,
  24706. n.prototype.onPostmessageReceived = function(e) {
  24707. var t = e.origin || e.originalEvent.origin
  24708. , i = e.source;
  24709. switch (e.data.type) {
  24710. case r.CONNECT:
  24711. break;
  24712. case r.RESPONSE:
  24713. if (this.id !== e.data.toId)
  24714. return;
  24715. default:
  24716. if (!this.validateMessageOrigin(t))
  24717. return
  24718. }
  24719. var n = e.data;
  24720. n.source = i,
  24721. n.origin = t,
  24722. n.timestamp = Date.now(),
  24723. this.emit(e.data.type, n)
  24724. }
  24725. ,
  24726. n.prototype.validateMessageOrigin = function(e) {
  24727. return "*" === this.targetOrigin || e === this.targetOrigin
  24728. }
  24729. ,
  24730. n.prototype.send = function(e) {
  24731. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24732. this.targetWindow.postMessage(e, this.targetOrigin))
  24733. }
  24734. ,
  24735. t.exports = n
  24736. }
  24737. , {
  24738. "./PostMessageType": 160,
  24739. events: 202
  24740. }],
  24741. 166: [function(e, t, i) {
  24742. "use strict";
  24743. var n = e("three")
  24744. , r = e("./util/browser")
  24745. , o = e("./enum/Viewmode")
  24746. , a = e("./enum/VROption")
  24747. , s = e("./enum/Colors")
  24748. , l = e("./enum/WarpStyle")
  24749. , c = e("./util/easing")
  24750. , h = e("./util/common")
  24751. , u = e("./util/showcase")
  24752. , d = e("./constants")
  24753. , p = {
  24754. debug: !1,
  24755. version: "2.25.6-0-gd87e5b1",
  24756. languageTag: r.valueFromHash("lang", null),
  24757. pageTitle: "四维虚拟漫游",
  24758. authorizationHeader: u.getAuthorizationHeader(),
  24759. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24760. logLevel: r.valueFromHash("log", 2),
  24761. skyboxRadius: 2500,
  24762. modelBoundsPadding: 5,
  24763. showNeighbors: !1,
  24764. brand: r.valueFromHash("brand", !0),
  24765. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24766. startHighlights: r.valueFromHash("hl", -1),
  24767. specialEdition: r.valueFromHash("bn", 0),
  24768. useWheel: r.valueFromHash("wh", !0),
  24769. crossOrigin: "anonymous",
  24770. fancierTransition: !1,
  24771. wireframe: !1,
  24772. skyboxWireframe: !1,
  24773. modelAlpha: 1,
  24774. highlightPanoSelection: !1,
  24775. showSweeps: !0,
  24776. showSkyboxes: !1,
  24777. showMesh: !0,
  24778. showFloors: !1,
  24779. showFloorDuration: 300,
  24780. showFloorDelay: 300,
  24781. hideFloorDuration: 300,
  24782. hideFloorDelay: 0,
  24783. reticuleOpacityTransitionTime: 250,
  24784. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24785. markerOpacityTransitionTime: 500,
  24786. guiAnimationSpeed: 250,
  24787. highlightAnimationDuration: 500,
  24788. modelComponentLoadSpinnerDelay: 150,
  24789. captureErrors: !1,
  24790. maxMobileTextures: 6,
  24791. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24792. startupFlyinDelay: 3e3,
  24793. dollhouseDefault: {
  24794. minDistance: 1,//15, //编辑页面给近一些
  24795. maxDistance: 50,
  24796. minPolarAngle: n.Math.degToRad(10),
  24797. maxPolarAngle: n.Math.degToRad(90)
  24798. },
  24799. hideReticuleTimeout: 1e3,
  24800. analytics: {
  24801. inactivityThreshold: 30,
  24802. sessionTrackingRate: .15,
  24803. maxTrackedErrors: 20,
  24804. sessionDurationPingFrequency: 10,
  24805. sessionDurationTimeout: 15
  24806. },
  24807. flydown: {
  24808. movementEasing: "easeInOutQuad",
  24809. movementDelay: .001,
  24810. rotationEasing: "easeInOutQuad",
  24811. rotationDelay: .5,
  24812. modelTextureDelay: .75,
  24813. skyboxDelay: .75
  24814. },
  24815. transition: {
  24816. flySpeed: .001,
  24817. flyTime: 750,
  24818. flytimeMaxDistanceThreshold: 5,
  24819. flytimeDistanceMultiplier: 150,
  24820. aimTime: 1500,
  24821. aimSlowFactor: 1.5,
  24822. blur: .8,
  24823. movementEasing: "easeInOutQuad",
  24824. blendEasing: "easeInOutQuad",
  24825. fastForwardFactor: 4
  24826. },
  24827. show360Views: {
  24828. enabled: !0,
  24829. transitionTime: 1e3
  24830. },
  24831. quickstart: {
  24832. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24833. animation: 1400,
  24834. showTextDelay: 500,
  24835. fadeOutDelay: 3e3,
  24836. fovChange: 10
  24837. },
  24838. appConfig: {
  24839. webvr_version: null,
  24840. segment_key: null,
  24841. embedly_key: null,
  24842. branch_key: null,
  24843. keen_write_key: null,
  24844. keen_project_id: null
  24845. },
  24846. vr: {
  24847. enabled: !0,
  24848. allowWebVR: !1,
  24849. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24850. },
  24851. share: {
  24852. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24853. },
  24854. input: {
  24855. longTapThreshold: 200,
  24856. moveToleranceNDC: 0.01,//.08,
  24857. touchMoveThreshold: 25
  24858. },
  24859. help: {
  24860. modalStayDuration: 600
  24861. },
  24862. immersive: {
  24863. timeToShowAgain: 1250,
  24864. uiStayDuration: 600
  24865. },
  24866. tourInteraction: {
  24867. disabled: "0" === r.valueFromHash("tourcta", null),
  24868. showPauseButton: 1e3,
  24869. showModal: 1500,
  24870. allowNextClick: 200,
  24871. largeModal: "1" === r.valueFromHash("tourcta", null),
  24872. smallModal: "2" === r.valueFromHash("tourcta", null)
  24873. },
  24874. labels: {
  24875. enabled: !1,
  24876. hideUntilStart: !0,
  24877. fadeInDuration: 250,
  24878. fadeInDelay: 250,
  24879. fadeOutDuration: 250,
  24880. fadeOutDelay: 0,
  24881. zoomHideThreshhold: {
  24882. mobile: r.isSmallScreen() ? .45 : .6,
  24883. desktop: 2
  24884. },
  24885. zoomTruncateThreshhold: {
  24886. mobile: r.isSmallScreen() ? .35 : .45,
  24887. desktop: .85
  24888. },
  24889. minLengthForTruncate: 16,
  24890. truncateLength: 12,
  24891. truncateSuffix: "..."
  24892. },
  24893. tags: {
  24894. enabled: r.valueFromHash("mt", 1),
  24895. startup: {
  24896. hideUntilStart: !0,
  24897. fadeInDuration: 500,
  24898. fadeInDelay: 100
  24899. },
  24900. visibility: {
  24901. anyDistance: !0,
  24902. visibleDistance: 8,
  24903. cameraClearance: .1,
  24904. alphaTestLevel: .05,
  24905. hideViaFloor: !0,
  24906. hideOffScreenDisc: !1,
  24907. hideOffScreenObject: !1
  24908. },
  24909. disc: {
  24910. opacity: 1,
  24911. disabledOpacity: .5,
  24912. scale: {
  24913. nearBound: 1.5,
  24914. farBound: 4.8,
  24915. linkFarBound: !1,
  24916. linkPercent: 40,
  24917. maxSize: 80,
  24918. minSize: 40,
  24919. baseViewportSize: 800,
  24920. responsiveness: 100
  24921. }
  24922. },
  24923. pole: {
  24924. enabled: !0,
  24925. height: .5,
  24926. width: 2,
  24927. opacity: .5,
  24928. color: "white"
  24929. },
  24930. navigate: {
  24931. nearestPano: !0,
  24932. lineOfSight: !0,
  24933. reactivate: !0,
  24934. aimAt: "disc",
  24935. tiltTolerance: 25,
  24936. rotateSpeedFactor: .6
  24937. }
  24938. },
  24939. path: {
  24940. color: window.DATA.floorMarkerColor || s.newBlue,
  24941. colorUp: s._desat(s.newBlue, .5),
  24942. colorDown: s._darken(s.newBlue, .35),
  24943. opacity: .5,
  24944. style: "ribbon",
  24945. height: .025,
  24946. ribbonWidth: .24,
  24947. outsideHeight: .5,
  24948. waypointRadius: .5,
  24949. waypointIndoorRadius: .24,
  24950. waypointPulse: 1e3,
  24951. typ: l.BLACK,
  24952. meshFree: r.valueFromHash("mf", 1),
  24953. mapGuides: r.valueFromHash("guides", !0),
  24954. fadeInTime: 400,
  24955. fadeOutTime: 300
  24956. },
  24957. warp: {
  24958. nearPanoDist: .1,
  24959. matchCam: !1,
  24960. blur: .33,
  24961. fastTime: 1500,
  24962. teleportTime: 1500,//瞬间过渡的时间
  24963. flytimeDistanceMultiplier:150,//add
  24964. flyTime:750,//add
  24965. outsideTime: 2e3,
  24966. lookAheadMax: .3,
  24967. lookAheadDist: 2.5,
  24968. softPushDist: .37,
  24969. softPushEnd: .3,
  24970. softBendAngle: 8,
  24971. softBendTilt: 4,
  24972. softBendEnd: .3,
  24973. doBurns: !0,
  24974. burnsAngle: 8,
  24975. minBurnsAngle: 35,
  24976. minDownAngle: -35,
  24977. maxTurnPerSec: 280,
  24978. maxAimPerSec: 35,
  24979. minRotation: 12,
  24980. maxAimRotation: 33.2,
  24981. turnFriction: .2,
  24982. flySpeed: .01,
  24983. minWarpTime: 1200,
  24984. warpInterruptionRedirectTime: 500,
  24985. tourStepDelay: r.valueFromHash("st", 0),
  24986. walkDelay: 0,
  24987. walkMaxDist: 50,
  24988. walkMinDist: .8,
  24989. walkSlideShowThreshhold: 3e3,
  24990. walkExtraPanosDistance: .4,
  24991. timePerMeter: 1200,
  24992. motionLeadTime: 5e3,
  24993. movementEasing: "easeInOutQuad",
  24994. blendEasing: "easeInOutQuad",
  24995. showBunny: !1,
  24996. loop: r.valueFromHash("lp", !1),
  24997. auto: r.valueFromHash("ts", -1),
  24998. eOrder: "YXZ",
  24999. stepFactor: .25,
  25000. brakeStrength: 2,
  25001. minBrakeAngle: .1,
  25002. maxBrakeAngle: 1.8,
  25003. climbEffort: 4
  25004. },
  25005. rotationFriction: .05,
  25006. rotationAccelerationInside: 4.5,
  25007. rotationAccelerationOutside: .15,
  25008. rotationAfterMoveMultiplier: 40,
  25009. rotationAfterMoveHistoryCount: 5,
  25010. panFriction: .09,
  25011. panAccelerationOutside: 60,
  25012. onload: r.valueFromHash("onload", o.PANORAMA),
  25013. zoomNearLimit: .1,
  25014. zoomFarLimit: 50,
  25015. navigation: {
  25016. panoScores: !1,
  25017. mouseDirection: !0,
  25018. filterStrictness: .75,
  25019. angleFactor: -30,
  25020. directionFactor: 10,
  25021. distanceFactor: -1,
  25022. optionalityFactor: 3
  25023. },
  25024. sdkInit: !1,
  25025. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25026. console: r.valueFromHash("console", !1),
  25027. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25028. panoramaNeighbourMaxDistance: 5,
  25029. panoFloorClickRadius: .35,
  25030. showScreenshotLocations: !1,
  25031. showAxis: !1,
  25032. showNeighbourRaycasts: !1,
  25033. colorMarkerOnLoad: !1,
  25034. colorMarkerByFloor: !1,
  25035. tiling: {
  25036. panoPreRenderRepeatDelay: 2500,
  25037. panoPreRenderDelay: 500,
  25038. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25039. tilingFlagNames: ["usetiles", "tiles"],
  25040. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25041. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25042. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25043. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25044. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25045. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25046. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25047. customCompression: r.valueFromHash("tilecustcomp", 0),
  25048. mobileHighQualityOverride: 1,
  25049. allowUltraHighResolution: !0
  25050. },
  25051. zoom: {
  25052. enabled: !0,
  25053. forceOff: r.valueFromHash("nozoom", 0),
  25054. overridemax: r.valueFromHash("maxzoom", null),
  25055. overridemin: r.valueFromHash("minzoom", null),
  25056. max: d.highQualityMaxZoom,
  25057. min: 1,
  25058. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25059. activationThreshold: 1.1,
  25060. restoreTime: 500
  25061. },
  25062. profiling: {
  25063. enabled: r.valueFromHash("mem", !1)
  25064. }
  25065. };
  25066. (p = h.deepExtend(p, d, {
  25067. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25068. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25069. panorama: {
  25070. transitionTime: 1e3,
  25071. modelAlpha: 0,
  25072. modelAlphaDelay: p.flydown.modelTextureDelay,
  25073. modelAlphaLength: 1,
  25074. skyboxOpacity: 1,
  25075. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25076. skyboxOpacityLength: .9,
  25077. fovLength: 1,
  25078. fovDelay: 0,
  25079. cameraMatrixDuration: .8,
  25080. cameraMatrixDelay: 0,
  25081. cameraMatrixEase: c.easeInCubic,
  25082. reticuleOpacity: 1,
  25083. markerOpacity: .3,
  25084. markerOpacityOnHover: 1
  25085. },
  25086. dollhouse: {
  25087. transitionTime: 1e3,
  25088. modelAlpha: 1,
  25089. modelAlphaDelay: 0,
  25090. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25091. skyboxOpacity: 0,
  25092. skyboxOpacityDelay: 0,
  25093. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25094. fovLength: 1,
  25095. fovDelay: 0,
  25096. cameraMatrixDuration: .8,
  25097. cameraMatrixDelay: .3,
  25098. cameraMatrixEase: c.easeInCubic,
  25099. reticuleOpacity: 1,
  25100. markerOpacity: 0,
  25101. markerOpacityOnHover: 0
  25102. },
  25103. floorplan: {
  25104. transitionTime: 1e3,
  25105. modelAlpha: 1,
  25106. modelAlphaDelay: 0,
  25107. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25108. skyboxOpacity: 0,
  25109. skyboxOpacityDelay: 0,
  25110. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25111. fovLength: 1,
  25112. fovDelay: 0,
  25113. cameraMatrixDuration: .5,
  25114. cameraMatrixDelay: 0,
  25115. cameraMatrixEase: c.easeOutCubic,
  25116. reticuleOpacity: 1,
  25117. markerOpacity: 0,
  25118. markerOpacityOnHover: 0,
  25119. cameraHeight: 50
  25120. },
  25121. transitioning: {
  25122. reticuleOpacity: 0,
  25123. markerOpacity: .3,
  25124. markerOpacityOnHover: 1
  25125. },
  25126. "floorplan-dollhouse": {
  25127. rotationDelay: 0,
  25128. rotationDuration: 1
  25129. },
  25130. "floorplan-panorama": {
  25131. rotationDelay: .5,
  25132. rotationDuration: 1
  25133. },
  25134. "dollhouse-panorama": {
  25135. rotationDelay: .5,
  25136. rotationDuration: 1
  25137. },
  25138. "dollhouse-floorplan": {
  25139. rotationDelay: 0,
  25140. rotationDuration: 1,
  25141. cameraMatrixDuration: 1.05,
  25142. cameraMatrixDelay: .5
  25143. },
  25144. "panorama-dollhouse": {
  25145. rotationDelay: 0,
  25146. rotationDuration: .5
  25147. },
  25148. "panorama-floorplan": {
  25149. transitionTime: 1500,
  25150. rotationDelay: 0,
  25151. rotationDuration: .5
  25152. }
  25153. })).path.meshFree && (p.path.typ = l.WALK),
  25154. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25155. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25156. window._settings = t.exports = p
  25157. }
  25158. , {
  25159. "./constants": 8,
  25160. "./enum/Colors": 19,
  25161. "./enum/VROption": 47,
  25162. "./enum/Viewmode": 51,
  25163. "./enum/WarpStyle": 52,
  25164. "./util/browser": 182,
  25165. "./util/common": 185,
  25166. "./util/easing": 186,
  25167. "./util/showcase": 193,
  25168. three: 217
  25169. }],
  25170. 167: [function(e, t, i) {
  25171. "use strict";
  25172. var n = e("three")
  25173. , r = e("./settings")
  25174. , 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"
  25175. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25176. t.exports = {
  25177. basicTextured: {
  25178. uniforms: {
  25179. tDiffuse: {
  25180. type: "t",
  25181. value: null
  25182. },
  25183. alpha: {
  25184. type: "f",
  25185. value: 1
  25186. }
  25187. },
  25188. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25189. 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}"
  25190. },
  25191. copyCubeMap: {
  25192. uniforms: {
  25193. tDiffuse: {
  25194. type: "t",
  25195. value: null
  25196. },
  25197. alpha: {
  25198. type: "f",
  25199. value: 1
  25200. }
  25201. },
  25202. 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}",
  25203. 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}"
  25204. },
  25205. cube: {
  25206. uniforms: {
  25207. map: {
  25208. type: "t",
  25209. value: null
  25210. },
  25211. opacity: {
  25212. type: "f",
  25213. value: 1
  25214. }
  25215. },
  25216. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25217. 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"
  25218. },
  25219. model: {
  25220. uniforms: {
  25221. map: {
  25222. type: "t",
  25223. value: null
  25224. },
  25225. modelAlpha: {
  25226. type: "f",
  25227. value: r.modelAlpha
  25228. },
  25229. opacity: {
  25230. type: "f",
  25231. value: 1
  25232. },
  25233. progress: {
  25234. type: "f",
  25235. value: 0
  25236. },
  25237. blackout: {
  25238. type: "i",
  25239. value: 0
  25240. },
  25241. pano0Map: {
  25242. type: "t",
  25243. value: null
  25244. },
  25245. pano0Position: {
  25246. type: "v3",
  25247. value: new n.Vector3
  25248. },
  25249. pano0Matrix: {
  25250. type: "m4",
  25251. value: new n.Matrix4
  25252. },
  25253. pano1Map: {
  25254. type: "t",
  25255. value: null
  25256. },
  25257. pano1Position: {
  25258. type: "v3",
  25259. value: new n.Vector3
  25260. },
  25261. pano1Matrix: {
  25262. type: "m4",
  25263. value: new n.Matrix4
  25264. }
  25265. },
  25266. /* 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",
  25267. 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"
  25268. */
  25269. vertexShader: o + `uniform vec3 pano0Position;
  25270. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  25271. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  25272. varying vec3 vWorldPosition0;
  25273. varying vec3 vWorldPosition1;
  25274. uniform int blackout;
  25275. void main() {
  25276. vUv = uv;
  25277. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  25278. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  25279. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  25280. vWorldPosition0.x *= -1.0;
  25281. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  25282. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  25283. vWorldPosition1.x *= -1.0;
  25284. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  25285. }`,
  25286. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  25287. uniform 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\n
  25288. void main() {
  25289. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  25290. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  25291. vec4 colorFromPanos;
  25292. if (blackout == 5){//add for TransitionPass
  25293. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  25294. }else{
  25295. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  25296. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  25297. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  25298. else if (blackout == 1) {
  25299. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  25300. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  25301. }
  25302. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  25303. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  25304. }
  25305. vec4 colorFromTexture = texture2D( map, vUv );
  25306. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  25307. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  25308. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  25309. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  25310. }`
  25311. },
  25312. hot: {
  25313. uniforms: {
  25314. color: {
  25315. type: "c",
  25316. value: new n.Color(16720384)
  25317. },
  25318. opac: {
  25319. type: "f",
  25320. value: 0
  25321. },
  25322. texture1: {
  25323. type: "t",
  25324. value: null
  25325. },
  25326. texture2: {
  25327. type: "t",
  25328. value: null
  25329. }
  25330. },
  25331. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25332. 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"
  25333. },
  25334. modelOutside: {
  25335. uniforms: {
  25336. map: {
  25337. type: "t",
  25338. value: null
  25339. },
  25340. opacity: {
  25341. type: "f",
  25342. value: 1
  25343. }
  25344. },
  25345. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25346. 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"
  25347. },
  25348. ribbon: {
  25349. uniforms: {
  25350. map: {
  25351. type: "t",
  25352. value: null
  25353. },
  25354. opacity: {
  25355. type: "f",
  25356. value: 1
  25357. },
  25358. color: {
  25359. type: "c",
  25360. value: new n.Color(r.path.color)
  25361. }
  25362. },
  25363. 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",
  25364. 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"
  25365. },
  25366. waypoint: {
  25367. uniforms: {
  25368. map: {
  25369. type: "t",
  25370. value: null
  25371. },
  25372. opacity: {
  25373. type: "f",
  25374. value: 1
  25375. },
  25376. pulse: {
  25377. type: "f",
  25378. value: 1
  25379. },
  25380. nearFade: {
  25381. type: "v2",
  25382. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25383. },
  25384. color: {
  25385. type: "c",
  25386. value: new n.Color(r.reticuleColor)
  25387. }
  25388. },
  25389. 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",
  25390. 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"
  25391. },
  25392. modelDebug: {
  25393. uniforms: {
  25394. map: {
  25395. type: "t",
  25396. value: null
  25397. },
  25398. modelAlpha: {
  25399. type: "f",
  25400. value: r.modelAlpha
  25401. },
  25402. depthmapRatio: {
  25403. type: "f",
  25404. value: 0
  25405. },
  25406. opacity: {
  25407. type: "f",
  25408. value: 1
  25409. },
  25410. progress: {
  25411. type: "f",
  25412. value: 0
  25413. },
  25414. considerOcclusion: {
  25415. type: "i",
  25416. value: r.fancierTransition
  25417. },
  25418. highlightPanoSelection: {
  25419. type: "i",
  25420. value: 0
  25421. },
  25422. useThirdPano: {
  25423. type: "i",
  25424. value: r.useThirdPano
  25425. },
  25426. pano0Map: {
  25427. type: "t",
  25428. value: null
  25429. },
  25430. pano0Depth: {
  25431. type: "t",
  25432. value: null
  25433. },
  25434. pano0Position: {
  25435. type: "v3",
  25436. value: new n.Vector3
  25437. },
  25438. pano0Matrix: {
  25439. type: "m4",
  25440. value: new n.Matrix4
  25441. },
  25442. pano0Weight: {
  25443. type: "f",
  25444. value: r.transition.pano0Weight
  25445. },
  25446. pano1Map: {
  25447. type: "t",
  25448. value: null
  25449. },
  25450. pano1Depth: {
  25451. type: "t",
  25452. value: null
  25453. },
  25454. pano1Position: {
  25455. type: "v3",
  25456. value: new n.Vector3
  25457. },
  25458. pano1Matrix: {
  25459. type: "m4",
  25460. value: new n.Matrix4
  25461. },
  25462. pano1Weight: {
  25463. type: "f",
  25464. value: r.transition.pano1Weight
  25465. },
  25466. pano2Map: {
  25467. type: "t",
  25468. value: null
  25469. },
  25470. pano2Depth: {
  25471. type: "t",
  25472. value: null
  25473. },
  25474. pano2Position: {
  25475. type: "v3",
  25476. value: new n.Vector3
  25477. },
  25478. pano2Matrix: {
  25479. type: "m4",
  25480. value: new n.Matrix4
  25481. },
  25482. pano2Weight: {
  25483. type: "f",
  25484. value: r.transition.pano2Weight
  25485. }
  25486. },
  25487. 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",
  25488. 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"
  25489. },
  25490. customDepth: {
  25491. uniforms: {
  25492. panoPosition: {
  25493. type: "v3",
  25494. value: new n.Vector3
  25495. }
  25496. },
  25497. 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",
  25498. 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"
  25499. },
  25500. skysphere: {
  25501. uniforms: {
  25502. radius: {
  25503. type: "f",
  25504. value: 0
  25505. }
  25506. },
  25507. 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",
  25508. 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"
  25509. },
  25510. tagDisc: {
  25511. uniforms: {
  25512. opacity: {
  25513. type: "f",
  25514. value: 0
  25515. },
  25516. color: {
  25517. type: "c",
  25518. value: new n.Color
  25519. },
  25520. bg: {
  25521. type: "t",
  25522. value: null
  25523. },
  25524. mask: {
  25525. type: "t",
  25526. value: null
  25527. }
  25528. },
  25529. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25530. 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"
  25531. }
  25532. }
  25533. window.shaders = t.exports;
  25534. }
  25535. , {
  25536. "./settings": 166,
  25537. three: 217
  25538. }],
  25539. 168: [function(E, _, e) {
  25540. (function(e) {
  25541. "use strict";
  25542. var t = E("three")
  25543. , i = (E("url"),
  25544. E("./util/ajax"))
  25545. , n = E("./settings")
  25546. , r = E("./util/logger")
  25547. , o = E("./util/math")
  25548. , a = E("./util/showcase")
  25549. , s = E("./objects/Panorama")
  25550. , l = new r(e)
  25551. , c = E("./model/Model")
  25552. , h = E("./shaders")
  25553. , u = E("./util/transitions")
  25554. , d = E("./objects/Chunk")
  25555. , p = E("./objects/Reticule")
  25556. , f = E("./objects/Skybox")
  25557. , g = E("./objects/Floor")
  25558. , m = E("./cameras/DollhouseCamera")
  25559. , v = E("./cameras/FloorplanCamera")
  25560. , y = E("./cameras/PanoramaCamera")
  25561. , A = E("./controls/DollhouseControls")
  25562. , C = E("./controls/FloorplanControls")
  25563. , I = E("./controls/PanoramaControls");
  25564. t.ImageUtils.crossOrigin = n.crossOrigin,
  25565. _.exports = {
  25566. shaders: h,
  25567. transitions: u,
  25568. Model: c,
  25569. Chunk: d,
  25570. Floor: g,
  25571. Skybox: f,
  25572. Reticule: p,
  25573. Panorama: s,
  25574. DollhouseCamera: m,
  25575. FloorplanCamera: v,
  25576. PanoramaCamera: y,
  25577. DollhouseControls: A,
  25578. FloorplanControls: C,
  25579. PanoramaControls: I,
  25580. getModel: function(e) {
  25581. if (!e.url)
  25582. throw 'getModel(): missing parameter "url"';
  25583. e.autoload = void 0 === e.autoload || e.autoload;
  25584. var t = a.parseSidUrl(e.url);
  25585. e.urlBase = t.urlBase,
  25586. e.urlModel = /* 'data/1081/', */ t.urlModel,
  25587. e.urlFiles = t.urlFiles;
  25588. var i = this._getPlatformError();
  25589. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25590. this._loadModel().then(this._buildModel.bind(this)))
  25591. },
  25592. _getPlatformError: function() {
  25593. 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"
  25594. },
  25595. _loadModel: function() {
  25596. return i.get(this.options.urlModel, {
  25597. responseType: "json",
  25598. prefetchFrom: "model",
  25599. auth: a.getAuthorizationHeader()
  25600. }).then(null, function() {
  25601. return l.warn("Model loading failed at initial metadata load"),
  25602. "loading-failed"
  25603. })
  25604. },
  25605. _buildModel: function(e) {
  25606. e = a.normalizeModeldata(e, o);
  25607. var t = new c(this.options,e);
  25608. return this.options.autoload ? t.load(!0) : $.when(t)
  25609. }
  25610. }
  25611. }
  25612. ).call(this, "/js/showcase.js")
  25613. }
  25614. , {
  25615. "./cameras/DollhouseCamera": 5,
  25616. "./cameras/FloorplanCamera": 6,
  25617. "./cameras/PanoramaCamera": 7,
  25618. "./controls/DollhouseControls": 10,
  25619. "./controls/FloorplanControls": 11,
  25620. "./controls/PanoramaControls": 13,
  25621. "./model/Model": 139,
  25622. "./objects/Chunk": 144,
  25623. "./objects/Floor": 146,
  25624. "./objects/Panorama": 148,
  25625. "./objects/Reticule": 149,
  25626. "./objects/Skybox": 152,
  25627. "./settings": 166,
  25628. "./shaders": 167,
  25629. "./util/ajax": 181,
  25630. "./util/logger": 189,
  25631. "./util/math": 190,
  25632. "./util/showcase": 193,
  25633. "./util/transitions": 195,
  25634. three: 217,
  25635. url: 208
  25636. }],
  25637. 169: [function(e, t, i) {
  25638. "use strict";
  25639. function l(e) {
  25640. var t = {
  25641. renderTarget: null,
  25642. inUse: !1,
  25643. size: -1,
  25644. pano: null
  25645. };
  25646. return t.inUse = !0,
  25647. t.size = e,
  25648. function(e) {
  25649. O.push(e)
  25650. }(t),
  25651. t
  25652. }
  25653. function c(e) {
  25654. for (var t = 0; t < O.length; t++) {
  25655. var i = O[t];
  25656. if (i.renderTarget === e)
  25657. return !(i.inUse = !1)
  25658. }
  25659. return !1
  25660. }
  25661. function n() {
  25662. this.tileDirectory = {},
  25663. this.activeRenderTargetDescriptors = {},
  25664. this.activePanos = [],
  25665. this.panoLODDescriptors = {},
  25666. this.panoDescriptors = {},
  25667. this.tileTrees = {},
  25668. this.sceneRenderer = null,
  25669. this.tileDownloader = null,
  25670. this.forceQueue = [],
  25671. this.uploadQueues = {},
  25672. this.uploadInterval = null,
  25673. this.uploadIntervalCancelled = !1,
  25674. this.usingTileOverlay = !1,
  25675. this.overlayTilesLoaded = !1,
  25676. this.overlayTileBase = null,
  25677. this.overlayTilesBasic = {},
  25678. this.overlayTilesEnhanced = {},
  25679. this.zoomRenderTarget = null,
  25680. this.zoomPano = null,
  25681. this.zoomingActive = !1,
  25682. this.zoomPanoId = null,
  25683. this.zoomPanoRenderingDisabled = !1,
  25684. this.direction = new _.Vector3,
  25685. this.initTime = -1,
  25686. this.maxBaseUploadsPerFrame = R,
  25687. this.maxNonBaseUploadsPerFrame = M
  25688. }
  25689. 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"),
  25690. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25691. e("../objects/Panorama"),
  25692. e("./TileTree")), y = (e("./TileDownloader"),
  25693. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25694. e("../util/browser"),
  25695. 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 = {
  25696. Base: 0,
  25697. Remaining: 1
  25698. }, O = [];
  25699. function L(e) {
  25700. var t = e.shift();
  25701. return t.uploadQueued = !1,
  25702. t
  25703. }
  25704. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25705. this.sceneRenderer = e,
  25706. this.tileDownloader = t,
  25707. this.qualityManager = i,
  25708. this.bindEvents(),
  25709. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25710. this.initTime = performance.now()
  25711. }
  25712. ,
  25713. n.prototype.getActivePanoTextures = function(e) {
  25714. e = e || [];
  25715. for (var t = 0; t < O.length; t++) {
  25716. var i = O[t];
  25717. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25718. }
  25719. }
  25720. ,
  25721. n.prototype.hasQueuedTiles = function() {
  25722. var e = this.peekNextFromUploadQueue();
  25723. return null != e
  25724. }
  25725. ,
  25726. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25727. return this.activeRenderTargetDescriptors[e]
  25728. }
  25729. ,
  25730. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25731. this.activeRenderTargetDescriptors[e] = t
  25732. }
  25733. ,
  25734. n.prototype.loadOverlayTiles = function() {
  25735. if (0 !== d.tiling.overlayStyle) {
  25736. var n = 0
  25737. , e = function(e, t, i) {
  25738. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25739. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25740. ++n === r.length && (this.overlayTilesLoaded = !0)
  25741. }
  25742. .bind(this)
  25743. , 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)]];
  25744. r.forEach(function(e) {
  25745. this.tileDownloader.loadImage(e[0], 0, e[1])
  25746. }
  25747. .bind(this)),
  25748. this.usingTileOverlay = !0
  25749. } else
  25750. this.usingTileOverlay = !1
  25751. }
  25752. ,
  25753. n.prototype.bindEvents = function() {
  25754. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25755. }
  25756. ,
  25757. n.prototype.setupZoomRenderTarget = function() {
  25758. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25759. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25760. return;
  25761. var e = this.zoomRenderTarget;
  25762. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25763. e) {
  25764. var t = e.width
  25765. , i = this.zoomRenderTarget.width;
  25766. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25767. e.texture.dispose(),
  25768. e.texture.loaded = !1,
  25769. e.texture.version = 0,
  25770. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25771. e.texture = null
  25772. }
  25773. this.zoomPanoRenderingDisabled = !1
  25774. } else
  25775. this.zoomPanoRenderingDisabled = !0
  25776. }
  25777. ,
  25778. n.prototype.enableUltraHighQualityMode = function(t) {
  25779. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25780. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25781. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25782. e && (this.qualityManager.enableUltraHighQualityMode(),
  25783. this.setupZoomRenderTarget(),
  25784. t())
  25785. }
  25786. .bind(this))
  25787. }
  25788. }
  25789. ,
  25790. n.prototype.activateTiledPano = function(e, t, i) {
  25791. i && this.clearAllQueuedUploads();
  25792. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25793. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25794. this.linkAllTilesAndNodes(e);
  25795. var r = this.getActiveRenderTargetDescriptor(e.id)
  25796. , o = t;
  25797. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25798. !r || o !== r.size) {
  25799. if (r && c(r.renderTarget),
  25800. !(r = function(e) {
  25801. for (var t = 0; t < O.length; t++) {
  25802. var i = O[t];
  25803. if (!i.inUse && i.size === e)
  25804. return i.inUse = !0,
  25805. i
  25806. }
  25807. return null
  25808. }(o))) {
  25809. var a = this.initTiledPano(o, !1);
  25810. (r = l(a.width)).renderTarget = a
  25811. }
  25812. r.pano = e,
  25813. this.resetPanoDescriptor(e.id),
  25814. this.resetPanoLODDescriptors(e.id),
  25815. this.resetRenderStatus(e.id, !0, !0)
  25816. }
  25817. this.setActiveRenderTargetDescriptor(e.id, r);
  25818. var s = i ? 0 : 1;
  25819. return this.updateActivePanos(e, s),
  25820. r.renderTarget
  25821. }
  25822. ,
  25823. n.prototype.deactivateTiledPano = function(e) {
  25824. var t = this.getActiveRenderTargetDescriptor(e.id);
  25825. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25826. this.setActiveRenderTargetDescriptor(e.id, null);
  25827. var i = this.getUploadQueueForPano(e.id);
  25828. this.clearUploadQueue(i),
  25829. this.updateActivePanos()
  25830. }
  25831. ,
  25832. n.prototype.updateActivePanos = (s = [],
  25833. function(e, t) {
  25834. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25835. e && s.length === t && s.push(e);
  25836. var n = this.activePanos[i]
  25837. , r = this.getActiveRenderTargetDescriptor(n.id);
  25838. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25839. }
  25840. e && t >= s.length && s.push(e),
  25841. this.activePanos.length = 0,
  25842. this.activePanos.push.apply(this.activePanos, s)
  25843. }
  25844. ),
  25845. n.prototype.getActivePanoCount = function() {
  25846. return this.activePanos.length
  25847. }
  25848. ,
  25849. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25850. var i = null;
  25851. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25852. for (var n = function(e, t, i, n) {
  25853. o && (t.tile.zoomUploaded = !1),
  25854. r && (t.tile.uploaded = !1)
  25855. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25856. this.getTileTree(e, a).breadthFirst({
  25857. callback: n.bind(this, a),
  25858. minLevel: i
  25859. })
  25860. }
  25861. }
  25862. ,
  25863. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25864. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25865. t.tile.zoomUploaded = t.tile.uploaded,
  25866. t.zoomCovered = t.covered
  25867. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25868. this.getTileTree(e, n).breadthFirst({
  25869. callback: i.bind(this, n),
  25870. maxLevel: t
  25871. })
  25872. }
  25873. }
  25874. ,
  25875. n.prototype.renderPanoTiles = (h = [],
  25876. function(e, t, i, n) {
  25877. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25878. t = t || this.direction || m.FORWARD;
  25879. var r = this.getActiveRenderTargetDescriptor(e);
  25880. if (!this.isRenderTargetDescriptorValid(r))
  25881. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25882. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25883. var a = this.getTileTree(e, o);
  25884. h.length = 0,
  25885. a.breadthFirst({
  25886. saveVisited: h
  25887. });
  25888. for (var s = 0; s < h.length; s++) {
  25889. var l = h[s];
  25890. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25891. }
  25892. }
  25893. this.updateDirection(t)
  25894. }
  25895. ),
  25896. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25897. return e && e.renderTarget
  25898. }
  25899. ,
  25900. n.prototype.isPanoActive = function(e) {
  25901. var t = this.getActiveRenderTargetDescriptor(e);
  25902. return this.isRenderTargetDescriptorValid(t)
  25903. }
  25904. ,
  25905. n.prototype.isPanoZoomed = function(e) {
  25906. return this.zoomingActive && this.zoomPanoId === e
  25907. }
  25908. ,
  25909. n.prototype.initTileTree = function(e, t, i) {
  25910. var n = this.tileTrees[e];
  25911. n || (n = [],
  25912. this.tileTrees[e] = n);
  25913. var r = n[t];
  25914. if (!r) {
  25915. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25916. r = new v(A.TILE_SIZE,o),
  25917. n[t] = r
  25918. }
  25919. }
  25920. ,
  25921. n.prototype.getTileTree = function(e, t) {
  25922. var i = this.tileTrees[e];
  25923. if (!i)
  25924. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25925. var n = i[t];
  25926. if (!n)
  25927. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25928. return n
  25929. }
  25930. ,
  25931. n.prototype.initTiledPano = function(e, t) {
  25932. var i = this.sceneRenderer.renderer
  25933. , n = (i.context,
  25934. new _.WebGLRenderTargetCube(e,e,{
  25935. stencilBuffer: !1
  25936. }))
  25937. , r = new _.CubeTexture([]);
  25938. (n.texture = r).image = [null, null, null, null, null, null],
  25939. r.flipY = !0,
  25940. t ? (r.generateMipmaps = !0,
  25941. r.magFilter = _.LinearFilter,
  25942. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25943. r.magFilter = _.LinearFilter,
  25944. r.minFilter = _.LinearFilter),
  25945. r.format = _.RGBAFormat,
  25946. i.setRenderTarget(n),
  25947. i.setRenderTarget(null);
  25948. var o = i.properties.get(r);
  25949. return o.__image__webglTextureCube = o.__webglTexture,
  25950. n
  25951. }
  25952. ,
  25953. n.prototype.getUploadQueueForPano = function(e) {
  25954. var t = this.uploadQueues[e];
  25955. return t || (t = [],
  25956. this.uploadQueues[e] = t),
  25957. t
  25958. }
  25959. ,
  25960. n.prototype.isTileUploaded = function(e) {
  25961. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25962. }
  25963. ,
  25964. n.prototype.setUploaded = function(e, t) {
  25965. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25966. }
  25967. ,
  25968. n.prototype.queueTileUpload = function(e, t, i) {
  25969. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25970. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25971. var r = this.getUploadQueueForPano(e.panoId);
  25972. 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),
  25973. e.uploadQueued = !0,
  25974. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25975. }
  25976. }
  25977. ,
  25978. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25979. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25980. }
  25981. ,
  25982. n.prototype.getTopUploadQueue = function() {
  25983. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25984. for (var n = 0; n < this.activePanos.length; n++)
  25985. if (e = this.activePanos[n],
  25986. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25987. switch (i) {
  25988. case P.Base:
  25989. if (0 === t[0].level)
  25990. return t;
  25991. break;
  25992. case P.Remaining:
  25993. return t
  25994. }
  25995. return null
  25996. }
  25997. ,
  25998. n.prototype.getNextFromUploadQueue = function() {
  25999. if (0 < this.forceQueue.length)
  26000. return L(this.forceQueue);
  26001. var e = this.getTopUploadQueue();
  26002. return e && 0 < e.length ? L(e) : null
  26003. }
  26004. ,
  26005. n.prototype.peekNextFromUploadQueue = function() {
  26006. if (0 < this.forceQueue.length)
  26007. return this.forceQueue[0];
  26008. var e = this.getTopUploadQueue();
  26009. return e && 0 < e.length ? e[0] : null
  26010. }
  26011. ,
  26012. n.prototype.clearAllQueuedUploads = function() {
  26013. this.clearAllUploadQueues(null, 0)
  26014. }
  26015. ,
  26016. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  26017. this.clearAllUploadQueues(e, 0)
  26018. }
  26019. ,
  26020. n.prototype.clearAllUploadQueues = function(e, t) {
  26021. if (e)
  26022. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26023. this.clearUploadQueue(this.forceQueue, t, e);
  26024. else {
  26025. for (var i = 0; i < this.activePanos.length; i++) {
  26026. var n = this.activePanos[i];
  26027. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26028. }
  26029. this.clearUploadQueue(this.forceQueue, t)
  26030. }
  26031. }
  26032. ,
  26033. n.prototype.clearUploadQueue = function(e, t, i) {
  26034. null != t || (t = 0);
  26035. for (var n = 0; n < e.length; ) {
  26036. var r = e[n];
  26037. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26038. e.splice(n, 1)) : n++
  26039. }
  26040. }
  26041. ,
  26042. n.prototype.refreshUploadInterval = (a = null,
  26043. function(e) {
  26044. this.uploadIntervalCancelled || (a = a || function() {
  26045. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  26046. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26047. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26048. }
  26049. .bind(this),
  26050. null != e || (e = x),
  26051. T || (e = S),
  26052. this.uploadInterval = window.setTimeout(a, e),
  26053. this.uploadIntervalDelay = e)
  26054. }
  26055. ),
  26056. n.prototype.update = (r = performance.now(),
  26057. o = 0,
  26058. function() {
  26059. this.uploadIntervalCancelled = !0,
  26060. window.clearTimeout(this.uploadInterval),
  26061. this.uploadInterval = null;
  26062. var e = performance.now() - r;
  26063. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26064. r = performance.now()),
  26065. o++
  26066. }
  26067. ),
  26068. n.prototype.updateUploadQueue = function(e, t) {
  26069. e = e || 1;
  26070. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26071. var r = this.getNextFromUploadQueue();
  26072. if (!r)
  26073. break;
  26074. if (0 !== r.level ? i++ : n++,
  26075. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26076. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26077. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26078. }
  26079. }
  26080. }
  26081. ,
  26082. n.prototype.updateDirection = function(e) {
  26083. if (e = e || this.direction) {
  26084. this.direction = e;
  26085. for (var t = 0; t < this.activePanos.length; t++) {
  26086. var i = this.activePanos[t]
  26087. , n = this.getUploadQueueForPano(i.id);
  26088. y.sortPanoTiles(n, i, this.direction)
  26089. }
  26090. }
  26091. }
  26092. ,
  26093. n.prototype.uploadTile = (I = {},
  26094. new _.Vector4,
  26095. E = d.tiling.overlayStyle,
  26096. function(e, t) {
  26097. var i = e.panoId
  26098. , n = e.image
  26099. , r = e.tileSize
  26100. , o = e.panoSize
  26101. , a = e.tileIndex
  26102. , s = (e.faceTileIndex,
  26103. e.totalTiles)
  26104. , l = (e.face,
  26105. e.tileX)
  26106. , c = e.tileY
  26107. , h = !0
  26108. , u = !1
  26109. , d = (this.getPanoDescriptor(i),
  26110. this.getPanoLODDescriptor(i, o))
  26111. , p = this.getActiveRenderTargetDescriptor(i)
  26112. , f = p.renderTarget
  26113. , g = p.size;
  26114. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  26115. g = this.qualityManager.getMaxZoomPanoSize()),
  26116. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26117. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  26118. this.isTileUploaded(e) && (u = h = !1)),
  26119. h) {
  26120. var m = r / o * g
  26121. , v = l * r / o * g
  26122. , y = c * r / o * g;
  26123. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  26124. var A = I[r];
  26125. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  26126. 1 === E || 2 === E) {
  26127. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26128. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26129. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  26130. } else
  26131. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  26132. d.uploadCount++,
  26133. this.emit(b.TileRenderSuccess, i, o, a, s),
  26134. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  26135. this.setUploaded(e, !0),
  26136. this.addCoverageForNode(e.node)
  26137. } else
  26138. this.setUploaded(e, !1);
  26139. return e.uploadAttempted || (d.uploadAttempts++,
  26140. this.emit(b.TileUploadAttempted, i, o, a, s)),
  26141. e.uploadAttempted = !0,
  26142. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26143. u
  26144. }
  26145. ),
  26146. n.prototype.linkTileAndNode = function(e, t) {
  26147. (t.tile = e).node = t
  26148. }
  26149. ,
  26150. n.prototype.linkAllTilesAndNodes = function(a) {
  26151. for (var e = function(e, t, i, n, r) {
  26152. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  26153. this.linkTileAndNode(o, i)
  26154. }, t = 0; t < A.FACES_PER_PANO; t++) {
  26155. var i = this.getTileTree(a.id, t);
  26156. i.breadthFirst({
  26157. callback: e.bind(this, i, t)
  26158. })
  26159. }
  26160. }
  26161. ,
  26162. n.prototype.anyUploaded = function(e) {
  26163. if (!e)
  26164. return !1;
  26165. if (e.tile && this.isTileUploaded(e.tile))
  26166. return !0;
  26167. if (e.children)
  26168. for (var t = 0; t < e.children.length; t++) {
  26169. var i = e.children[t];
  26170. if (this.anyUploaded(i))
  26171. return !0
  26172. }
  26173. return !1
  26174. }
  26175. ,
  26176. n.prototype.setNodeCovered = function(e, t) {
  26177. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26178. }
  26179. ,
  26180. n.prototype.isNodeCovered = function(e) {
  26181. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26182. }
  26183. ,
  26184. n.prototype.addCoverageForNode = function(e) {
  26185. if (this.setNodeCovered(e, !0),
  26186. e.parent && e.covered) {
  26187. var t = e.parent;
  26188. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26189. }
  26190. }
  26191. ,
  26192. n.prototype.calcFullCoverage = function(e) {
  26193. var t = !1;
  26194. if (e.children)
  26195. for (var i = 0; i < e.children.length; i++) {
  26196. var n = e.children[i];
  26197. t = t || this.calcFullCoverage(n)
  26198. }
  26199. e.covered = e.tile.uploaded || t
  26200. }
  26201. ,
  26202. n.prototype.nodeSubcovered = function(e) {
  26203. if (!e.children)
  26204. return !1;
  26205. for (var t = 0; t < e.children.length; t++)
  26206. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26207. return !1;
  26208. return !0
  26209. }
  26210. ,
  26211. n.prototype.resetPanoDescriptor = function(e) {
  26212. this.getPanoDescriptor(e)
  26213. }
  26214. ,
  26215. n.prototype.getPanoDescriptor = function(e) {
  26216. var t = this.panoDescriptors[e];
  26217. return t || (t = {},
  26218. this.panoDescriptors[e] = t),
  26219. t
  26220. }
  26221. ,
  26222. n.prototype.resetPanoLODDescriptors = function(e) {
  26223. var t = this.getPanoLODDescriptors(e);
  26224. for (var i in t)
  26225. if (t.hasOwnProperty(i)) {
  26226. var n = t[i];
  26227. n.uploadCount = 0,
  26228. n.uploadAttempts = 0
  26229. }
  26230. }
  26231. ,
  26232. n.prototype.getPanoLODDescriptor = function(e, t) {
  26233. var i = this.getPanoLODDescriptors(e)
  26234. , n = i[t];
  26235. return n || (n = {
  26236. uploadCount: 0,
  26237. uploadAttempts: 0
  26238. },
  26239. i[t] = n),
  26240. n
  26241. }
  26242. ,
  26243. n.prototype.getPanoLODDescriptors = function(e) {
  26244. var t = this.panoLODDescriptors[e];
  26245. return t || (t = {},
  26246. this.panoLODDescriptors[e] = t),
  26247. t
  26248. }
  26249. ,
  26250. n.prototype.onTileDownloaded = function(e) {
  26251. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26252. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26253. if (i.downloaded = !0,
  26254. i.image = e.image,
  26255. i.panoSize = e.panoSize,
  26256. i.tileX = e.tileX,
  26257. i.tileY = e.tileY,
  26258. i.totalTiles = e.totalTiles,
  26259. i.tileIndex = e.tileIndex,
  26260. i.faceTileIndex = e.faceTileIndex,
  26261. i.face = e.face,
  26262. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26263. i.panoId = e.panoId,
  26264. i.tileSize = e.tileSize,
  26265. i.direction = (new _.Vector3).copy(e.direction),
  26266. i.node = null,
  26267. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26268. this.isPanoActive(i.panoId)) {
  26269. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26270. this.linkTileAndNode(i, n),
  26271. this.queueTileUpload(i, !0)
  26272. }
  26273. }
  26274. ,
  26275. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26276. var r = this.tileDirectory[e];
  26277. r || (r = {},
  26278. this.tileDirectory[e] = r);
  26279. var o = 16384 * t + 1024 * i + n
  26280. , a = r[o];
  26281. return a || (a = {
  26282. downloaded: !1,
  26283. uploaded: !1,
  26284. zoomUploaded: !1
  26285. },
  26286. r[o] = a),
  26287. a._key = e + ":" + t + ":" + i + ":" + n,
  26288. a._tileKey = o,
  26289. a
  26290. }
  26291. ,
  26292. n.prototype.setZoomingActive = function(e, t, i) {
  26293. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26294. this.zoomPanoId = t.id,
  26295. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26296. }
  26297. ,
  26298. n.prototype.updateZoomedPanoFromBase = function(e) {
  26299. if (!this.zoomPanoRenderingDisabled) {
  26300. var t = this.getActiveRenderTargetDescriptor(e.id);
  26301. if (t && t.renderTarget) {
  26302. var i = this.qualityManager.getMaxZoomPanoSize()
  26303. , n = t.renderTarget
  26304. , r = t.size;
  26305. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26306. this.copyBaseRenderStatusToZoomed(e.id)
  26307. }
  26308. }
  26309. }
  26310. ,
  26311. t.exports = n
  26312. }
  26313. , {
  26314. "../enum/GLCubeFaces": 25,
  26315. "../enum/PanoRendererEvents": 35,
  26316. "../enum/PanoSizeClass": 36,
  26317. "../enum/SceneRendererEvents": 43,
  26318. "../enum/TileDownloaderEvents": 45,
  26319. "../enum/Vectors": 50,
  26320. "../exception/BasicException": 55,
  26321. "../objects/Panorama": 148,
  26322. "../settings": 166,
  26323. "../util/browser": 182,
  26324. "../util/panorama": 191,
  26325. "./TileDownloader": 171,
  26326. "./TilePrioritizer": 172,
  26327. "./TileTree": 173,
  26328. "./TileUtils": 174,
  26329. events: 202,
  26330. three: 217
  26331. }],
  26332. 170: [function(e, t, i) {
  26333. "use strict";
  26334. function n(e, t, i) {
  26335. this.maxNavPanoSize = -1,
  26336. this.maxZoomPanoSize = -1,
  26337. this.devicePixelDensity = e,
  26338. this.deviceScreenSize = t,
  26339. this.clientBandwidth = i,
  26340. this.panoSizeClassMap = {},
  26341. this.useHighResolutionPanos = !0,
  26342. this.useUltraHighResolutionPanos = !1,
  26343. this.modelHasUltraHighPanos = !1
  26344. this.maxRenderTargetSize = Math.min( common.getMaxCubemapSize(), this.maxRenderTargetSize)//add
  26345. }
  26346. var r = e("../enum/PanoSizeClass")
  26347. , o = e("../settings")
  26348. , a = e("../util/browser")
  26349. , s = e("../constants")
  26350. , l = e("../util/showcase")
  26351. , c = e("../enum/ModelManagerEvents");
  26352. n.prototype.init = function(e) {
  26353. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26354. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26355. this.highSize = this.getPanoSize(r.HIGH),
  26356. this.standardSize = this.getPanoSize(r.STANDARD),
  26357. this.baseSize = this.getPanoSize(r.BASE),
  26358. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26359. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26360. this.updateMaximums(),
  26361. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26362. }
  26363. ,
  26364. n.prototype.updateFromModel = function(e) {
  26365. this.updateHighResolutionSettings(e),
  26366. this.updateUltraHighResolutionSettings(e)
  26367. }
  26368. ,
  26369. n.prototype.updateHighResolutionSettings = function(e) {
  26370. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26371. this.updateMaximums()
  26372. }
  26373. ,
  26374. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26375. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26376. this.updateMaximums()
  26377. }
  26378. ,
  26379. n.prototype.enableUltraHighQualityMode = function() {
  26380. this.modelHasUltraHighPanos = !0,
  26381. this.updateUltraHighResolutionSettings(null)
  26382. }
  26383. ,
  26384. n.prototype.ultraHighQualityModeEnabled = function() {
  26385. return this.modelHasUltraHighPanos
  26386. }
  26387. ,
  26388. n.prototype.onModelChanged = function(e) {
  26389. this.updateFromModel(e.model),
  26390. this.updateMaximums()
  26391. }
  26392. ,
  26393. n.prototype.updateMaximums = function() {
  26394. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26395. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26396. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26397. }
  26398. ,
  26399. n.prototype.buildPanoSizeClassMap = function() {
  26400. this.panoSizeClassMap[r.BASE] = 512,
  26401. this.panoSizeClassMap[r.STANDARD] = 1024,
  26402. this.panoSizeClassMap[r.HIGH] = 2048,
  26403. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26404. }
  26405. ,
  26406. n.prototype.getPanoSize = function(e) {
  26407. return this.panoSizeClassMap[e]
  26408. }
  26409. ,
  26410. n.prototype.getMaxPossiblePanoSize = function() {
  26411. return this.getPanoSize(r.ULTRAHIGH)
  26412. }
  26413. ,
  26414. n.prototype.getMaxPanoSize = function() {
  26415. return this.maxZoomPanoSize
  26416. }
  26417. ,
  26418. n.prototype.getMaxNavPanoSize = function() {
  26419. return this.maxNavPanoSize
  26420. }
  26421. ,
  26422. n.prototype.getMaxZoomPanoSize = function() {
  26423. return this.maxZoomPanoSize
  26424. }
  26425. ,
  26426. n.prototype.detectMaxNavPanoSizeClass = function() {
  26427. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26428. }
  26429. ,
  26430. n.prototype.detectMaxNavPanoSize = function() {
  26431. var e = this.detectMaxNavPanoSizeClass();
  26432. return this.getPanoSize(e)
  26433. }
  26434. ,
  26435. n.prototype.detectMaxZoomPanoSize = function() {
  26436. 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)
  26437. }
  26438. ,
  26439. t.exports = n
  26440. }
  26441. , {
  26442. "../constants": 8,
  26443. "../enum/ModelManagerEvents": 33,
  26444. "../enum/PanoSizeClass": 36,
  26445. "../settings": 166,
  26446. "../util/browser": 182,
  26447. "../util/showcase": 193
  26448. }],
  26449. 171: [function(A, C, e) {
  26450. (function(e) {
  26451. "use strict";
  26452. function i(e) {
  26453. this.panos = null,
  26454. this.retryMinimumTime = 1e4,
  26455. this.urls = null,
  26456. this.panoLoadCallbacks = {},
  26457. this.downloadDescriptors = {},
  26458. this.priorityQueue = [],
  26459. this.forceQueue = [],
  26460. this.activeDownloads = [],
  26461. this.qualityManager = null,
  26462. this.tilePrioritizer = null,
  26463. this.refreshInterval = null,
  26464. this.processPriorityQueue = !1,
  26465. this.concurrentDownloads = e.concurrentDownloads || 1,
  26466. this.downloadTestResults = {}
  26467. }
  26468. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26469. A("../settings")), r = (A("../objects/Panorama"),
  26470. A("../util/logger")), o = (A("../enum/Vectors"),
  26471. A("../enum/PanoSizeClass"),
  26472. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26473. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26474. Object.freeze({
  26475. Testing: 1,
  26476. Success: 2,
  26477. Fail: 3
  26478. }));
  26479. i.prototype = Object.create(l.prototype),
  26480. i.IDLE_REFRESH_DELAY = 500,
  26481. i.ACTIVE_REFRESH_DELAY = 16,
  26482. i.DOWNLOAD_RETRIES = 4,
  26483. i.prototype.init = function(e) {
  26484. this.qualityManager = e
  26485. }
  26486. ,
  26487. i.prototype.setUrls = function(e) {
  26488. this.urls = e
  26489. }
  26490. ,
  26491. i.prototype.setpanoData = function(e, t, i) {
  26492. this.panos = e,
  26493. this.imagePanos = t,
  26494. this.panoGroupId = i
  26495. }
  26496. ,
  26497. i.prototype.start = function() {
  26498. this.refreshUpdateInterval(0)
  26499. }
  26500. ,
  26501. i.prototype.stop = function() {
  26502. window.cancel(this.refreshInterval)
  26503. }
  26504. ,
  26505. i.prototype.refreshUpdateInterval = function(e) {
  26506. e = e || 0,
  26507. this.refreshInterval = window.setTimeout(function() {
  26508. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26509. }
  26510. .bind(this), e)
  26511. }
  26512. ,
  26513. i.prototype.update = function() {
  26514. var e = 0 < this.forceQueue.length;
  26515. return this.processQueueForDownloading(this.forceQueue),
  26516. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26517. 0 < this.priorityQueue.length && (e = !0),
  26518. this.processQueueForDownloading(this.priorityQueue)),
  26519. e
  26520. }
  26521. ,
  26522. i.prototype.forceQueueTilesForPano = (p = [],
  26523. f = [],
  26524. function(e, t, i, n, r, o) {
  26525. p.length = 0;
  26526. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26527. var l = a[s];
  26528. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26529. }
  26530. if (i && 0 < p.length) {
  26531. g.sortPanoTiles(p, e, i),
  26532. f.length = 0,
  26533. m.matchingTilesInDirection(e, t, i, n, r, f);
  26534. for (var c = 0, h = function(e) {
  26535. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26536. }; c < p.length; ) {
  26537. var u = p[c];
  26538. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26539. }
  26540. }
  26541. for (var d = 0; d < p.length; d++)
  26542. this.forceQueue.push(p[d]);
  26543. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26544. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26545. o && this.processQueueForDownloading(this.forceQueue, !0)
  26546. }
  26547. ),
  26548. i.prototype.clearForceQueue = function() {
  26549. this.clearQueue(this.forceQueue)
  26550. }
  26551. ,
  26552. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26553. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26554. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26555. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26556. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26557. }
  26558. ,
  26559. i.prototype.clearQueue = function(e) {
  26560. this.setStatusForAllDescriptors(e, v.None),
  26561. e.length = 0
  26562. }
  26563. ,
  26564. i.prototype.clearFromQueue = function(e, t, i) {
  26565. for (var n = 0; n < e.length; n++) {
  26566. var r = e[n];
  26567. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26568. }
  26569. }
  26570. ,
  26571. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26572. for (var i = 0; i < e.length; i++) {
  26573. var n = e[i];
  26574. n && (n.status = t)
  26575. }
  26576. }
  26577. ,
  26578. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26579. for (var i = 0; i < e.length; i++) {
  26580. var n = e[i];
  26581. n && (n.status !== t ? n.status = t : e[i] = null)
  26582. }
  26583. }
  26584. ,
  26585. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26586. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26587. , n = i[t];
  26588. return n || (n = this.buildDownloadDescriptorArray(t),
  26589. i[t] = n,
  26590. this.initTileDownloadDescriptors(n, e, t)),
  26591. n
  26592. }
  26593. ,
  26594. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26595. var t = this.downloadDescriptors[e.id];
  26596. return t || (t = {},
  26597. this.downloadDescriptors[e.id] = t),
  26598. t
  26599. }
  26600. ,
  26601. i.prototype.processQueueForDownloading = function(e, t) {
  26602. if (this.cleanupActiveDownloads(),
  26603. this.activeDownloads.length < this.concurrentDownloads || t)
  26604. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26605. var r = e.shift();
  26606. r && (this.startDownload(r),
  26607. n++)
  26608. }
  26609. }
  26610. ,
  26611. i.prototype.testDownload = function(t, e, i) {
  26612. var n = this.downloadTestResults[t];
  26613. if (n)
  26614. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26615. else {
  26616. this.downloadTestResults[t] = y.Testing;
  26617. var r = this.panos.list[0]
  26618. , o = this.getTileUrl(r.id, t, e, 0)
  26619. , a = function(e) {
  26620. this.downloadTestResults[t] = y.Success,
  26621. i(!0)
  26622. }
  26623. .bind(this)
  26624. , s = function() {
  26625. this.downloadTestResults[t] = y.Fail,
  26626. i(!1)
  26627. }
  26628. .bind(this);
  26629. this.loadImage(o, 0, a, s)
  26630. }
  26631. }
  26632. ,
  26633. i.prototype.startDownload = function(e) {
  26634. e.status = v.Downloading;
  26635. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26636. this.activeDownloads.push(e),
  26637. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26638. }
  26639. ,
  26640. i.prototype.downloadFailed = function(e, t) {}
  26641. ,
  26642. i.prototype.downloadComplete = function(e, t) {
  26643. if (e.panoGroupId === this.panoGroupId) {
  26644. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26645. e.status = v.Downloaded,
  26646. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26647. var n = {
  26648. panoId: e.pano.id,
  26649. image: t,
  26650. tileSize: e.tileSize,
  26651. panoSize: e.panoSize,
  26652. tileIndex: e.tileIndex,
  26653. faceTileIndex: e.faceTileIndex,
  26654. totalTiles: e.totalTiles,
  26655. face: e.face,
  26656. tileX: e.tileX,
  26657. tileY: e.tileY,
  26658. direction: e.direction
  26659. };
  26660. e.image = t,
  26661. this.emit(o.TileDownloadSuccess, n),
  26662. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26663. panoId: e.pano.id,
  26664. tileSize: e.tileSize,
  26665. panoSize: e.panoSize
  26666. },
  26667. this.emit(o.PanoDownloadComplete, n),
  26668. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26669. }
  26670. }
  26671. ,
  26672. i.prototype.cleanupActiveDownloads = (n = [],
  26673. function() {
  26674. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26675. var t = this.activeDownloads[e];
  26676. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26677. }
  26678. this.activeDownloads.length = 0,
  26679. this.activeDownloads.push.apply(this.activeDownloads, n)
  26680. }
  26681. ),
  26682. i.prototype.isPanoDownloaded = function(e, t) {
  26683. var i = this.getTileDownloadDescriptors(e, t);
  26684. if (i.length <= 0)
  26685. return !1;
  26686. for (var n = 0; n < i.length; n++) {
  26687. if (i[n].status !== v.Downloaded)
  26688. return !1
  26689. }
  26690. return !0
  26691. }
  26692. ,
  26693. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26694. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26695. this.panoLoadCallbacks[o] = {
  26696. onLoad: i,
  26697. onFail: n,
  26698. onProgress: r
  26699. }
  26700. }
  26701. ,
  26702. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26703. var i = e.id + ":" + t;
  26704. return this.panoLoadCallbacks[i]
  26705. }
  26706. ,
  26707. i.prototype.buildDownloadDescriptorArray = function(e) {
  26708. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26709. var r = this.buildDownloadDescriptor();
  26710. i.push(r)
  26711. }
  26712. return i
  26713. }
  26714. ,
  26715. i.prototype.buildDownloadDescriptor = function() {
  26716. return {
  26717. panoGroupId: null,
  26718. pano: null,
  26719. panoSize: -1,
  26720. tileSize: -1,
  26721. tileIndex: -1,
  26722. totalTiles: -1,
  26723. faceTileIndex: -1,
  26724. status: v.None,
  26725. url: null,
  26726. image: null,
  26727. direction: new t.Vector3,
  26728. face: -1,
  26729. cubeFace: -1,
  26730. tileX: -1,
  26731. tileY: -1
  26732. }
  26733. }
  26734. ,
  26735. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26736. for (var n = 0; n < e.length; n++) {
  26737. var r = e[n];
  26738. this.initTileDownloadDescriptor(r, t, i, n)
  26739. }
  26740. }
  26741. ,
  26742. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26743. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26744. e.face = m.getFaceForTile(i, n),
  26745. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26746. e.panoGroupId = this.panoGroupId,
  26747. e.pano = t,
  26748. e.panoSize = i,
  26749. e.tileSize = r,
  26750. e.tileIndex = n,
  26751. e.totalTiles = m.getTileCountForSize(i),
  26752. e.status = v.None,
  26753. e.image = null,
  26754. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26755. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26756. }
  26757. ,
  26758. i.prototype.getTileUrl = (c = {
  26759. 256: "256",
  26760. 512: "512",
  26761. 1024: "1k",
  26762. 2048: "2k",
  26763. 4096: "4k"
  26764. },
  26765. h = {
  26766. face: -1,
  26767. faceTileIndex: -1,
  26768. tileX: -1,
  26769. tileY: -1
  26770. },
  26771. function(e, t, i, n) {
  26772. m.getTileLocation(t, n, h);
  26773. var r = Math.floor(t / i)
  26774. , o = r * r
  26775. , a = Math.floor(n / o)
  26776. , s = "";
  26777. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26778. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26779. return d.changeIfTileGenerating(l)
  26780. }
  26781. ),
  26782. i.prototype.loadImage = function(e, t, i, n) {
  26783. s.getImage(e, t).then(function(e) {
  26784. i(e)
  26785. }).fail(n)
  26786. }
  26787. ,
  26788. C.exports = i
  26789. }
  26790. ).call(this, "/js/tile/TileDownloader.js")
  26791. }
  26792. , {
  26793. "../ab": 3,
  26794. "../enum/DownloadStatus": 24,
  26795. "../enum/GLCubeFaces": 25,
  26796. "../enum/PanoSizeClass": 36,
  26797. "../enum/TileDownloaderEvents": 45,
  26798. "../enum/Vectors": 50,
  26799. "../enum/Viewmode": 51,
  26800. "../objects/Panorama": 148,
  26801. "../settings": 166,
  26802. "../util/ajax": 181,
  26803. "../util/logger": 189,
  26804. "../util/panorama": 191,
  26805. "./TilePrioritizer": 172,
  26806. "./TileUtils": 174,
  26807. events: 202,
  26808. three: 217
  26809. }],
  26810. 172: [function(n, C, e) {
  26811. (function(e) {
  26812. "use strict";
  26813. function h(e, t, i, n, r) {
  26814. this.qualityManager = e,
  26815. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26816. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26817. this.baseSize = t,
  26818. this.standardSize = i,
  26819. this.highSize = n,
  26820. this.ultraHighSize = r,
  26821. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26822. }
  26823. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26824. n("../settings"),
  26825. n("../settings"),
  26826. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26827. n("../enum/PanoSizeClass"),
  26828. n("../enum/ModelManagerEvents"),
  26829. n("../enum/GLCubeFaces"),
  26830. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26831. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26832. new t(e),
  26833. Object.freeze({
  26834. None: 0,
  26835. DirectionalFOV: 1
  26836. }));
  26837. h.PriorityCriteria = function(e, t, i, n, r) {
  26838. this.pano = e,
  26839. this.cameraPosition = (new o.Vector3).copy(t),
  26840. this.cameraDir = (new o.Vector3).copy(i),
  26841. this.panoSpaceDir = (new o.Vector3).copy(n),
  26842. this.upcomingPanos = r,
  26843. this.copy = function(e) {
  26844. this.pano = e.pano,
  26845. this.cameraPosition.copy(e.cameraPosition),
  26846. this.cameraDir.copy(e.cameraDir),
  26847. this.panoSpaceDir.copy(e.panoSpaceDir),
  26848. this.upcomingPanos = r
  26849. }
  26850. ,
  26851. this.zoomingActive = !1
  26852. }
  26853. ,
  26854. h.DIRECTIONAL_FOV = 180,
  26855. h.DIRECTIONAL_FOV_NARROW = 120,
  26856. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26857. h.MAX_SCORED_PANOS_TOADD = 2,
  26858. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26859. h.DIRECTION_SCORE_STRICTNESS = .75,
  26860. h.appendQueue = function(e, t) {
  26861. if (e && t)
  26862. for (var i = 0; i < t.length; i++)
  26863. e.push(t[i])
  26864. }
  26865. ,
  26866. h.prototype.updateCriteria = function(e, t, i, n) {
  26867. this.priorityCriteria.pano = e,
  26868. this.priorityCriteria.cameraPosition.copy(t),
  26869. this.priorityCriteria.cameraDir.copy(i),
  26870. this.priorityCriteria.upcomingPanos = n,
  26871. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26872. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26873. }
  26874. ,
  26875. h.prototype.filterAndPrioritize = (u = [],
  26876. p = [],
  26877. f = [],
  26878. function(e, t, i) {
  26879. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26880. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26881. var n = this.baseSize
  26882. , r = this.standardSize
  26883. , o = this.highSize
  26884. , a = this.ultraHighSize;
  26885. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26886. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26887. f.length = 0,
  26888. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26889. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26890. h.appendQueue(e, f),
  26891. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26892. f.length = 0,
  26893. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26894. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26895. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26896. h.appendQueue(e, f),
  26897. f.length = 0,
  26898. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26899. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26900. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26901. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26902. h.appendQueue(e, f),
  26903. this.queueTilesForPanos(e, u, i, n)
  26904. }
  26905. ),
  26906. h.prototype.canDownloadSize = function(e) {
  26907. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26908. }
  26909. ,
  26910. h.prototype.populateNeighborPanos = function(e, t, i) {
  26911. (i = i || []).length = 0;
  26912. var n = t.getNeighbours(e);
  26913. for (var r in n)
  26914. if (n.hasOwnProperty(r)) {
  26915. var o = t.get(r);
  26916. i.push(o)
  26917. }
  26918. return i
  26919. }
  26920. ,
  26921. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26922. (i = i || []).length = 0;
  26923. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26924. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26925. , s = t.sortByScore(o, a);
  26926. if (s)
  26927. for (var l = 0; l < s.length && l < r; l++) {
  26928. var c = s[l].item;
  26929. i.push(c)
  26930. }
  26931. return i
  26932. }
  26933. ,
  26934. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26935. for (var o = 0, a = 0; a < t.length; a++) {
  26936. var s = t[a];
  26937. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26938. r && r <= o)
  26939. break
  26940. }
  26941. return o
  26942. }
  26943. ,
  26944. h.prototype.queueTilesForPano = (r = {
  26945. filter: a.None
  26946. },
  26947. function(e, t, i, n) {
  26948. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26949. }
  26950. ),
  26951. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26952. function(e, t, i, n, r, o, a, s) {
  26953. for (var l = 0, c = 0; c < i.length; c++) {
  26954. var h = i[c];
  26955. d.copy(h.position),
  26956. d.sub(r),
  26957. d.normalize();
  26958. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26959. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26960. s && s <= l))
  26961. break
  26962. }
  26963. return l
  26964. }
  26965. ),
  26966. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26967. for (var l = 0, c = 0; c < i.length; c++) {
  26968. var h = i[c];
  26969. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26970. s && s <= l)
  26971. break
  26972. }
  26973. return l
  26974. }
  26975. ,
  26976. h.prototype.queueTilesInDirectionForPano = (s = {
  26977. filter: a.DirectionalFOV,
  26978. direction: new o.Vector3,
  26979. fov: 60
  26980. },
  26981. l = new o.Vector3,
  26982. function(e, t, i, n, r, o, a) {
  26983. return l.copy(o),
  26984. m.getRelativeDirection(i.quaternion, l),
  26985. s.direction.copy(l),
  26986. s.fov = a,
  26987. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26988. }
  26989. ),
  26990. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26991. function(e, t, i, n, r) {
  26992. var o = t.getTileDownloadDescriptors(i, n);
  26993. c.length = 0,
  26994. this.filterTileDownloadDescriptors(i, o, c, r);
  26995. for (var a = 0, s = 0; s < c.length; s++) {
  26996. var l = c[s];
  26997. l && (e.push(l),
  26998. a++)
  26999. }
  27000. return a
  27001. }
  27002. ),
  27003. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  27004. function(e, t, i, n) {
  27005. var r, o;
  27006. switch (n.filter) {
  27007. case a.DirectionalFOV:
  27008. for (r = 0; r < t.length; r++)
  27009. o = t[r],
  27010. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27011. break;
  27012. default:
  27013. for (r = 0; r < t.length; r++)
  27014. o = t[r],
  27015. i.push(o)
  27016. }
  27017. for (r = 0; r < i.length; r++)
  27018. o = i[r],
  27019. this.canIncludeDescriptor(o) || (i[r] = null)
  27020. }
  27021. ),
  27022. h.prototype.canIncludeDescriptor = function(e) {
  27023. return e.status !== i.Downloading && e.status !== i.Downloaded
  27024. }
  27025. ,
  27026. h.prototype.canIncludePano = function(e, t) {
  27027. return !e.isLoaded(t)
  27028. }
  27029. ,
  27030. h.getFOVDotThreshold = function(e) {
  27031. return Math.cos(o.Math.degToRad(e / 2))
  27032. }
  27033. ;
  27034. var y = (A._panoSpaceDir = new o.Vector3,
  27035. A._fovThreshold = -1,
  27036. A._fovThresholdNarrow = -1,
  27037. A);
  27038. function A(e, t) {
  27039. var i = A._panoSpaceDir
  27040. , n = A._fovThreshold
  27041. , r = A._fovThresholdNarrow
  27042. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  27043. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  27044. return e._dot = o,
  27045. t._dot = a,
  27046. 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)
  27047. }
  27048. h.sortPanoTiles = function(e, t, i) {
  27049. y._panoSpaceDir.copy(i),
  27050. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  27051. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27052. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  27053. e.sort(y)
  27054. }
  27055. ,
  27056. h.insertSortedPanoTile = function(e, t, i, n) {
  27057. y._panoSpaceDir.copy(n),
  27058. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  27059. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27060. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  27061. for (var r = -1, o = 0; o < e.length; o++) {
  27062. if (y(t, e[o]) <= 0) {
  27063. r = o;
  27064. break
  27065. }
  27066. }
  27067. if (-1 === r)
  27068. e[e.length] = t;
  27069. else {
  27070. for (var a = e.length; r < a; a--)
  27071. e[a] = e[a - 1];
  27072. e[r] = t
  27073. }
  27074. }
  27075. ,
  27076. h.prototype.setZoomingActive = function(e) {
  27077. e !== this.zoomingActive && (this.zoomingActive = e)
  27078. }
  27079. ,
  27080. C.exports = h
  27081. }
  27082. ).call(this, "/js/tile/TilePrioritizer.js")
  27083. }
  27084. , {
  27085. "../enum/DownloadStatus": 24,
  27086. "../enum/GLCubeFaces": 25,
  27087. "../enum/ModelManagerEvents": 33,
  27088. "../enum/PanoSizeClass": 36,
  27089. "../enum/Vectors": 50,
  27090. "../enum/Viewmode": 51,
  27091. "../objects/Panorama": 148,
  27092. "../settings": 166,
  27093. "../util/browser": 182,
  27094. "../util/logger": 189,
  27095. "../util/math": 190,
  27096. "./TileUtils": 174,
  27097. events: 202,
  27098. three: 217
  27099. }],
  27100. 173: [function(e, t, i) {
  27101. "use strict";
  27102. function f(e, t) {
  27103. this.levels = t,
  27104. this.tileSize = e,
  27105. this.root = null,
  27106. this.allNodes = [],
  27107. function(e) {
  27108. e.root = function e(t, i, n) {
  27109. if (n > t.levels)
  27110. return null;
  27111. var r = new a(t,i);
  27112. t.allNodes.push(r);
  27113. for (var o = 0; o < s; o++)
  27114. r.children[o] = e(t, r, n + 1);
  27115. return r
  27116. }(e, null, 0)
  27117. }(this)
  27118. }
  27119. function a(e, t) {
  27120. this.tree = e,
  27121. this.parent = t,
  27122. this.children = [],
  27123. this.id = ++n
  27124. }
  27125. var g = (e("three"),
  27126. e("./TileUtils"),
  27127. e("../objects/Panorama"),
  27128. e("../util/panorama"),
  27129. e("events").EventEmitter,
  27130. 2)
  27131. , s = g * g;
  27132. f.TraversalType = Object.freeze({
  27133. PreOrder: 0,
  27134. PostOrder: 1
  27135. });
  27136. var n = 0;
  27137. f.getLevelCountForSize = function(e, t) {
  27138. var i = 0;
  27139. for (t < e && (t = e); !((t /= g) < e); )
  27140. i++;
  27141. return i
  27142. }
  27143. ,
  27144. f.getSizeForLevel = function(e, t) {
  27145. return Math.pow(g, t) * e
  27146. }
  27147. ,
  27148. f.prototype.getSubNode = function(e, t, i) {
  27149. (!t || e < this.tileSize) && (t = 0),
  27150. (!i || e < this.tileSize) && (i = 0),
  27151. e < this.tileSize && (e = this.tileSize);
  27152. var n = f.getLevelCountForSize(this.tileSize, e);
  27153. return function e(t, i, n, r, o) {
  27154. if (!t)
  27155. return null;
  27156. if (0 === n)
  27157. return t;
  27158. if (!t.children || 0 === t.children.length)
  27159. return null;
  27160. var a = Math.pow(g, n) / g
  27161. , s = r % a
  27162. , l = o % a
  27163. , c = Math.floor(o / a)
  27164. , h = Math.floor(r / a)
  27165. , u = c * g + h;
  27166. return e(t.children[u], i + 1, n - 1, s, l)
  27167. }(this.root, 0, n, t, i)
  27168. }
  27169. ,
  27170. f.prototype.breadthFirst = function(e) {
  27171. var t = !!(e = e || {}).nullLevelEnd
  27172. , i = e.maxLevel
  27173. , n = e.minLevel
  27174. , r = e.callback
  27175. , o = e.saveVisited
  27176. , a = []
  27177. , s = {}
  27178. , l = 0;
  27179. for (a.push(this.root),
  27180. a.push(s); 0 < a.length && !(i && i < l); ) {
  27181. var c = a.shift();
  27182. if (c === s)
  27183. (!n || n <= l) && (r && t && r(null),
  27184. o && t && o.push(null)),
  27185. 0 < a.length && a.push(s),
  27186. l++,
  27187. 0;
  27188. else {
  27189. if (c.children)
  27190. for (var h = 0; h < c.children.length; h++) {
  27191. c.children[h] && a.push(c.children[h])
  27192. }
  27193. var u = this.getFaceIndexFromNode(c);
  27194. (!n || n <= l) && (r && r(c, l, u),
  27195. o && o.push(c)),
  27196. 0
  27197. }
  27198. }
  27199. }
  27200. ,
  27201. f.prototype.getFaceIndexFromNode = function(e) {
  27202. if (!e)
  27203. return -1;
  27204. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27205. var o = i.parent;
  27206. if (!o)
  27207. break;
  27208. for (var a = -1, s = 0; s < o.children.length; s++)
  27209. o.children[s] === i && (a = s);
  27210. n = a % g * t + n,
  27211. r = Math.floor(a / g) * t + r,
  27212. t *= g,
  27213. i = o
  27214. }
  27215. return r * t + n
  27216. }
  27217. ,
  27218. f.prototype.depthFirst = function(e, t, i) {
  27219. !function e(t, i, n, r, o, a, s, l) {
  27220. if (t) {
  27221. s = s || f.TraversalType.PreOrder;
  27222. var c = r * g + n;
  27223. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27224. a && a.push(t)),
  27225. t.children && 0 !== t.children.length) {
  27226. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27227. for (var p = 0; p < g; p++)
  27228. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27229. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27230. a && a.push(t))
  27231. }
  27232. }
  27233. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27234. }
  27235. ,
  27236. t.exports = f
  27237. }
  27238. , {
  27239. "../objects/Panorama": 148,
  27240. "../util/panorama": 191,
  27241. "./TileUtils": 174,
  27242. events: 202,
  27243. three: 217
  27244. }],
  27245. 174: [function(e, t, i) {
  27246. "use strict";
  27247. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27248. b.TILE_SIZE = 512,
  27249. b.FACES_PER_PANO = 6,
  27250. b.LocationOnTile = {
  27251. Center: 0,
  27252. UpperLeft: 1,
  27253. UpperRight: 2,
  27254. LowerRight: 3,
  27255. LowerLeft: 4
  27256. },
  27257. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27258. var l = e / t
  27259. , c = t / e * 2
  27260. , h = c / 2
  27261. , u = n / l * 2 - 1 + h
  27262. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27263. switch (o = o || b.LocationOnTile.Center) {
  27264. case b.LocationOnTile.UpperLeft:
  27265. u -= h,
  27266. d += h,
  27267. u += a * c;
  27268. break;
  27269. case b.LocationOnTile.UpperRight:
  27270. u += h,
  27271. d += h,
  27272. d -= a * c;
  27273. break;
  27274. case b.LocationOnTile.LowerRight:
  27275. u += h,
  27276. d -= h,
  27277. u -= a * c;
  27278. break;
  27279. case b.LocationOnTile.LowerLeft:
  27280. u -= h,
  27281. d -= h,
  27282. d += a * c;
  27283. break;
  27284. case b.LocationOnTile.Center:
  27285. }
  27286. switch (i) {
  27287. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27288. _.setVector(s, -1, d, -u);
  27289. break;
  27290. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27291. _.setVector(s, 1, d, u);
  27292. break;
  27293. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27294. _.setVector(s, -u, 1, -d);
  27295. break;
  27296. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27297. _.setVector(s, -u, -1, d);
  27298. break;
  27299. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27300. _.setVector(s, -u, d, 1);
  27301. break;
  27302. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27303. _.setVector(s, u, d, -1)
  27304. }
  27305. _.normalize(s)
  27306. }
  27307. ,
  27308. b.getFaceForTile = function(e, t) {
  27309. var i = b.TILE_SIZE;
  27310. e < b.TILE_SIZE && (i = e);
  27311. var n = Math.floor(e / i)
  27312. , r = n * n;
  27313. return Math.floor(t / r)
  27314. }
  27315. ,
  27316. b.getTileLocation = function(e, t, i) {
  27317. var n = b.TILE_SIZE;
  27318. e < b.TILE_SIZE && (n = e);
  27319. var r = b.getFaceForTile(e, t)
  27320. , o = Math.floor(e / n)
  27321. , a = t - r * (o * o);
  27322. i.tileX = a % o,
  27323. i.tileY = Math.floor(a / o),
  27324. i.face = r,
  27325. i.faceTileIndex = a
  27326. }
  27327. ,
  27328. b.getTileCountForSize = function(e) {
  27329. if (e <= b.TILE_SIZE)
  27330. return b.FACES_PER_PANO;
  27331. var t = Math.floor(e / b.TILE_SIZE);
  27332. return t * t * b.FACES_PER_PANO
  27333. }
  27334. ,
  27335. b.getRelativeDirection = (r = new _.Matrix4,
  27336. o = new _.Quaternion,
  27337. function(e, t) {
  27338. o.copy(e),
  27339. o.inverse(),
  27340. r.makeRotationFromQuaternion(o),
  27341. r.applyToVector3(t),
  27342. _.normalize(t)
  27343. }
  27344. ),
  27345. b.matchingTilesInDirection = (c = new _.Vector3,
  27346. h = new _.Vector3(0,0,-1),
  27347. u = new _.Quaternion,
  27348. l = {
  27349. face: -1,
  27350. faceTileIndex: -1,
  27351. tileX: -1,
  27352. tileY: -1
  27353. },
  27354. d = function(e, t, i) {
  27355. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27356. b.getTileLocation(e, o, l),
  27357. t && !t(l) || (r++,
  27358. i && (a = l,
  27359. i.push({
  27360. face: a.face,
  27361. faceTileIndex: a.faceTileIndex,
  27362. tileX: a.tileX,
  27363. tileY: a.tileY
  27364. })));
  27365. var a;
  27366. return r
  27367. }
  27368. ,
  27369. function(e, t, i, n, r, o) {
  27370. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27371. if (b.getTileCountForSize(t),
  27372. !n && !r)
  27373. return d(t, null, o);
  27374. var s = !!r;
  27375. return r = r || n,
  27376. r = Math.max(0, Math.min(r, 360)),
  27377. n = Math.max(0, Math.min(n, 360)),
  27378. _.copyVector(i, c),
  27379. b.getRelativeDirection(e.quaternion, c),
  27380. s ? (u.setFromUnitVectors(c, h),
  27381. d(t, function(e) {
  27382. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27383. }, o)) : d(t, function(e) {
  27384. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27385. }, o)
  27386. }
  27387. ),
  27388. b.isTileWithinFrustum = (E = new _.Vector3,
  27389. function(e, t, i, n, r, o, a, s) {
  27390. 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++)
  27391. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27392. _.applyQuaternionToVector(o, E),
  27393. -1e-5 <= E.z)
  27394. ;
  27395. else {
  27396. var A = -1 / E.z
  27397. , C = E.x * A
  27398. , I = E.y * A;
  27399. l < I ? p++ : I < c && f++,
  27400. h < C ? g++ : C < u && m++,
  27401. v++
  27402. }
  27403. return f !== v && p !== v && g !== v && m !== v
  27404. }
  27405. ),
  27406. b.isTileWithinFOV = (p = new _.Vector3,
  27407. f = new _.Vector3(0,1,0),
  27408. g = new _.Vector3(1,0,0),
  27409. function(e, t, i, n, r, o, a) {
  27410. var s = b.mapFaceToCubemapFace(i);
  27411. if (_.cross(o, f, g),
  27412. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27413. b.isWithinFOV(p, o, a, null))
  27414. return !0;
  27415. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27416. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27417. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27418. b.isWithinFOV(p, o, a, null))
  27419. return !0;
  27420. h += l
  27421. }
  27422. return !1
  27423. }
  27424. ),
  27425. b.isWithinFOV = (a = new _.Vector3,
  27426. s = new _.Vector3,
  27427. function(e, t, i, n) {
  27428. if (_.copyVector(e, s),
  27429. n) {
  27430. _.copyVector(n, a),
  27431. _.normalize(a);
  27432. var r = _.dot(a, e);
  27433. a.x *= r,
  27434. a.y *= r,
  27435. a.z *= r,
  27436. _.subVector(s, a)
  27437. }
  27438. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27439. return Math.cos(o) <= _.dot(s, t)
  27440. }
  27441. ),
  27442. b.mapFaceToCubemapFace = (n = {
  27443. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27444. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27445. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27446. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27447. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27448. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27449. },
  27450. function(e) {
  27451. return n[e]
  27452. }
  27453. ),
  27454. t.exports = b
  27455. }
  27456. , {
  27457. "../enum/GLCubeFaces": 25,
  27458. "../util/MathLight": 176
  27459. }],
  27460. 175: [function(i, n, e) {
  27461. (function(e) {
  27462. "use strict";
  27463. function t() {
  27464. this.list = [],
  27465. this.index = {},
  27466. Object.defineProperty(this, "length", {
  27467. get: function() {
  27468. return this.list.length
  27469. }
  27470. })
  27471. }
  27472. new (i("./common"),
  27473. i("./logger"))(e),
  27474. t.prototype.forEach = function(e) {
  27475. this.list.forEach(e)
  27476. }
  27477. ,
  27478. t.prototype.add = function(e) {
  27479. this.list.push(e),
  27480. this.index[this.getIndex(e)] = e
  27481. }
  27482. ,
  27483. t.prototype.getIndex = function(e) {
  27484. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27485. }
  27486. ,
  27487. t.prototype.extend = function(e) {
  27488. for (var t = 0; t < e.length; t++)
  27489. this.add(e[t])
  27490. }
  27491. ,
  27492. t.prototype.get = function(e) {
  27493. return this.index[e]
  27494. }
  27495. ,
  27496. t.prototype.first = function() {
  27497. return this.list[0]
  27498. }
  27499. ,
  27500. t.prototype.last = function() {
  27501. return this.list[this.list.length - 1]
  27502. }
  27503. ,
  27504. t.prototype.reIndex = function() {
  27505. this.index = {};
  27506. var t = this;
  27507. this.forEach(function(e) {
  27508. t.index[t.getIndex(e)] = e
  27509. })
  27510. }
  27511. ,
  27512. t.prototype.filter = function(e) {
  27513. var t = this.list.filter(e);
  27514. return this.reIndex(),
  27515. t
  27516. }
  27517. ,
  27518. t.prototype.reduce = function(e, t) {
  27519. return this.list.reduce(e, t)
  27520. }
  27521. ,
  27522. t.prototype.sort = function(e) {
  27523. return this.list.sort(e)
  27524. }
  27525. ,
  27526. t.prototype.indexOf = function(e) {
  27527. for (var t = 0; t < this.list.length; ++t)
  27528. if (this.list[t] === e)
  27529. return t;
  27530. return -1
  27531. }
  27532. ,
  27533. n.exports = t
  27534. }
  27535. ).call(this, "/js/util/IndexedCollection.js")
  27536. }
  27537. , {
  27538. "./common": 185,
  27539. "./logger": 189
  27540. }],
  27541. 176: [function(e, t, i) {
  27542. "use strict";
  27543. e("../constants");
  27544. var n, r, o = {};
  27545. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27546. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27547. o.Vector3 = function(e, t, i) {
  27548. this.x = e || 0,
  27549. this.y = t || 0,
  27550. this.z = i || 0
  27551. }
  27552. ,
  27553. o.Matrix4 = function() {
  27554. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27555. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27556. }
  27557. ,
  27558. o.Matrix4.prototype = {
  27559. identity: function() {
  27560. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27561. this
  27562. },
  27563. copy: function(e) {
  27564. return this.elements.set(e.elements),
  27565. this
  27566. },
  27567. applyToVector3: function(e) {
  27568. var t = e.x
  27569. , i = e.y
  27570. , n = e.z
  27571. , r = this.elements;
  27572. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27573. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27574. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27575. this
  27576. },
  27577. getInverse: function(e, t) {
  27578. var i = this.elements
  27579. , n = e.elements
  27580. , r = n[0]
  27581. , o = n[1]
  27582. , a = n[2]
  27583. , s = n[3]
  27584. , l = n[4]
  27585. , c = n[5]
  27586. , h = n[6]
  27587. , u = n[7]
  27588. , d = n[8]
  27589. , p = n[9]
  27590. , f = n[10]
  27591. , g = n[11]
  27592. , m = n[12]
  27593. , v = n[13]
  27594. , y = n[14]
  27595. , A = n[15]
  27596. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27597. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27598. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27599. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27600. , b = r * C + o * I + a * E + s * _;
  27601. if (0 == b) {
  27602. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27603. if (t)
  27604. throw new Error(w);
  27605. return console.warn(w),
  27606. this.identity()
  27607. }
  27608. var T = 1 / b;
  27609. return i[0] = C * T,
  27610. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27611. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27612. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27613. i[4] = I * T,
  27614. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27615. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27616. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27617. i[8] = E * T,
  27618. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27619. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27620. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27621. i[12] = _ * T,
  27622. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27623. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27624. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27625. this
  27626. },
  27627. makeRotationFromQuaternion: function(e) {
  27628. var t = this.elements
  27629. , i = e.x
  27630. , n = e.y
  27631. , r = e.z
  27632. , o = e.w
  27633. , a = i + i
  27634. , s = n + n
  27635. , l = r + r
  27636. , c = i * a
  27637. , h = i * s
  27638. , u = i * l
  27639. , d = n * s
  27640. , p = n * l
  27641. , f = r * l
  27642. , g = o * a
  27643. , m = o * s
  27644. , v = o * l;
  27645. return t[0] = 1 - (d + f),
  27646. t[4] = h - v,
  27647. t[8] = u + m,
  27648. t[1] = h + v,
  27649. t[5] = 1 - (c + f),
  27650. t[9] = p - g,
  27651. t[2] = u - m,
  27652. t[6] = p + g,
  27653. t[10] = 1 - (c + d),
  27654. t[3] = 0,
  27655. t[7] = 0,
  27656. t[11] = 0,
  27657. t[12] = 0,
  27658. t[13] = 0,
  27659. t[14] = 0,
  27660. t[15] = 1,
  27661. this
  27662. }
  27663. },
  27664. o.Quaternion = function(e, t, i, n) {
  27665. this._x = e || 0,
  27666. this._y = t || 0,
  27667. this._z = i || 0,
  27668. this._w = void 0 !== n ? n : 1
  27669. }
  27670. ,
  27671. o.Quaternion.prototype = {
  27672. get x() {
  27673. return this._x
  27674. },
  27675. set x(e) {
  27676. this._x = e
  27677. },
  27678. get y() {
  27679. return this._y
  27680. },
  27681. set y(e) {
  27682. this._y = e
  27683. },
  27684. get z() {
  27685. return this._z
  27686. },
  27687. set z(e) {
  27688. this._z = e
  27689. },
  27690. get w() {
  27691. return this._w
  27692. },
  27693. set w(e) {
  27694. this._w = e
  27695. },
  27696. copy: function(e) {
  27697. this._x = e.x,
  27698. this._y = e.y,
  27699. this._z = e.z,
  27700. this._w = e.w
  27701. },
  27702. inverse: function() {
  27703. return this.conjugate().normalize()
  27704. },
  27705. conjugate: function() {
  27706. return this._x *= -1,
  27707. this._y *= -1,
  27708. this._z *= -1,
  27709. this
  27710. },
  27711. length: function() {
  27712. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27713. },
  27714. normalize: function() {
  27715. var e = this.length();
  27716. return 0 === e ? (this._x = 0,
  27717. this._y = 0,
  27718. this._z = 0,
  27719. this._w = 1) : (e = 1 / e,
  27720. this._x = this._x * e,
  27721. this._y = this._y * e,
  27722. this._z = this._z * e,
  27723. this._w = this._w * e),
  27724. this
  27725. },
  27726. setFromAxisAngle: function(e, t) {
  27727. var i = t / 2
  27728. , n = Math.sin(i);
  27729. return this._x = e.x * n,
  27730. this._y = e.y * n,
  27731. this._z = e.z * n,
  27732. this._w = Math.cos(i),
  27733. this
  27734. },
  27735. setFromUnitVectors: function(e, t) {
  27736. return void 0 === n && (n = new o.Vector3),
  27737. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27738. 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),
  27739. this._x = n.x,
  27740. this._y = n.y,
  27741. this._z = n.z,
  27742. this._w = r,
  27743. this.normalize()
  27744. },
  27745. multiply: function(e) {
  27746. return this.multiplyQuaternions(this, e)
  27747. },
  27748. premultiply: function(e) {
  27749. return this.multiplyQuaternions(e, this)
  27750. },
  27751. multiplyQuaternions: function(e, t) {
  27752. var i = e._x
  27753. , n = e._y
  27754. , r = e._z
  27755. , o = e._w
  27756. , a = t._x
  27757. , s = t._y
  27758. , l = t._z
  27759. , c = t._w;
  27760. return this._x = i * c + o * a + n * l - r * s,
  27761. this._y = n * c + o * s + r * a - i * l,
  27762. this._z = r * c + o * l + i * s - n * a,
  27763. this._w = o * c - i * a - n * s - r * l,
  27764. this
  27765. }
  27766. },
  27767. o.convertWorkshopVector = function(e) {
  27768. return new o.Vector3(-e.x,e.y,e.z)
  27769. }
  27770. ,
  27771. o.convertWorkshopQuaternion = function(e) {
  27772. 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))
  27773. }
  27774. ,
  27775. o.convertWorkshopOrthoZoom = function(e) {
  27776. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27777. }
  27778. ,
  27779. o.convertWorkshopPanoramaQuaternion = function(e) {
  27780. 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))
  27781. }
  27782. ,
  27783. o.normalize = function(e) {
  27784. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27785. , i = Math.sqrt(t);
  27786. e.x /= i,
  27787. e.y /= i,
  27788. e.z /= i
  27789. }
  27790. ,
  27791. o.dot = function(e, t) {
  27792. return e.x * t.x + e.y * t.y + e.z * t.z
  27793. }
  27794. ,
  27795. o.cross = function(e, t, i) {
  27796. var n = e.x
  27797. , r = e.y
  27798. , o = e.z;
  27799. i.x = r * t.z - o * t.y,
  27800. i.y = o * t.x - n * t.z,
  27801. i.z = n * t.y - r * t.x
  27802. }
  27803. ,
  27804. o.setVector = function(e, t, i, n) {
  27805. e.x = t,
  27806. e.y = i,
  27807. e.z = n
  27808. }
  27809. ,
  27810. o.copyVector = function(e, t) {
  27811. t.x = e.x,
  27812. t.y = e.y,
  27813. t.z = e.z
  27814. }
  27815. ,
  27816. o.addVector = function(e, t) {
  27817. e.x += t.x,
  27818. e.y += t.y,
  27819. e.z += t.z
  27820. }
  27821. ,
  27822. o.subVector = function(e, t) {
  27823. e.x -= t.x,
  27824. e.y -= t.y,
  27825. e.z -= t.z
  27826. }
  27827. ,
  27828. o.applyQuaternionToVector = function(e, t) {
  27829. var i = t.x
  27830. , n = t.y
  27831. , r = t.z
  27832. , o = e.x
  27833. , a = e.y
  27834. , s = e.z
  27835. , l = e.w
  27836. , c = l * i + a * r - s * n
  27837. , h = l * n + s * i - o * r
  27838. , u = l * r + o * n - a * i
  27839. , d = -o * i - a * n - s * r;
  27840. t.x = c * l + d * -o + h * -s - u * -a,
  27841. t.y = h * l + d * -a + u * -o - c * -s,
  27842. t.z = u * l + d * -s + c * -a - h * -o
  27843. }
  27844. ,
  27845. o.angleBetweenVectors = function(e, t) {
  27846. return Math.acos(o.dot(e, t))
  27847. }
  27848. ,
  27849. t.exports = o
  27850. }
  27851. , {
  27852. "../constants": 8
  27853. }],
  27854. 177: [function(c, h, e) {
  27855. (function(e) {
  27856. "use strict";
  27857. function t(e) {
  27858. this.cache = null,
  27859. this.expires = 0
  27860. }
  27861. function i() {
  27862. this.baseUrl = null,
  27863. this.cache = null,
  27864. this.expires = 0
  27865. }
  27866. function n() {
  27867. this.baseUrl = null,
  27868. this.expires = 0
  27869. }
  27870. function r(e) {
  27871. this.initialLoadingPromise = null,
  27872. this.endpoint = e + "?type=3",
  27873. this.urlContainer = null,
  27874. this.authorizationHeader = s.getAuthorizationHeader(),
  27875. this.containerClasses = [n, i, t]
  27876. }
  27877. c("./ajax");
  27878. var o = c("./logger")
  27879. , a = c("../constants")
  27880. , s = c("./showcase")
  27881. , l = (c("../ab"),
  27882. new o(e));
  27883. t.prototype = {
  27884. version: 1,
  27885. validate: function(e) {
  27886. return "catalog.json"in e && 0 < Object.keys(e).length
  27887. },
  27888. update: function(e) {
  27889. return this.cache = e,
  27890. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27891. $.when()
  27892. },
  27893. get: function(e) {
  27894. return this.cache[e]
  27895. }
  27896. },
  27897. i.prototype = {
  27898. version: 2,
  27899. validate: function(e) {
  27900. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27901. },
  27902. update: function(e) {
  27903. return this.baseUrl = e["base.url"],
  27904. this.cache = e,
  27905. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27906. $.when()
  27907. },
  27908. get: function(e) {
  27909. var t = this.cache[e];
  27910. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27911. }
  27912. },
  27913. n.prototype = {
  27914. version: 3,
  27915. validate: function(e) {
  27916. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27917. },
  27918. update: function(e) {
  27919. return this.baseUrl = e.templates[0],
  27920. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27921. $.when()
  27922. },
  27923. get: function(e) {
  27924. return this.baseUrl.replace("{{filename}}", e)
  27925. }
  27926. },
  27927. r.prototype = {
  27928. init: function() {
  27929. return this.initialLoadingPromise || (setInterval(function() {
  27930. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27931. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27932. this.refresh().done(function() {
  27933. l.debug("Refreshed")
  27934. }).fail(function() {
  27935. l.error("Failed url refresh, urls might go stale soon")
  27936. }))
  27937. }
  27938. .bind(this), a.signedUrlCheckInterval),
  27939. this.initialLoadingPromise = this.refresh()),
  27940. this.initialLoadingPromise
  27941. },
  27942. refresh: function(e) {
  27943. return {},
  27944. $.Deferred().resolve()
  27945. },
  27946. get: function(e) {
  27947. return window.DATA.files.templates[0].replace("{{filename}}", e)
  27948. }
  27949. },
  27950. h.exports = r
  27951. }
  27952. ).call(this, "/js/util/ModelUrls.js")
  27953. }
  27954. , {
  27955. "../ab": 3,
  27956. "../constants": 8,
  27957. "./ajax": 181,
  27958. "./logger": 189,
  27959. "./showcase": 193
  27960. }],
  27961. 178: [function(l, c, e) {
  27962. (function(e) {
  27963. "use strict";
  27964. function t() {
  27965. i.call(this),
  27966. this.neighbourMap = {},
  27967. this.map = null
  27968. }
  27969. 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"),
  27970. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27971. n.inherit(t, i),
  27972. t.prototype.getIndex = function(e) {
  27973. return e.id
  27974. }
  27975. ,
  27976. t.prototype.find = function(e, t) {
  27977. var i = n.filterAll(this.list, e);
  27978. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27979. i = n.stableSort(i, e)
  27980. }),
  27981. i[0])
  27982. }
  27983. ,
  27984. /* t.prototype.sortByScore = function(e, t) {
  27985. var i = n.filterAll(this.list, e);
  27986. return 0 === i.length ? null : i = i.map(function(i) {
  27987. return {
  27988. pano: i,
  27989. score: t.reduce(function(e, t) {
  27990. return e + t(i)
  27991. }, 0)
  27992. }
  27993. }).sort(function(e, t) {
  27994. return t.score - e.score
  27995. })
  27996. } */
  27997. t.prototype.sortByScore = function( request, rank){
  27998. return common.sortByScore(this.list, request, rank)
  27999. }
  28000. ,
  28001. t.prototype.lowestByScore = function(e, t, i) {
  28002. return this.findRankedByScore(0, e, t, i)
  28003. }
  28004. ,
  28005. t.prototype.findRankedByScore = function(e, t, i, n) {
  28006. n && (n.candidates = null,
  28007. n.pano = null),
  28008. e = e || 0;
  28009. var r = this.sortByScore(t, i);
  28010. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28011. n.pano = r[e].item),
  28012. r[e].item)
  28013. }
  28014. ,
  28015. t.prototype.showPanoScores = function(e) {
  28016. this.list.forEach(function(e) {
  28017. e.removeTextSprite()
  28018. });
  28019. var t = 6344768;
  28020. e.forEach(function(e) {
  28021. e.pano.addTextSprite(e.score.toFixed(2), t),
  28022. t = 16428055
  28023. })
  28024. }
  28025. ,
  28026. t.prototype.isNeighbour = function(e, t) {
  28027. return this.neighbourMap[e.id][t.id]
  28028. }
  28029. ,
  28030. t.prototype.getNeighbours = function(e) {
  28031. return this.neighbourMap[e.id]
  28032. }
  28033. ,
  28034. t.prototype.setNeighbour = function(e, t, i) {
  28035. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28036. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28037. this.neighbourMap[e.id][e.id] = !0,
  28038. this.neighbourMap[t.id][t.id] = !0,
  28039. this.neighbourMap[e.id][t.id] = i,
  28040. this.neighbourMap[t.id][e.id] = i,
  28041. this.neighbourMap[e.id]
  28042. }
  28043. ,
  28044. t.prototype.findClosest = function(e, t) {
  28045. var i = [r.filters.isPanoAligned()];
  28046. return t && i.push(r.filters.inDirection(e, t, .75)),
  28047. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  28048. }
  28049. ,
  28050. t.prototype.dualNeighbors = function(e, t) {
  28051. var i, n = [];
  28052. for (i in this.neighbourMap[e.id])
  28053. this.neighbourMap[t.id][i] && n.push(i);
  28054. return n
  28055. }
  28056. ,
  28057. t.prototype.populate_path_graph = function() {
  28058. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  28059. for (e = 0; e < this.list.length; e += 1) {
  28060. for (t in s = !(a = {}),
  28061. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  28062. if (i[t]) {
  28063. o = this.index[t],
  28064. u.copy(r.floorPosition),
  28065. u.sub(o.floorPosition);
  28066. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  28067. , p = (Math.abs(u.y),
  28068. Math.max(d, .01),
  28069. Math.max(0, Math.abs(u.y) - .2));
  28070. n = 0 < p ? (1,
  28071. p = Math.pow(4 * p, 2),
  28072. d = Math.pow(d, 2),
  28073. Math.sqrt(p * p + d * d)) : (1,
  28074. u.length()),
  28075. a[o.id] = n,
  28076. s = !0
  28077. }
  28078. s ? c[r.id] = a : h += 1
  28079. }
  28080. this.map = c,
  28081. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  28082. }
  28083. ,
  28084. t.prototype.aStarSearch = function(e, t) {
  28085. var i = Date.now()
  28086. , n = new o({
  28087. start: e,
  28088. isEnd: function(e) {
  28089. return e === t
  28090. },
  28091. neighbor: function(e) {
  28092. var t = e.neighbourPanos || e.findNeighourPanos()
  28093. , i = [];
  28094. for (var n in t)
  28095. t[n] && i.push(this.index[n]); //add: t[n] &&
  28096. return i
  28097. }
  28098. .bind(this),
  28099. distance: function(e, t) {
  28100. return this.map[e.id][t.id]
  28101. }
  28102. .bind(this),
  28103. heuristic: function(e, t) {
  28104. return 1
  28105. }
  28106. .bind(this),
  28107. hash: function(e) {
  28108. return e.id
  28109. },
  28110. timeout: 5e3
  28111. });
  28112. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  28113. "success" !== n.status)
  28114. return T.debug("Did not find A* path from " + e + " to " + t),
  28115. null;
  28116. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  28117. var r = [];
  28118. return n.path.forEach(function(e) {
  28119. r.push(e.id)
  28120. }),
  28121. r
  28122. }
  28123. ,
  28124. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  28125. g = new w.Vector3,
  28126. m = new w.Vector3,
  28127. v = new w.Vector3,
  28128. y = new w.Vector3,
  28129. A = new w.Vector3,
  28130. C = new w.Vector3,
  28131. I = new w.Vector3,
  28132. E = [],
  28133. _ = new w.Vector3,
  28134. b = new w.Vector3,
  28135. function(e, t) {
  28136. if (e)
  28137. for (var i = function(e, t, i) {
  28138. return y.copy(t).sub(e),
  28139. y.dot(i)
  28140. }, n = function(e, t) {
  28141. return i(_, e.position, m) - i(_, t.position, m)
  28142. }, r = 0; r < e.length - 1; ) {
  28143. var o = e[r]
  28144. , a = e[r + 1]
  28145. , s = this.index[o]
  28146. , l = this.index[a];
  28147. _.copy(s.position),
  28148. b.copy(l.position),
  28149. E.length = 0,
  28150. f.copy(b).sub(_),
  28151. m.copy(f).normalize();
  28152. for (var c = 0; c < this.list.length; c++) {
  28153. var h = this.list[c];
  28154. y.copy(h.position).sub(_);
  28155. var u = y.dot(m);
  28156. 0 < u && (C.copy(m),
  28157. C.multiplyScalar(u),
  28158. A.copy(y),
  28159. A.sub(C),
  28160. A.length() < t && (g.copy(f).negate(),
  28161. v.copy(g).normalize(),
  28162. I.copy(h.position).sub(b),
  28163. 0 < I.dot(v) && E.push(h)))
  28164. }
  28165. if (0 < E.length) {
  28166. E.sort(n);
  28167. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  28168. e[d] = e[d - E.length];
  28169. for (var p = 0; p < E.length; p++)
  28170. e[p + r + 1] = E[p].id
  28171. }
  28172. r += E.length + 1
  28173. }
  28174. }
  28175. ),
  28176. /* t.prototype.fadeMarkerOpacity = function(e, t) {
  28177. var i = void 0 === e ? a.panorama.markerOpacity : e
  28178. , n = this.list.findIndex(function(e) {
  28179. return e.marker
  28180. });
  28181. if (!(n < 0)) {
  28182. var r = this.list[n].marker.material.opacity;
  28183. if (r !== e) {
  28184. var o = i - r;
  28185. s.trigger({
  28186. func: function(e, t) {
  28187. var i = r + e * o;
  28188. this.forEach(function(e) {
  28189. e.marker && (e.marker.material.opacity = i)
  28190. })
  28191. }
  28192. .bind(this),
  28193. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28194. name: "_fpm"
  28195. })
  28196. }
  28197. }
  28198. } */
  28199. t.prototype.fadeMarkerOpacity = function(e, t, gr) {
  28200. s.cancelById('fadeMarkerOpacity')
  28201. var n = this.list.findIndex(function (e) {
  28202. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  28203. return e.marker
  28204. })
  28205. if (n < 0) {
  28206. //logger.info('marker findIndex<0')
  28207. return
  28208. }
  28209. var group
  28210. var tran = function (list, index) {
  28211. list.member = list.member.filter(function (m) {
  28212. return m.marker && m.marker.material.opacity != list.toOp
  28213. })
  28214. s.trigger({
  28215. func: function (e, t) {
  28216. //e:0-1
  28217. list.member.forEach(function (m) {
  28218. var o = m.marker.oldOpacity
  28219. var i = o + e * (list.toOp - o)
  28220. m.marker && (m.marker.material.opacity = i)
  28221. })
  28222. }.bind(this),
  28223. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  28224. name: '_fpm_' + index,
  28225. id: 'fadeMarkerOpacity',
  28226. })
  28227. }
  28228. this.forEach(function (e) {
  28229. //先记录旧的opacity
  28230. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  28231. })
  28232. group = gr
  28233. /* if (e > 0 && gr) {
  28234. group = gr
  28235. } else {
  28236. group = [
  28237. {
  28238. member: this.list,
  28239. toOp: 0,
  28240. },
  28241. ]
  28242. } */
  28243. for (var i = 0; i < group.length; i++) {
  28244. tran(group[i], i)
  28245. }
  28246. }
  28247. ,
  28248. c.exports = t
  28249. }
  28250. ).call(this, "/js/util/PanoramaCollection.js")
  28251. }
  28252. , {
  28253. "../objects/Panorama": 148,
  28254. "../settings": 166,
  28255. "./IndexedCollection": 175,
  28256. "./aStar": 180,
  28257. "./common": 185,
  28258. "./logger": 189,
  28259. "./transitions": 195,
  28260. three: 217
  28261. }],
  28262. 179: [function(e, t, i) {
  28263. "use strict";
  28264. function n() {
  28265. this.actionSequence = [],
  28266. this.actionSequenceInProgress = !1
  28267. }
  28268. function r(e, t, i, n) {
  28269. c.trackAlways("zoom_" + e, {
  28270. from: t,
  28271. to: i,
  28272. pano: n
  28273. })
  28274. }
  28275. var o, a, s, l, c = e("../analytics");
  28276. n.prototype.reset = function(e) {
  28277. this.actionSequenceInProgress = !1,
  28278. this.actionSequence.length = 0
  28279. }
  28280. ,
  28281. n.prototype.addZoomAction = (a = o = null,
  28282. s = !1,
  28283. l = function() {
  28284. if (o = null,
  28285. 0 < this.actionSequence.length) {
  28286. var e = this.actionSequence[0].start
  28287. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28288. 1 === e ? function(e, t) {
  28289. r("initial", 1, e, t)
  28290. }(t, a) : function(e, t, i) {
  28291. r("followup", e, t, i)
  28292. }(e, t, a)
  28293. }
  28294. this.reset()
  28295. }
  28296. ,
  28297. function(e, t, i) {
  28298. if (e !== t) {
  28299. s || (l = l.bind(this),
  28300. s = !0),
  28301. o && (window.clearTimeout(o),
  28302. o = null),
  28303. i === a && this.actionSequenceInProgress || (this.reset(),
  28304. a = i),
  28305. this.actionSequenceInProgress = !0;
  28306. var n = {
  28307. start: e,
  28308. end: t
  28309. };
  28310. this.actionSequence.push(n),
  28311. o = window.setTimeout(l, 150)
  28312. }
  28313. }
  28314. ),
  28315. t.exports = n
  28316. }
  28317. , {
  28318. "../analytics": 4
  28319. }],
  28320. 180: [function(e, t, i) {
  28321. "use strict";
  28322. function g(e) {
  28323. if (void 0 === e.parent)
  28324. return [e.data];
  28325. var t = g(e.parent);
  28326. return t.push(e.data),
  28327. t
  28328. }
  28329. function m(e) {
  28330. return e.toString()
  28331. }
  28332. function v(e, t) {
  28333. return e.f - t.f
  28334. }
  28335. var y = e("Set")
  28336. , A = e("heap")
  28337. , C = e("dict");
  28338. t.exports = function(e) {
  28339. void 0 === e.timeout && (e.timeout = 1 / 0);
  28340. var t = e.hash || m
  28341. , i = {
  28342. data: e.start,
  28343. g: 0,
  28344. h: e.heuristic(e.start)
  28345. }
  28346. , n = i;
  28347. i.f = i.h;
  28348. var r = new y
  28349. , o = new A(v)
  28350. , a = C();
  28351. o.push(i),
  28352. a.set(t(i.data), i);
  28353. for (var s = new Date; o.size(); ) {
  28354. if (new Date - s > e.timeout)
  28355. return {
  28356. status: "timeout",
  28357. cost: n.g,
  28358. path: g(n)
  28359. };
  28360. var l = o.pop();
  28361. if (a.delete(t(l.data)),
  28362. e.isEnd(l.data))
  28363. return {
  28364. status: "success",
  28365. cost: l.g,
  28366. path: g(l)
  28367. };
  28368. r.add(t(l.data));
  28369. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28370. var u = c[h];
  28371. if (!r.contains(t(u))) {
  28372. var d = l.g + e.distance(l.data, u)
  28373. , p = a.get(t(u))
  28374. , f = !1;
  28375. if (void 0 === p)
  28376. p = {
  28377. data: u
  28378. },
  28379. a.set(t(u), p);
  28380. else {
  28381. if (p.g < d)
  28382. continue;
  28383. f = !0
  28384. }
  28385. p.parent = l,
  28386. p.g = d,
  28387. p.h = e.heuristic(u),
  28388. p.f = d + p.h,
  28389. p.h < n.h && (n = p),
  28390. f ? o.heapify() : o.push(p)
  28391. }
  28392. }
  28393. }
  28394. return {
  28395. status: "noPath",
  28396. cost: n.g,
  28397. path: g(n)
  28398. }
  28399. }
  28400. }
  28401. , {
  28402. Set: 196,
  28403. dict: 210,
  28404. heap: 211
  28405. }],
  28406. 181: [function(i, n, e) {
  28407. (function(e) {
  28408. "use strict";
  28409. function s(e, t, i) {
  28410. function n() {
  28411. l.warn("Retrying ", t),
  28412. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28413. }
  28414. var r = function(e, t, i) {
  28415. var n = new XMLHttpRequest;
  28416. if (i && "withCredentials"in n)
  28417. n.open(e, t, i);
  28418. else if ("undefined" != typeof XDomainRequest)
  28419. (n = new XDomainRequest).open(e, t);
  28420. else {
  28421. if (i)
  28422. throw "Browser does not support CORS!";
  28423. n.open(e, t)
  28424. }
  28425. return n
  28426. }(e, t, !1);
  28427. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28428. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28429. i.responseType)
  28430. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28431. r.responseType = i.responseType;
  28432. else {
  28433. if ("image/jpeg" !== i.responseType)
  28434. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28435. r.responseType = "arraybuffer"
  28436. }
  28437. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28438. i.auth && r.setRequestHeader("Authorization", i.auth),
  28439. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28440. r.setRequestHeader("Content-Type", "application/json")),
  28441. "object" == typeof i.headers)
  28442. for (var o in i.headers)
  28443. r.setRequestHeader(o, i.headers[o]);
  28444. var a = $.Deferred();
  28445. return r.onreadystatechange = function(e) {
  28446. if (4 === this.readyState)
  28447. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28448. i.retries++,
  28449. setTimeout(n, 1e3);
  28450. else if (200 === this.status) {
  28451. var t = function(e, t) {
  28452. var i = e.response;
  28453. if ("json" === t && "object" != typeof i)
  28454. try {
  28455. i = JSON.parse(e.responseText)
  28456. } catch (e) {
  28457. return void a.reject({
  28458. error: "Failed parsing JSON"
  28459. })
  28460. }
  28461. else if ("image/jpeg" === t) {
  28462. var n = new Uint8Array(e.response)
  28463. , r = new Blob([n],{
  28464. type: "image/jpeg"
  28465. })
  28466. , o = URL.createObjectURL(r);
  28467. (i = new Image).src = o,
  28468. i.crossOrigin = "Anonymous",
  28469. i.onload = function() {
  28470. URL.revokeObjectURL(o)
  28471. }
  28472. }
  28473. return i
  28474. }(this, i.responseType);
  28475. a.resolve(t)
  28476. } else
  28477. a.reject(this)
  28478. }
  28479. ,
  28480. r.onprogress = function(e) {
  28481. a.notify(e)
  28482. }
  28483. ,
  28484. r.send(i.data),
  28485. a.promise()
  28486. }
  28487. function o(e, t) {
  28488. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28489. return t.headers && function(t) {
  28490. return Object.keys(t).sort().map(function(e) {
  28491. return {
  28492. key: e,
  28493. value: t[e]
  28494. }
  28495. })
  28496. }(t.headers).forEach(function(e) {
  28497. i += "__" + e.key + ":" + e.value
  28498. }),
  28499. i
  28500. }
  28501. var t = i("./logger")
  28502. , a = i("../ab")
  28503. , l = new t(e);
  28504. window.URL = window.URL || window.webkitURL,
  28505. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28506. window.DATA = window.DATA || {},
  28507. n.exports = {
  28508. get: function(e, t) {
  28509. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28510. if (n) {
  28511. var r = function(e, t) {
  28512. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28513. }(e, t);
  28514. if (r)
  28515. return r
  28516. }
  28517. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28518. n && function(e, t, i) {
  28519. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28520. }(e, t, i),
  28521. i
  28522. },
  28523. post: function(e, t) {
  28524. return s("POST", e, t)
  28525. },
  28526. patch: function(e, t) {
  28527. return s("PATCH", e, t)
  28528. },
  28529. getImage: function(e, t) {
  28530. function i() {
  28531. l.warn("Retrying ", e),
  28532. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28533. }
  28534. var n = $.Deferred()
  28535. , r = new Image
  28536. , o = this;
  28537. return e = a.changeIfImageOptimzing(e),
  28538. null != t || (t = 3),
  28539. r.onerror = function() {
  28540. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28541. }
  28542. ,
  28543. r.onload = function() {
  28544. n.resolve(r)
  28545. }
  28546. ,
  28547. r.crossOrigin = "anonymous",
  28548. r.src = e,
  28549. n
  28550. }
  28551. }
  28552. }
  28553. ).call(this, "/js/util/ajax.js")
  28554. }
  28555. , {
  28556. "../ab": 3,
  28557. "./logger": 189
  28558. }],
  28559. 182: [function(e, t, i) {
  28560. "use strict";
  28561. function n(e, t) {
  28562. var i = window.navigator.userAgent.match(e);
  28563. return i = i ? i[1].split(t) : [],
  28564. {
  28565. major: parseInt(i[0]) || 0,
  28566. minor: parseInt(i[1]) || 0,
  28567. patch: parseInt(i[2]) || 0
  28568. }
  28569. }
  28570. var r = e("../exception/DeviceMismatchException");
  28571. t.exports = {
  28572. supportsFullscreen: function() {
  28573. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28574. },
  28575. isPointerLocked: function() {
  28576. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28577. },
  28578. requestFullscreen: function(e, t) {
  28579. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28580. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28581. },
  28582. requestPointerLock: function() {
  28583. var e;
  28584. if (document.fullscreenElement)
  28585. e = document.fullscreenElement();
  28586. else if (document.mozFullscreenElement)
  28587. e = document.mozFullscreenElement();
  28588. else if (document.mozFullScreenElement)
  28589. e = document.mozFullScreenElement();
  28590. else {
  28591. if (!document.webkitFullscreenElement)
  28592. return;
  28593. e = document.webkitFullscreenElement()
  28594. }
  28595. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28596. e.requestPointerLock(),
  28597. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28598. },
  28599. exitPointerLock: function() {
  28600. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28601. document.exitPointerLock()
  28602. },
  28603. exitFullscreen: function() {
  28604. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28605. },
  28606. details: function() {
  28607. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28608. return e ? {
  28609. name: e[1],
  28610. version: parseInt(e[2]),
  28611. platform: navigator.platform
  28612. } : {}
  28613. },
  28614. is: function(e) {
  28615. return this.details() && this.details().name === e
  28616. },
  28617. inIframe: function() {
  28618. return window.parent !== window
  28619. },
  28620. aspectRatio: function() {
  28621. var e = $("#player").width() / $("#player").height();
  28622. return isFinite(e) ? e : 0
  28623. },
  28624. userAgent: function() {
  28625. return window.navigator.userAgent
  28626. },
  28627. isLandscape: function() {
  28628. return this.isMobile && 1 < this.aspectRatio()
  28629. },
  28630. isSmallScreen: function() {
  28631. return screen.width / window.devicePixelRatio < 240
  28632. },
  28633. detectIE: function() {
  28634. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28635. },
  28636. detectSafari: function() {
  28637. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28638. },
  28639. detectFirefox: function() {
  28640. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28641. },
  28642. detectChrome: function() {
  28643. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28644. },
  28645. detectOpera: function() {
  28646. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28647. },
  28648. detectIOS: function() {
  28649. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28650. },
  28651. detectIPad: function() {
  28652. var e = window.navigator.userAgent;
  28653. return /iPad/.test(e)
  28654. },
  28655. detectIPod: function() {
  28656. var e = window.navigator.userAgent;
  28657. return /iPod/.test(e)
  28658. },
  28659. detectIPhone: function() {
  28660. var e = window.navigator.userAgent;
  28661. return /iPhone/.test(e)
  28662. },
  28663. detectAndroid: function() {
  28664. return -1 !== window.navigator.userAgent.indexOf("Android")
  28665. },
  28666. detectAndroidMobile: function() {
  28667. var e = window.navigator.userAgent;
  28668. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28669. },
  28670. detectSamsungNative: function() {
  28671. var e = window.navigator.userAgent;
  28672. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28673. },
  28674. detectSamsungS6: function() {
  28675. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28676. },
  28677. detectHUAWEI5X: function() {
  28678. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28679. },
  28680. detectWebVR: function() {
  28681. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28682. },
  28683. getVRDisplay: function() {
  28684. var t = $.Deferred();
  28685. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28686. 1 <= e.length && t.resolve(e[0]),
  28687. t.reject(null)
  28688. }),
  28689. t) : t.reject(null)
  28690. },
  28691. iosVersion: function() {
  28692. if (!this.detectIOS())
  28693. throw new r("Did not detect an iDevice");
  28694. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28695. },
  28696. androidVersion: function() {
  28697. if (!this.detectAndroid())
  28698. throw new r("Did not detect an Android based device");
  28699. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28700. },
  28701. valueFromCookie: function(e, t) {
  28702. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28703. if (!i)
  28704. return t;
  28705. var n = i[1];
  28706. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28707. }
  28708. }
  28709. Object.assign(window.browser, t.exports)
  28710. t.exports = window.browser
  28711. }
  28712. , {
  28713. "../exception/DeviceMismatchException": 56
  28714. }],
  28715. 183: [function(i, n, e) {
  28716. (function(e) {
  28717. "use strict";
  28718. var o = i("../controls/serializer")
  28719. , a = i("../util/math")
  28720. , s = i("./browser")
  28721. , l = i("../enum/Viewmode")
  28722. , t = i("../util/logger")
  28723. , c = i("three")
  28724. , h = new t(e);
  28725. n.exports = {
  28726. getStartCameraOptions: function(e, t) {
  28727. var i = function(e) {
  28728. var t = s.valueFromHash("start", "")
  28729. , i = {};
  28730. if ("" !== t) {
  28731. h.debug("Start override found in parameters, trying to parse..."),
  28732. i = function(e) {
  28733. return o.deserialize(e)
  28734. }(t) || {};
  28735. var n = s.valueFromHash("tag", null);
  28736. n && (i.tag = n),
  28737. i.panoId && (i.pano = e.get(i.panoId))
  28738. }
  28739. return i
  28740. }(t);
  28741. if (0 < Object.keys(i).length)
  28742. return i;
  28743. if (e.heroImage)
  28744. i = function(e, t) {
  28745. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28746. return {};
  28747. var i = {}
  28748. , n = e.heroImage.metadata;
  28749. h.debug("Using start position from thumbnail image"),
  28750. i.position = n.camera_position,
  28751. i.quaternion = n.camera_quaternion;
  28752. try {
  28753. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28754. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28755. } catch (e) {
  28756. h.debug(e.message)
  28757. }
  28758. return i
  28759. }(e, t);
  28760. else if (window.DATA.camera_start) {
  28761. var n = window.DATA.camera_start;
  28762. try {
  28763. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28764. i.position = (new c.Vector3).fromArray(n.camera.position),
  28765. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28766. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28767. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28768. h.debug("Using camera_start"),
  28769. h.debug("Modeldata pano: ", i.pano.quaternion),
  28770. h.debug("Camera start pano: ", n.pano.quaternion)),
  28771. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28772. } catch (e) {
  28773. h.warn(e.message)
  28774. if(i.mode == "panorama" && !i.pano){
  28775. i.pano = t.list[0]
  28776. }
  28777. }
  28778. }
  28779. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28780. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28781. i.pano = t.findClosest(i.position) ,
  28782. i.quaternion = i.pano.quaternion),
  28783. 0 === Object.keys(i).length) {
  28784. var r = t.list[0];
  28785. r && (i.mode = l.PANORAMA,
  28786. i.pano = r,
  28787. i.position = r.position,
  28788. i.quaternion = r.quaternion,
  28789. h.info("Starting at 1st pano " + r.id))
  28790. }
  28791. return i.mode = i.mode || l.DOLLHOUSE,
  28792. i
  28793. }
  28794. }
  28795. }
  28796. ).call(this, "/js/util/camera.js")
  28797. }
  28798. , {
  28799. "../controls/serializer": 14,
  28800. "../enum/Viewmode": 51,
  28801. "../util/logger": 189,
  28802. "../util/math": 190,
  28803. "./browser": 182,
  28804. three: 217
  28805. }],
  28806. 184: [function(e, t, i) {
  28807. "use strict";
  28808. function r(e, t, i) {
  28809. var n = t
  28810. , r = i;
  28811. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28812. }
  28813. function o(e, t, i) {
  28814. var n = t
  28815. , r = i;
  28816. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28817. }
  28818. var a = e("./MathLight");
  28819. t.exports = {
  28820. clampVFOV: function(e, t, i, n) {
  28821. return t < r(e, i, n) ? o(t, i, n) : e
  28822. },
  28823. getHFOVForCamera: function(e, t, i) {
  28824. return r(e.fov, t, i)
  28825. },
  28826. getHFOVFromVFOV: r,
  28827. getVFOVFromHFOV: o
  28828. }
  28829. window.MathLight = t.exports
  28830. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28831. var prec = Math.pow(10, - (precision || 4));
  28832. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28833. if(e1.w){
  28834. return s1 && Math.abs(e1.w - e2.w) < prec
  28835. }else return s1
  28836. }
  28837. }
  28838. , {
  28839. "./MathLight": 176
  28840. }],
  28841. 185: [function(e, t, i) {
  28842. "use strict";
  28843. var a = e("three");
  28844. t.exports = {
  28845. delayOneFrame: function(e) {
  28846. window.setTimeout(e, 1)
  28847. },
  28848. normalizeUrl: function(e) {
  28849. return e.replace("https://", "http://")
  28850. },
  28851. domainFromUrl: function(e) {
  28852. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28853. return t ? t[3] : e
  28854. },
  28855. average: function(e, t) {
  28856. if (0 === e.length)
  28857. return null;
  28858. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28859. i += t ? e[r][t] : e[r],
  28860. n++
  28861. }
  28862. return i / n
  28863. },
  28864. countUnique: function(e) {
  28865. for (var t = {}, i = 0; i < e.length; i++)
  28866. t[e[i]] = 1 + (t[e[i]] || 0);
  28867. return Object.keys(t).length
  28868. },
  28869. averageVectors: function(e, t) {
  28870. var i = new a.Vector3;
  28871. if (0 === e.length)
  28872. return i;
  28873. for (var n = 0, r = 0; r < e.length; r++) {
  28874. var o = t ? e[r][t] : e[r];
  28875. i.add(o),
  28876. n++
  28877. }
  28878. return i.divideScalar(n)
  28879. },
  28880. equalLists: function(e, t) {
  28881. if (e.length !== t.length)
  28882. return !1;
  28883. for (var i = 0; i < e.length; i++)
  28884. if (e[i] !== t[i])
  28885. return !1;
  28886. return !0
  28887. },
  28888. lowerMedian: function(e, t) {
  28889. return 0 === e.length ? null : (t = t || 2,
  28890. e.sort(function(e, t) {
  28891. return e - t
  28892. }),
  28893. e[Math.floor(e.length / t)])
  28894. },
  28895. stableSort: function(e, n) {
  28896. return e.map(function(e, t) {
  28897. return {
  28898. value: e,
  28899. index: t
  28900. }
  28901. }).sort(function(e, t) {
  28902. var i = n(e.value, t.value);
  28903. return 0 !== i ? i : e.index - t.index
  28904. }).map(function(e) {
  28905. return e.value
  28906. })
  28907. },
  28908. filterAll: function(e, i) {
  28909. return e.filter(function(t) {
  28910. return i.every(function(e) {
  28911. return e(t)
  28912. })
  28913. })
  28914. },
  28915. formatDate: function(e) {
  28916. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28917. },
  28918. formatDatetime: function(e) {
  28919. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28920. },
  28921. randomString: function(e) {
  28922. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28923. t += i.charAt(Math.floor(Math.random() * i.length));
  28924. return t
  28925. },
  28926. uint8ToBase64: function(e, t) {
  28927. t && "number" == typeof t || (t = 8192);
  28928. for (var i = [], n = 0; n < e.length; n += t)
  28929. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28930. return btoa(i.join(""))
  28931. },
  28932. uuid4: function e(t) {
  28933. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28934. },
  28935. nth: function(e) {
  28936. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28937. },
  28938. extendObject: function(t, i) {
  28939. return Object.keys(i).forEach(function(e) {
  28940. t[e] = i[e]
  28941. }),
  28942. t
  28943. },
  28944. deepExtend: function e(t) {
  28945. t = t || {};
  28946. for (var i = 1; i < arguments.length; i++) {
  28947. var n = arguments[i];
  28948. if (n)
  28949. for (var r in n)
  28950. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28951. }
  28952. return t
  28953. },
  28954. inherit: function(e, t) {
  28955. e.prototype = Object.create(t.prototype),
  28956. e.prototype.constructor = e
  28957. },
  28958. extend: function(e, t) {
  28959. for (var i in t.prototype)
  28960. e.prototype[i] = t.prototype[i]
  28961. },
  28962. getFileNameFromUrl:function(url){
  28963. return url.split('/').pop();
  28964. },
  28965. },
  28966. Math.sign = function(e) {
  28967. return e < 0 ? -1 : 1
  28968. }
  28969. window.common = t.exports
  28970. expandCommon(common)
  28971. }
  28972. , {
  28973. three: 217
  28974. }],
  28975. 186: [function(e, t, i) {
  28976. "use strict";
  28977. var r = {
  28978. linearTween: function(e, t, i, n) {
  28979. return i * e / n + t
  28980. },
  28981. easeInQuad: function(e, t, i, n) {
  28982. return i * (e /= n) * e + t
  28983. },
  28984. easeOutQuad: function(e, t, i, n) {
  28985. return -i * (e /= n) * (e - 2) + t
  28986. },
  28987. easeInOutQuad: function(e, t, i, n) {
  28988. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28989. },
  28990. easeInCubic: function(e, t, i, n) {
  28991. return i * (e /= n) * e * e + t
  28992. },
  28993. easeOutCubic: function(e, t, i, n) {
  28994. return e /= n,
  28995. i * (--e * e * e + 1) + t
  28996. },
  28997. easeInOutCubic: function(e, t, i, n) {
  28998. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28999. },
  29000. easeInQuart: function(e, t, i, n) {
  29001. return i * (e /= n) * e * e * e + t
  29002. },
  29003. easeOutQuart: function(e, t, i, n) {
  29004. return e /= n,
  29005. -i * (--e * e * e * e - 1) + t
  29006. },
  29007. easeInOutQuart: function(e, t, i, n) {
  29008. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  29009. },
  29010. easeInQuint: function(e, t, i, n) {
  29011. return i * (e /= n) * e * e * e * e + t
  29012. },
  29013. easeOutQuint: function(e, t, i, n) {
  29014. return e /= n,
  29015. i * (--e * e * e * e * e + 1) + t
  29016. },
  29017. easeInOutQuint: function(e, t, i, n) {
  29018. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  29019. },
  29020. easeInSine: function(e, t, i, n) {
  29021. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  29022. },
  29023. easeOutSine: function(e, t, i, n) {
  29024. return i * Math.sin(e / n * (Math.PI / 2)) + t
  29025. },
  29026. easeInOutSine: function(e, t, i, n) {
  29027. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  29028. },
  29029. easeInExpo: function(e, t, i, n) {
  29030. return i * Math.pow(2, 10 * (e / n - 1)) + t
  29031. },
  29032. easeOutExpo: function(e, t, i, n) {
  29033. return i * (1 - Math.pow(2, -10 * e / n)) + t
  29034. },
  29035. easeInOutExpo: function(e, t, i, n) {
  29036. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  29037. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  29038. },
  29039. easeInCirc: function(e, t, i, n) {
  29040. return e /= n,
  29041. -i * (Math.sqrt(1 - e * e) - 1) + t
  29042. },
  29043. easeOutCirc: function(e, t, i, n) {
  29044. return e /= n,
  29045. e--,
  29046. i * Math.sqrt(1 - e * e) + t
  29047. },
  29048. easeInOutCirc: function(e, t, i, n) {
  29049. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  29050. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  29051. },
  29052. easeInElastic: function(e, t, i, n) {
  29053. var r = 1.70158
  29054. , o = 0
  29055. , a = i;
  29056. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29057. r = a < Math.abs(i) ? (a = i,
  29058. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29059. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  29060. },
  29061. easeOutElastic: function(e, t, i, n) {
  29062. var r = 1.70158
  29063. , o = 0
  29064. , a = i;
  29065. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29066. r = a < Math.abs(i) ? (a = i,
  29067. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29068. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  29069. },
  29070. easeInOutElastic: function(e, t, i, n) {
  29071. var r = 1.70158
  29072. , o = 0
  29073. , a = i;
  29074. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  29075. r = a < Math.abs(i) ? (a = i,
  29076. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29077. 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)
  29078. },
  29079. easeInBack: function(e, t, i, n, r) {
  29080. return void 0 === r && (r = 1.70158),
  29081. i * (e /= n) * e * ((r + 1) * e - r) + t
  29082. },
  29083. easeOutBack: function(e, t, i, n, r) {
  29084. return void 0 === r && (r = 1.70158),
  29085. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29086. },
  29087. easeInOutBack: function(e, t, i, n, r) {
  29088. return void 0 === r && (r = 1.70158),
  29089. (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
  29090. },
  29091. easeOutBounce: function(e, t, i, n) {
  29092. 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
  29093. },
  29094. easeInBounce: function(e, t, i, n) {
  29095. return i - r.easeOutBounce(n - e, 0, i, n) + t
  29096. },
  29097. easeInOutBounce: function(e, t, i, n) {
  29098. 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
  29099. }
  29100. };
  29101. window.easing = t.exports = r
  29102. }
  29103. , {}],
  29104. 187: [function(e, t, i) {
  29105. "use strict";
  29106. function n() {
  29107. this.events = [],
  29108. this.valid = !1
  29109. }
  29110. var r = e("../enum/Joystick");
  29111. n.prototype.push = function(e, t) {
  29112. this.events.push({
  29113. direction: e,
  29114. pano: t
  29115. }),
  29116. this.valid = !0
  29117. }
  29118. ,
  29119. n.prototype.pop = function(e) {
  29120. var t = this.events.pop();
  29121. return this.events.length < 1 && (this.valid = !1),
  29122. t
  29123. }
  29124. ,
  29125. n.prototype.peek = function() {
  29126. return this.events.length ? this.events[this.events.length - 1] : {
  29127. direction: null,
  29128. pano: null
  29129. }
  29130. }
  29131. ,
  29132. n.prototype.invalidate = function() {
  29133. this.events = [],
  29134. this.valid = !1
  29135. }
  29136. ,
  29137. n.prototype.reversePano = function(e) {
  29138. if (!this.valid)
  29139. return null;
  29140. var t = this.peek();
  29141. return r.opposite(e) === t.direction ? (this.pop(),
  29142. t.pano) : null
  29143. }
  29144. ,
  29145. t.exports = n
  29146. }
  29147. , {
  29148. "../enum/Joystick": 29
  29149. }],
  29150. 188: [function(e, t, i) {
  29151. "use strict";
  29152. window.lerp = t.exports = {
  29153. vector: function(t, i) {
  29154. var n = t.clone();
  29155. return i = i.clone(),
  29156. function(e) {
  29157. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29158. }
  29159. },
  29160. quaternion: function(t, i) {
  29161. var n = t.clone();
  29162. return function(e) {
  29163. t.copy(n).slerp(i, e)
  29164. }
  29165. },
  29166. property: function(t, i, n, r) {
  29167. var o = t[i];
  29168. return function(e) {
  29169. t[i] = o * (1 - e) + n * e,
  29170. r && r(t[i])
  29171. }
  29172. },
  29173. uniform: function(t, i, n) {
  29174. var r = t.material.uniforms[i].value;
  29175. return function(e) {
  29176. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29177. }
  29178. },
  29179. matrix4: function(o, a) {
  29180. var s = o.clone();
  29181. return function(e) {
  29182. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  29183. t[r] = i[r] * (1 - e) + n[r] * e
  29184. }
  29185. },
  29186. allUniforms: function(e, t, i) {
  29187. var n = e.map(function(e) {
  29188. return this.uniform(e, t, i)
  29189. }
  29190. .bind(this));
  29191. return function(t) {
  29192. n.forEach(function(e) {
  29193. e(t)
  29194. })
  29195. }
  29196. }
  29197. }
  29198. }
  29199. , {}],
  29200. 189: [function(e, t, i) {
  29201. "use strict";
  29202. function h(n) {
  29203. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  29204. if (h.consoleEnabled) {
  29205. var l = function(e) {
  29206. $("#debug-console").append("<p>" + e + "</p>"),
  29207. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29208. };
  29209. e = function(e) {
  29210. l(Array.prototype.slice.call(arguments).join(" "))
  29211. }
  29212. ,
  29213. t = function(e) {
  29214. l(Array.prototype.slice.call(arguments).join(" "))
  29215. }
  29216. ,
  29217. i = function(e) {
  29218. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29219. }
  29220. ,
  29221. r = function(e) {
  29222. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29223. }
  29224. } else
  29225. console.log ? (e = console.log,
  29226. t = console.info ? console.info : console.log,
  29227. i = console.warn ? console.warn : console.log,
  29228. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29229. ;
  29230. function c(e) {
  29231. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29232. }
  29233. return {
  29234. debug: function() {
  29235. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29236. },
  29237. info: function() {
  29238. h.level >= h.levels.info && t.apply(console, c(arguments))
  29239. },
  29240. warn: function() {
  29241. (function(e, t) {
  29242. if (u) {
  29243. var i = Array.prototype.slice.call(e).join(" ");
  29244. u.captureMessage(i, {
  29245. level: t,
  29246. path: n,
  29247. timestamp: h.timestamp()
  29248. })
  29249. }
  29250. }
  29251. )(arguments, "warn"),
  29252. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29253. },
  29254. error: function() {
  29255. (function(e, t) {
  29256. if (u) {
  29257. var i = Array.prototype.slice.call(e).join(" ");
  29258. u.captureException(new Error(i), {
  29259. level: t,
  29260. path: n,
  29261. timestamp: h.timestamp()
  29262. })
  29263. }
  29264. }
  29265. )(arguments, "error"),
  29266. h.level >= h.levels.error && r.apply(console, c(arguments))
  29267. },
  29268. v3str: function(e, t) {
  29269. var i = void 0 === t ? 2 : t;
  29270. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29271. },
  29272. eulstr: function(e, t) {
  29273. var i = void 0 === t ? 2 : t;
  29274. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29275. },
  29276. time: function(e) {
  29277. h.level >= h.levels.debug && (s[e] = Date.now())
  29278. },
  29279. timeEnd: function(e) {
  29280. if (h.level >= h.levels.debug) {
  29281. var t = s[e];
  29282. if (!t)
  29283. return;
  29284. var i = (Date.now() - t) / 1e3;
  29285. this.debug(e, i + "s")
  29286. }
  29287. }
  29288. }
  29289. }
  29290. var u = window.Raven;
  29291. h.timestamp = function() {
  29292. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29293. }
  29294. ,
  29295. h.level = (h.levels = {
  29296. debug: 3,
  29297. info: 2,
  29298. warn: 1,
  29299. error: 0
  29300. }).info,
  29301. t.exports = h
  29302. }
  29303. , {}],
  29304. 190: [function(e, t, i) {
  29305. "use strict";
  29306. var o = e("three")
  29307. , r = e("../enum/GLCubeFaces");
  29308. e("../constants");
  29309. t.exports = {
  29310. convertVisionVector: function(e) {
  29311. return new o.Vector3(e.x,e.z,-e.y)
  29312. },
  29313. convertVisionQuaternion: function(e) {
  29314. 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)))
  29315. },
  29316. convertWorkshopVector: function(e) {
  29317. return new o.Vector3(-e.x,e.y,e.z)
  29318. },
  29319. convertWorkshopQuaternion: function(e) {
  29320. 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))
  29321. },
  29322. convertWorkshopPanoramaQuaternion: function(e) {
  29323. 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)))
  29324. },
  29325. convertWorkshopOrthoZoom: function(e) {
  29326. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29327. },
  29328. toPrecision: function(e, t) {
  29329. function i(e, t) {
  29330. var i = Math.pow(10, t);
  29331. return Math.round(e * i) / i
  29332. }
  29333. if (e instanceof Array) {
  29334. for (var n = 0; n < e.length; n++)
  29335. e[n] = i(e[n], t);
  29336. return e
  29337. }
  29338. return i(e, t)
  29339. },
  29340. isEmptyQuaternion: function(e) {
  29341. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29342. },
  29343. projectPositionToCanvas: function(e, t, i) {
  29344. (i = i || new o.Vector3).copy(e);
  29345. var n = .5 * $("#player").width()
  29346. , r = .5 * $("#player").height();
  29347. return i.project(t),
  29348. i.x = i.x * n + n,
  29349. i.y = -i.y * r + r,
  29350. i
  29351. },
  29352. convertScreenPositionToNDC: function(e, t, i) {
  29353. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29354. i.y = -t / $("#player").height() * 2 + 1,
  29355. i
  29356. },
  29357. constrainedTurn: function(e) {
  29358. var t = e % (2 * Math.PI);
  29359. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29360. },
  29361. getFOVDotThreshold: function(e) {
  29362. return Math.cos(o.Math.degToRad(e / 2))
  29363. },
  29364. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29365. switch (e) {
  29366. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29367. i.set(1, t.y, t.x);
  29368. break;
  29369. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29370. i.set(-1, t.y, -t.x);
  29371. break;
  29372. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29373. i.set(-t.x, 1, -t.y);
  29374. break;
  29375. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29376. i.set(-t.x, -1, t.y);
  29377. break;
  29378. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29379. i.set(-t.x, t.y, 1);
  29380. break;
  29381. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29382. i.set(t.x, t.y, -1)
  29383. }
  29384. n && i.normalize()
  29385. },
  29386. //add:
  29387. getPos2d : function(point, camera, dom){
  29388. var camera = camera ;
  29389. var dom = dom;
  29390. 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);
  29391. var x,y;
  29392. x = (pos.x + 1) / 2 * dom.clientWidth;
  29393. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29394. var inSight = x <= dom.clientWidth && x >= 0
  29395. && y <= dom.clientHeight && y >= 0
  29396. return {
  29397. pos: new THREE.Vector2(x,y),
  29398. vector: pos,
  29399. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29400. inSight : inSight //在屏幕范围内可见
  29401. };
  29402. },
  29403. getDirByLonLat: function(lon, lat) {
  29404. var dir = new THREE.Vector3();
  29405. var phi = THREE.Math.degToRad(90 - lat);
  29406. var theta = THREE.Math.degToRad(lon);
  29407. dir.x = Math.sin(phi) * Math.cos(theta);
  29408. dir.y = Math.cos(phi);
  29409. dir.z = Math.sin(phi) * Math.sin(theta);
  29410. return dir.negate();
  29411. }
  29412. }
  29413. window.math = t.exports
  29414. expandMath(math)
  29415. }
  29416. , {
  29417. "../constants": 8,
  29418. "../enum/GLCubeFaces": 25,
  29419. three: 217
  29420. }],
  29421. 191: [function(e, t, i) {
  29422. "use strict";
  29423. function o(e) {
  29424. return r[e]
  29425. }
  29426. var n = e("../enum/GLCubeFaces")
  29427. , a = [0, 1, 2, 3, 4, 5]
  29428. , r = {
  29429. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29430. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29431. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29432. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29433. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29434. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29435. };
  29436. t.exports = {
  29437. mapFaceToCubemapFace: o,
  29438. getCubemapUrls: function(i, n, r) {
  29439. return a.map(function(e, t) {
  29440. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29441. }
  29442. .bind(this))
  29443. }
  29444. }
  29445. }
  29446. , {
  29447. "../enum/GLCubeFaces": 25
  29448. }],
  29449. 192: [function(e, t, i) {
  29450. "use strict";
  29451. t.exports = {
  29452. captureErrors: function(e, t, i) {
  29453. if ("Raven"in window) {
  29454. Raven.config(e, t).install(),
  29455. i && Raven.setTagsContext(i);
  29456. var n = console.warn
  29457. , r = console.error;
  29458. console.warn = function() {
  29459. var e = Array.prototype.slice.call(arguments);
  29460. Raven.captureMessage(e.join(" "), {
  29461. level: "warning"
  29462. }),
  29463. n.apply(console, e)
  29464. }
  29465. ,
  29466. console.error = function() {
  29467. var e = Array.prototype.slice.call(arguments);
  29468. Raven.captureException(new Error(e.join(" ")), {
  29469. level: "error"
  29470. }),
  29471. r.apply(console, e)
  29472. }
  29473. } else
  29474. console.error("Raven not found, not capturing errors.")
  29475. }
  29476. }
  29477. }
  29478. , {}],
  29479. 193: [function(c, h, e) {
  29480. (function(e) {
  29481. "use strict";
  29482. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29483. getAuthorizationHeader: function() {
  29484. var e = n.valueFromHash("auth");
  29485. if (e)
  29486. return e.replace(",", " ");
  29487. var t = n.valueFromCookie("token");
  29488. return t ? "Token " + t : null
  29489. },
  29490. parseSidUrl: function(e) {
  29491. var t, i;
  29492. if (t = g_Prefix,
  29493. (e = e || "").match(/^https?/)) {
  29494. o.parse(e);
  29495. t = g_Prefix,
  29496. i = e
  29497. } else
  29498. i = (t = g_Prefix) + "data/" + e;
  29499. return {
  29500. urlBase: t,
  29501. urlModel: i,
  29502. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29503. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29504. }
  29505. },
  29506. getModelIDFromQueryString: function() {
  29507. return n.valueFromHash("model") || n.valueFromHash("m")
  29508. },
  29509. /* normalizeModeldata: function(e, i) {
  29510. e = JSON.parse(JSON.stringify(e));
  29511. var n = null;
  29512. if (e.images.forEach(function(t) {
  29513. if (t.metadata) {
  29514. if ("string" == typeof t.metadata)
  29515. try {
  29516. t.metadata = JSON.parse(t.metadata)
  29517. } catch (e) {
  29518. s.warn("Unable to parse image metadata"),
  29519. t.metadata = null
  29520. }
  29521. else
  29522. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29523. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29524. 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)),
  29525. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29526. t.metadata.zoom = t.metadata.zoom || 1),
  29527. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29528. }
  29529. }),
  29530. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29531. var t = {};
  29532. t.pano = {
  29533. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29534. position: i.convertWorkshopVector(n.scan_position),
  29535. uuid: n.scan_id
  29536. },
  29537. t.camera = {
  29538. quaternion: n.camera_quaternion,
  29539. position: n.camera_position
  29540. },
  29541. e.startPano = t
  29542. }
  29543. return e
  29544. }, */
  29545. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29546. e = JSON.parse(JSON.stringify(e));
  29547. var i = null;
  29548. var deal = function(n) {
  29549. if(!n.metadata) return;
  29550. if ("string" == typeof n.metadata)
  29551. try {
  29552. n.metadata = JSON.parse(n.metadata)
  29553. } catch (e) {
  29554. s.warn("Unable to parse image metadata"),
  29555. n.metadata = null
  29556. }
  29557. else{
  29558. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29559. }
  29560. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29561. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29562. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29563. }else{
  29564. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29565. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29566. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29567. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29568. }
  29569. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29570. }
  29571. //改
  29572. e.images.forEach(info=>{
  29573. if(info.locations){
  29574. info.locations.forEach(a=>deal(a))
  29575. }else{
  29576. deal(info)
  29577. }
  29578. })
  29579. //icon初始视角的:
  29580. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29581. var n = {};
  29582. n.pano = {
  29583. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29584. position: t.convertWorkshopVector(i.scan_position),
  29585. uuid: i.scan_id
  29586. },
  29587. n.camera = {
  29588. quaternion: i.camera_quaternion,
  29589. position: i.camera_position
  29590. },
  29591. e.startPano = n
  29592. }
  29593. return e
  29594. },
  29595. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29596. function(e) {
  29597. if (!e)
  29598. throw new Error("Vision version is required");
  29599. var t = i.exec(e);
  29600. if (null === t)
  29601. throw new Error("String is not a vision version: " + e);
  29602. return parseInt(t[1])
  29603. }
  29604. ),
  29605. modelDataPromisesTiles: function(e) {
  29606. var t = e.vision_version || window.DATA.vision_version;
  29607. if (t)
  29608. try {
  29609. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29610. } catch (e) {
  29611. s.warn("Invalid vision version: " + t)
  29612. }
  29613. return !1
  29614. }
  29615. };
  29616. h.exports = l
  29617. }
  29618. ).call(this, "/js/util/showcase.js")
  29619. }
  29620. , {
  29621. "../constants": 8,
  29622. "./browser": 182,
  29623. "./logger": 189,
  29624. three: 217,
  29625. url: 208
  29626. }],
  29627. 194: [function(e, t, i) {
  29628. "use strict";
  29629. var r = e("../util/ajax")
  29630. , o = e("three")
  29631. , a = e("../settings")
  29632. , s = {};
  29633. t.exports = {
  29634. load: function(e, t, i) {
  29635. var n = s[e];
  29636. return n ? t && setTimeout(function() {
  29637. t(n)
  29638. }, 1) : (n = new o.Texture,
  29639. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29640. n.magFilter = o.LinearFilter,
  29641. n.generateMipmaps = !1),
  29642. n.sourceFile = e,
  29643. s[e] = n,
  29644. r.getImage(e).then(function(e) {
  29645. n.image = e,
  29646. n.needsUpdate = !0,
  29647. t && t(n)
  29648. }).fail(i)),
  29649. n
  29650. },
  29651. loadBase64: function(e, t) {
  29652. t = t || "png";
  29653. var i = new o.Texture;
  29654. return i.image = document.createElement("img"),
  29655. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29656. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29657. i.magFilter = o.LinearFilter,
  29658. i.generateMipmaps = !1),
  29659. i.needsUpdate = !0,
  29660. i
  29661. },
  29662. isLoaded: function(e) {
  29663. return !!s[e]
  29664. }
  29665. }
  29666. window.Texture = t.exports
  29667. }
  29668. , {
  29669. "../settings": 166,
  29670. "../util/ajax": 181,
  29671. three: 217
  29672. }],
  29673. 195: [function(e, t, i) {
  29674. "use strict";
  29675. var l = e("./easing");
  29676. window.transitions = t.exports = {
  29677. globalDone: null,
  29678. funcs: [],
  29679. counter: 0,
  29680. uniqueID: 0,
  29681. start: function(e, t, i, n, r, o, a) {
  29682. return n = n || 0,
  29683. this.funcs.push({
  29684. func: e,
  29685. current: -n * Math.abs(t),
  29686. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29687. done: i,
  29688. easing: r || l.linearTween,
  29689. cycling: t < 0,
  29690. running: !0,
  29691. debug: n < 0,
  29692. name: o || "T" + this.counter,
  29693. id: void 0 === a ? this.counter : a,
  29694. paused: !1
  29695. }),
  29696. e(0, 16),
  29697. this.counter += 1,
  29698. e
  29699. },
  29700. trigger: function(e) {
  29701. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29702. , i = e.func || function() {}
  29703. , n = void 0 === e.duration ? 0 : e.duration;
  29704. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29705. var r = e.done || null
  29706. , o = e.easing || l.linearTween
  29707. , a = e.name || "R" + this.counter
  29708. , s = void 0 === e.id ? this.counter : e.id;
  29709. return this.start(i, n, r, t, o, a, s)
  29710. },
  29711. setTimeout: function(e, t, i) {
  29712. var n = void 0 === i ? this.counter : i;
  29713. return this.trigger({
  29714. done: e,
  29715. duration: void 0 === t ? 0 : t,
  29716. name: "O" + this.counter,
  29717. id: n
  29718. })
  29719. },
  29720. pause: function() {
  29721. this.paused = !0
  29722. },
  29723. resume: function() {
  29724. this.paused = !1
  29725. },
  29726. update: function(n) {
  29727. this.funcs.forEach(function(e) {
  29728. if (!(e.paused || (e.current += 1e3 * n,
  29729. e.current < 0)))
  29730. if (e.current >= e.duration && !e.cycling) {
  29731. var t = e.easing(1, 0, 1, 1);
  29732. e.func(t, 1e3 * n),
  29733. e.done && e.done(),
  29734. e.running = !1
  29735. } else {
  29736. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29737. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29738. e.running = !1)
  29739. }
  29740. });
  29741. var e = this.funcs.length;
  29742. this.funcs = this.funcs.filter(function(e) {
  29743. return e.running
  29744. });
  29745. var t = this.funcs.length;
  29746. if (0 < e && 0 === t && this.globalDone) {
  29747. var i = this.globalDone;
  29748. this.globalDone = null,
  29749. i()
  29750. }
  29751. },
  29752. adjustSpeed: function(e, t) {
  29753. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29754. var r = i[n];
  29755. r.duration /= t,
  29756. r.current /= t
  29757. }
  29758. },
  29759. getById: function(t) {
  29760. return this.funcs.filter(function(e) {
  29761. return t === e.id
  29762. })
  29763. },
  29764. get: function(e) {
  29765. for (var t = 0; t < this.funcs.length; t += 1)
  29766. if (this.funcs[t].func === e)
  29767. return this.funcs[t];
  29768. return null
  29769. },
  29770. isRunning: function(e) {
  29771. var t = this.get(e);
  29772. return null !== t && t.running
  29773. },
  29774. countActive: function() {
  29775. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29776. e += this.funcs[t].running;
  29777. return e
  29778. },
  29779. listActive: function() {
  29780. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29781. this.funcs[t].running && e.push(this.funcs[t].name);
  29782. return e
  29783. },
  29784. done: function(e) {
  29785. this.globalDone = e
  29786. },
  29787. cancelById: function(e) {
  29788. var t = void 0 === e ? 0 : e;
  29789. this.funcs = this.funcs.filter(function(e) {
  29790. return e.id !== t
  29791. })
  29792. },
  29793. cancel: function(t) {
  29794. this.funcs = this.funcs.filter(function(e) {
  29795. return e.func !== t
  29796. })
  29797. },
  29798. getUniqueId: function() {
  29799. return this.uniqueID -= 1,
  29800. this.uniqueID
  29801. }
  29802. }
  29803. }
  29804. , {
  29805. "./easing": 186
  29806. }],
  29807. 196: [function(e, t, i) {
  29808. function n(e) {
  29809. if (this.set = {},
  29810. this.infContains = function() {
  29811. return !0
  29812. }
  29813. ,
  29814. "object" == typeof e)
  29815. if (e instanceof Array)
  29816. for (var t = 0; t < e.length; t++)
  29817. this.set[e[t]] = !0;
  29818. else
  29819. this.set = e;
  29820. else if ("function" == typeof e)
  29821. this.infContains = e;
  29822. else if (void 0 !== e)
  29823. throw new Error("set must be either an array or an object.")
  29824. }
  29825. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29826. return !!this.set[e]
  29827. }
  29828. ,
  29829. n.prototype.add = function(e) {
  29830. if (1 == arguments.length)
  29831. this.set[e] = !0;
  29832. else
  29833. for (var t = 0; t < arguments.length; t++)
  29834. this.set[arguments[t]] = !0
  29835. }
  29836. ,
  29837. n.prototype.addAll = function(e) {
  29838. if ("object" != typeof e && !(e instanceof Array))
  29839. throw new Error("arr must be an array.");
  29840. for (var t = 0; t < e.length; t++)
  29841. this.add(e[t])
  29842. }
  29843. ,
  29844. n.prototype.delete = n.prototype.remove = function(e) {
  29845. if (1 == arguments.length)
  29846. delete this.set[e];
  29847. else
  29848. for (var t = 0; t < arguments.length; t++)
  29849. delete this.set[arguments[t]]
  29850. }
  29851. ,
  29852. n.prototype.clear = function() {
  29853. this.set = {}
  29854. }
  29855. ,
  29856. n.prototype.size = function() {
  29857. return Object.keys(this.set).length
  29858. }
  29859. ,
  29860. n.prototype.toString = function() {
  29861. return "{" + Object.keys(this.set).toString() + "}"
  29862. }
  29863. ,
  29864. n.prototype["*values"] = n.prototype.toArray = function() {
  29865. return void 0 === this.set ? [] : Object.keys(this.set)
  29866. }
  29867. }
  29868. , {}],
  29869. 197: [function(e, t, i) {}
  29870. , {}],
  29871. 198: [function(N, e, F) {
  29872. (function(e) {
  29873. "use strict";
  29874. function i() {
  29875. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29876. }
  29877. function o(e, t) {
  29878. if (i() < t)
  29879. throw new RangeError("Invalid typed array length");
  29880. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29881. e.length = t),
  29882. e
  29883. }
  29884. function u(e, t, i) {
  29885. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29886. return new u(e,t,i);
  29887. if ("number" != typeof e)
  29888. return n(this, e, t, i);
  29889. if ("string" == typeof t)
  29890. throw new Error("If encoding is specified then the first argument must be a string");
  29891. return a(this, e)
  29892. }
  29893. function n(e, t, i, n) {
  29894. if ("number" == typeof t)
  29895. throw new TypeError('"value" argument must not be a number');
  29896. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29897. if (t.byteLength,
  29898. i < 0 || t.byteLength < i)
  29899. throw new RangeError("'offset' is out of bounds");
  29900. if (t.byteLength < i + (n || 0))
  29901. throw new RangeError("'length' is out of bounds");
  29902. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29903. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29904. e
  29905. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29906. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29907. !u.isEncoding(i))
  29908. throw new TypeError('"encoding" must be a valid string encoding');
  29909. var n = 0 | c(t, i)
  29910. , r = (e = o(e, n)).write(t, i);
  29911. return r !== n && (e = e.slice(0, r)),
  29912. e
  29913. }(e, t, i) : function(e, t) {
  29914. if (u.isBuffer(t)) {
  29915. var i = 0 | l(t.length);
  29916. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29917. e
  29918. }
  29919. if (t) {
  29920. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29921. return "number" != typeof t.length || function(e) {
  29922. return e != e
  29923. }(t.length) ? o(e, 0) : s(e, t);
  29924. if ("Buffer" === t.type && L(t.data))
  29925. return s(e, t.data)
  29926. }
  29927. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29928. }(e, t)
  29929. }
  29930. function r(e) {
  29931. if ("number" != typeof e)
  29932. throw new TypeError('"size" argument must be a number');
  29933. if (e < 0)
  29934. throw new RangeError('"size" argument must not be negative')
  29935. }
  29936. function a(e, t) {
  29937. if (r(t),
  29938. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29939. !u.TYPED_ARRAY_SUPPORT)
  29940. for (var i = 0; i < t; ++i)
  29941. e[i] = 0;
  29942. return e
  29943. }
  29944. function s(e, t) {
  29945. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29946. e = o(e, i);
  29947. for (var n = 0; n < i; n += 1)
  29948. e[n] = 255 & t[n];
  29949. return e
  29950. }
  29951. function l(e) {
  29952. if (e >= i())
  29953. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29954. return 0 | e
  29955. }
  29956. function c(e, t) {
  29957. if (u.isBuffer(e))
  29958. return e.length;
  29959. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29960. return e.byteLength;
  29961. "string" != typeof e && (e = "" + e);
  29962. var i = e.length;
  29963. if (0 === i)
  29964. return 0;
  29965. for (var n = !1; ; )
  29966. switch (t) {
  29967. case "ascii":
  29968. case "latin1":
  29969. case "binary":
  29970. return i;
  29971. case "utf8":
  29972. case "utf-8":
  29973. case void 0:
  29974. return S(e).length;
  29975. case "ucs2":
  29976. case "ucs-2":
  29977. case "utf16le":
  29978. case "utf-16le":
  29979. return 2 * i;
  29980. case "hex":
  29981. return i >>> 1;
  29982. case "base64":
  29983. return M(e).length;
  29984. default:
  29985. if (n)
  29986. return S(e).length;
  29987. t = ("" + t).toLowerCase(),
  29988. n = !0
  29989. }
  29990. }
  29991. function h(e, t, i) {
  29992. var n = e[t];
  29993. e[t] = e[i],
  29994. e[i] = n
  29995. }
  29996. function d(e, t, i, n, r) {
  29997. if (0 === e.length)
  29998. return -1;
  29999. if ("string" == typeof i ? (n = i,
  30000. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  30001. i = +i,
  30002. isNaN(i) && (i = r ? 0 : e.length - 1),
  30003. i < 0 && (i = e.length + i),
  30004. i >= e.length) {
  30005. if (r)
  30006. return -1;
  30007. i = e.length - 1
  30008. } else if (i < 0) {
  30009. if (!r)
  30010. return -1;
  30011. i = 0
  30012. }
  30013. if ("string" == typeof t && (t = u.from(t, n)),
  30014. u.isBuffer(t))
  30015. return 0 === t.length ? -1 : p(e, t, i, n, r);
  30016. if ("number" == typeof t)
  30017. return t &= 255,
  30018. 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);
  30019. throw new TypeError("val must be string, number or Buffer")
  30020. }
  30021. function p(e, t, i, n, r) {
  30022. function o(e, t) {
  30023. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  30024. }
  30025. var a, s = 1, l = e.length, c = t.length;
  30026. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  30027. if (e.length < 2 || t.length < 2)
  30028. return -1;
  30029. l /= s = 2,
  30030. c /= 2,
  30031. i /= 2
  30032. }
  30033. if (r) {
  30034. var h = -1;
  30035. for (a = i; a < l; a++)
  30036. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  30037. if (-1 === h && (h = a),
  30038. a - h + 1 === c)
  30039. return h * s
  30040. } else
  30041. -1 !== h && (a -= a - h),
  30042. h = -1
  30043. } else
  30044. for (l < i + c && (i = l - c),
  30045. a = i; 0 <= a; a--) {
  30046. for (var u = !0, d = 0; d < c; d++)
  30047. if (o(e, a + d) !== o(t, d)) {
  30048. u = !1;
  30049. break
  30050. }
  30051. if (u)
  30052. return a
  30053. }
  30054. return -1
  30055. }
  30056. function g(e, t, i, n) {
  30057. i = Number(i) || 0;
  30058. var r = e.length - i;
  30059. n ? r < (n = Number(n)) && (n = r) : n = r;
  30060. var o = t.length;
  30061. if (o % 2 != 0)
  30062. throw new TypeError("Invalid hex string");
  30063. o / 2 < n && (n = o / 2);
  30064. for (var a = 0; a < n; ++a) {
  30065. var s = parseInt(t.substr(2 * a, 2), 16);
  30066. if (isNaN(s))
  30067. return a;
  30068. e[i + a] = s
  30069. }
  30070. return a
  30071. }
  30072. function m(e, t, i, n) {
  30073. return R(function(e) {
  30074. for (var t = [], i = 0; i < e.length; ++i)
  30075. t.push(255 & e.charCodeAt(i));
  30076. return t
  30077. }(t), e, i, n)
  30078. }
  30079. function f(e, t, i) {
  30080. i = Math.min(e.length, i);
  30081. for (var n = [], r = t; r < i; ) {
  30082. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  30083. if (r + u <= i)
  30084. switch (u) {
  30085. case 1:
  30086. c < 128 && (h = c);
  30087. break;
  30088. case 2:
  30089. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  30090. break;
  30091. case 3:
  30092. o = e[r + 1],
  30093. a = e[r + 2],
  30094. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  30095. break;
  30096. case 4:
  30097. o = e[r + 1],
  30098. a = e[r + 2],
  30099. s = e[r + 3],
  30100. 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))
  30101. }
  30102. null === h ? (h = 65533,
  30103. u = 1) : 65535 < h && (h -= 65536,
  30104. n.push(h >>> 10 & 1023 | 55296),
  30105. h = 56320 | 1023 & h),
  30106. n.push(h),
  30107. r += u
  30108. }
  30109. return function(e) {
  30110. var t = e.length;
  30111. if (t <= D)
  30112. return String.fromCharCode.apply(String, e);
  30113. for (var i = "", n = 0; n < t; )
  30114. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  30115. return i
  30116. }(n)
  30117. }
  30118. function v(e, t, i) {
  30119. var n = "";
  30120. i = Math.min(e.length, i);
  30121. for (var r = t; r < i; ++r)
  30122. n += String.fromCharCode(127 & e[r]);
  30123. return n
  30124. }
  30125. function y(e, t, i) {
  30126. var n = "";
  30127. i = Math.min(e.length, i);
  30128. for (var r = t; r < i; ++r)
  30129. n += String.fromCharCode(e[r]);
  30130. return n
  30131. }
  30132. function A(e, t, i) {
  30133. var n, r = e.length;
  30134. (!t || t < 0) && (t = 0),
  30135. (!i || i < 0 || r < i) && (i = r);
  30136. for (var o = "", a = t; a < i; ++a)
  30137. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  30138. return o
  30139. }
  30140. function C(e, t, i) {
  30141. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  30142. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  30143. return r
  30144. }
  30145. function I(e, t, i) {
  30146. if (e % 1 != 0 || e < 0)
  30147. throw new RangeError("offset is not uint");
  30148. if (i < e + t)
  30149. throw new RangeError("Trying to access beyond buffer length")
  30150. }
  30151. function E(e, t, i, n, r, o) {
  30152. if (!u.isBuffer(e))
  30153. throw new TypeError('"buffer" argument must be a Buffer instance');
  30154. if (r < t || t < o)
  30155. throw new RangeError('"value" argument is out of bounds');
  30156. if (i + n > e.length)
  30157. throw new RangeError("Index out of range")
  30158. }
  30159. function _(e, t, i, n) {
  30160. t < 0 && (t = 65535 + t + 1);
  30161. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30162. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30163. }
  30164. function b(e, t, i, n) {
  30165. t < 0 && (t = 4294967295 + t + 1);
  30166. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30167. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30168. }
  30169. function w(e, t, i, n) {
  30170. if (i + n > e.length)
  30171. throw new RangeError("Index out of range");
  30172. if (i < 0)
  30173. throw new RangeError("Index out of range")
  30174. }
  30175. function T(e, t, i, n, r) {
  30176. return r || w(e, 0, i, 4),
  30177. O.write(e, t, i, n, 23, 4),
  30178. i + 4
  30179. }
  30180. function x(e, t, i, n, r) {
  30181. return r || w(e, 0, i, 8),
  30182. O.write(e, t, i, n, 52, 8),
  30183. i + 8
  30184. }
  30185. function S(e, t) {
  30186. t = t || 1 / 0;
  30187. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30188. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30189. if (!r) {
  30190. if (56319 < i) {
  30191. -1 < (t -= 3) && o.push(239, 191, 189);
  30192. continue
  30193. }
  30194. if (a + 1 === n) {
  30195. -1 < (t -= 3) && o.push(239, 191, 189);
  30196. continue
  30197. }
  30198. r = i;
  30199. continue
  30200. }
  30201. if (i < 56320) {
  30202. -1 < (t -= 3) && o.push(239, 191, 189),
  30203. r = i;
  30204. continue
  30205. }
  30206. i = 65536 + (r - 55296 << 10 | i - 56320)
  30207. } else
  30208. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30209. if (r = null,
  30210. i < 128) {
  30211. if ((t -= 1) < 0)
  30212. break;
  30213. o.push(i)
  30214. } else if (i < 2048) {
  30215. if ((t -= 2) < 0)
  30216. break;
  30217. o.push(i >> 6 | 192, 63 & i | 128)
  30218. } else if (i < 65536) {
  30219. if ((t -= 3) < 0)
  30220. break;
  30221. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30222. } else {
  30223. if (!(i < 1114112))
  30224. throw new Error("Invalid code point");
  30225. if ((t -= 4) < 0)
  30226. break;
  30227. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30228. }
  30229. }
  30230. return o
  30231. }
  30232. function M(e) {
  30233. return P.toByteArray(function(e) {
  30234. if ((e = function(e) {
  30235. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30236. }(e).replace(t, "")).length < 2)
  30237. return "";
  30238. for (; e.length % 4 != 0; )
  30239. e += "=";
  30240. return e
  30241. }(e))
  30242. }
  30243. function R(e, t, i, n) {
  30244. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30245. t[r + i] = e[r];
  30246. return r
  30247. }
  30248. var P = N("base64-js")
  30249. , O = N("ieee754")
  30250. , L = N("isarray");
  30251. F.Buffer = u,
  30252. F.SlowBuffer = function(e) {
  30253. return +e != e && (e = 0),
  30254. u.alloc(+e)
  30255. }
  30256. ,
  30257. F.INSPECT_MAX_BYTES = 50,
  30258. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30259. try {
  30260. var e = new Uint8Array(1);
  30261. return e.__proto__ = {
  30262. __proto__: Uint8Array.prototype,
  30263. foo: function() {
  30264. return 42
  30265. }
  30266. },
  30267. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30268. } catch (e) {
  30269. return !1
  30270. }
  30271. }(),
  30272. F.kMaxLength = i(),
  30273. u.poolSize = 8192,
  30274. u._augment = function(e) {
  30275. return e.__proto__ = u.prototype,
  30276. e
  30277. }
  30278. ,
  30279. u.from = function(e, t, i) {
  30280. return n(null, e, t, i)
  30281. }
  30282. ,
  30283. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30284. u.__proto__ = Uint8Array,
  30285. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30286. value: null,
  30287. configurable: !0
  30288. })),
  30289. u.alloc = function(e, t, i) {
  30290. return function(e, t, i, n) {
  30291. return r(t),
  30292. 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)
  30293. }(null, e, t, i)
  30294. }
  30295. ,
  30296. u.allocUnsafe = function(e) {
  30297. return a(null, e)
  30298. }
  30299. ,
  30300. u.allocUnsafeSlow = function(e) {
  30301. return a(null, e)
  30302. }
  30303. ,
  30304. u.isBuffer = function(e) {
  30305. return !(null == e || !e._isBuffer)
  30306. }
  30307. ,
  30308. u.compare = function(e, t) {
  30309. if (!u.isBuffer(e) || !u.isBuffer(t))
  30310. throw new TypeError("Arguments must be Buffers");
  30311. if (e === t)
  30312. return 0;
  30313. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30314. if (e[r] !== t[r]) {
  30315. i = e[r],
  30316. n = t[r];
  30317. break
  30318. }
  30319. return i < n ? -1 : n < i ? 1 : 0
  30320. }
  30321. ,
  30322. u.isEncoding = function(e) {
  30323. switch (String(e).toLowerCase()) {
  30324. case "hex":
  30325. case "utf8":
  30326. case "utf-8":
  30327. case "ascii":
  30328. case "latin1":
  30329. case "binary":
  30330. case "base64":
  30331. case "ucs2":
  30332. case "ucs-2":
  30333. case "utf16le":
  30334. case "utf-16le":
  30335. return !0;
  30336. default:
  30337. return !1
  30338. }
  30339. }
  30340. ,
  30341. u.concat = function(e, t) {
  30342. if (!L(e))
  30343. throw new TypeError('"list" argument must be an Array of Buffers');
  30344. if (0 === e.length)
  30345. return u.alloc(0);
  30346. var i;
  30347. if (void 0 === t)
  30348. for (i = t = 0; i < e.length; ++i)
  30349. t += e[i].length;
  30350. var n = u.allocUnsafe(t)
  30351. , r = 0;
  30352. for (i = 0; i < e.length; ++i) {
  30353. var o = e[i];
  30354. if (!u.isBuffer(o))
  30355. throw new TypeError('"list" argument must be an Array of Buffers');
  30356. o.copy(n, r),
  30357. r += o.length
  30358. }
  30359. return n
  30360. }
  30361. ,
  30362. u.byteLength = c,
  30363. u.prototype._isBuffer = !0,
  30364. u.prototype.swap16 = function() {
  30365. var e = this.length;
  30366. if (e % 2 != 0)
  30367. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30368. for (var t = 0; t < e; t += 2)
  30369. h(this, t, t + 1);
  30370. return this
  30371. }
  30372. ,
  30373. u.prototype.swap32 = function() {
  30374. var e = this.length;
  30375. if (e % 4 != 0)
  30376. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30377. for (var t = 0; t < e; t += 4)
  30378. h(this, t, t + 3),
  30379. h(this, t + 1, t + 2);
  30380. return this
  30381. }
  30382. ,
  30383. u.prototype.swap64 = function() {
  30384. var e = this.length;
  30385. if (e % 8 != 0)
  30386. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30387. for (var t = 0; t < e; t += 8)
  30388. h(this, t, t + 7),
  30389. h(this, t + 1, t + 6),
  30390. h(this, t + 2, t + 5),
  30391. h(this, t + 3, t + 4);
  30392. return this
  30393. }
  30394. ,
  30395. u.prototype.toString = function() {
  30396. var e = 0 | this.length;
  30397. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30398. var n, r, o, a = !1;
  30399. if ((void 0 === t || t < 0) && (t = 0),
  30400. t > this.length)
  30401. return "";
  30402. if ((void 0 === i || i > this.length) && (i = this.length),
  30403. i <= 0)
  30404. return "";
  30405. if ((i >>>= 0) <= (t >>>= 0))
  30406. return "";
  30407. for (e = e || "utf8"; ; )
  30408. switch (e) {
  30409. case "hex":
  30410. return A(this, t, i);
  30411. case "utf8":
  30412. case "utf-8":
  30413. return f(this, t, i);
  30414. case "ascii":
  30415. return v(this, t, i);
  30416. case "latin1":
  30417. case "binary":
  30418. return y(this, t, i);
  30419. case "base64":
  30420. return n = this,
  30421. o = i,
  30422. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30423. case "ucs2":
  30424. case "ucs-2":
  30425. case "utf16le":
  30426. case "utf-16le":
  30427. return C(this, t, i);
  30428. default:
  30429. if (a)
  30430. throw new TypeError("Unknown encoding: " + e);
  30431. e = (e + "").toLowerCase(),
  30432. a = !0
  30433. }
  30434. }
  30435. .apply(this, arguments)
  30436. }
  30437. ,
  30438. u.prototype.equals = function(e) {
  30439. if (!u.isBuffer(e))
  30440. throw new TypeError("Argument must be a Buffer");
  30441. return this === e || 0 === u.compare(this, e)
  30442. }
  30443. ,
  30444. u.prototype.inspect = function() {
  30445. var e = ""
  30446. , t = F.INSPECT_MAX_BYTES;
  30447. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30448. this.length > t && (e += " ... ")),
  30449. "<Buffer " + e + ">"
  30450. }
  30451. ,
  30452. u.prototype.compare = function(e, t, i, n, r) {
  30453. if (!u.isBuffer(e))
  30454. throw new TypeError("Argument must be a Buffer");
  30455. if (void 0 === t && (t = 0),
  30456. void 0 === i && (i = e ? e.length : 0),
  30457. void 0 === n && (n = 0),
  30458. void 0 === r && (r = this.length),
  30459. t < 0 || i > e.length || n < 0 || r > this.length)
  30460. throw new RangeError("out of range index");
  30461. if (r <= n && i <= t)
  30462. return 0;
  30463. if (r <= n)
  30464. return -1;
  30465. if (i <= t)
  30466. return 1;
  30467. if (this === e)
  30468. return 0;
  30469. 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)
  30470. if (l[h] !== c[h]) {
  30471. o = l[h],
  30472. a = c[h];
  30473. break
  30474. }
  30475. return o < a ? -1 : a < o ? 1 : 0
  30476. }
  30477. ,
  30478. u.prototype.includes = function(e, t, i) {
  30479. return -1 !== this.indexOf(e, t, i)
  30480. }
  30481. ,
  30482. u.prototype.indexOf = function(e, t, i) {
  30483. return d(this, e, t, i, !0)
  30484. }
  30485. ,
  30486. u.prototype.lastIndexOf = function(e, t, i) {
  30487. return d(this, e, t, i, !1)
  30488. }
  30489. ,
  30490. u.prototype.write = function(e, t, i, n) {
  30491. if (void 0 === t)
  30492. n = "utf8",
  30493. i = this.length,
  30494. t = 0;
  30495. else if (void 0 === i && "string" == typeof t)
  30496. n = t,
  30497. i = this.length,
  30498. t = 0;
  30499. else {
  30500. if (!isFinite(t))
  30501. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30502. t |= 0,
  30503. isFinite(i) ? (i |= 0,
  30504. void 0 === n && (n = "utf8")) : (n = i,
  30505. i = void 0)
  30506. }
  30507. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30508. if ((void 0 === i || p < i) && (i = p),
  30509. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30510. throw new RangeError("Attempt to write outside buffer bounds");
  30511. n = n || "utf8";
  30512. for (var f = !1; ; )
  30513. switch (n) {
  30514. case "hex":
  30515. return g(this, e, t, i);
  30516. case "utf8":
  30517. case "utf-8":
  30518. return u = t,
  30519. d = i,
  30520. R(S(e, (h = this).length - u), h, u, d);
  30521. case "ascii":
  30522. return m(this, e, t, i);
  30523. case "latin1":
  30524. case "binary":
  30525. return m(this, e, t, i);
  30526. case "base64":
  30527. return s = this,
  30528. l = t,
  30529. c = i,
  30530. R(M(e), s, l, c);
  30531. case "ucs2":
  30532. case "ucs-2":
  30533. case "utf16le":
  30534. case "utf-16le":
  30535. return o = t,
  30536. a = i,
  30537. R(function(e, t) {
  30538. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30539. i = e.charCodeAt(a),
  30540. n = i >> 8,
  30541. r = i % 256,
  30542. o.push(r),
  30543. o.push(n);
  30544. return o
  30545. }(e, (r = this).length - o), r, o, a);
  30546. default:
  30547. if (f)
  30548. throw new TypeError("Unknown encoding: " + n);
  30549. n = ("" + n).toLowerCase(),
  30550. f = !0
  30551. }
  30552. }
  30553. ,
  30554. u.prototype.toJSON = function() {
  30555. return {
  30556. type: "Buffer",
  30557. data: Array.prototype.slice.call(this._arr || this, 0)
  30558. }
  30559. }
  30560. ;
  30561. var D = 4096;
  30562. u.prototype.slice = function(e, t) {
  30563. var i, n = this.length;
  30564. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30565. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30566. t < e && (t = e),
  30567. u.TYPED_ARRAY_SUPPORT)
  30568. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30569. else {
  30570. var r = t - e;
  30571. i = new u(r,void 0);
  30572. for (var o = 0; o < r; ++o)
  30573. i[o] = this[o + e]
  30574. }
  30575. return i
  30576. }
  30577. ,
  30578. u.prototype.readUIntLE = function(e, t, i) {
  30579. e |= 0,
  30580. t |= 0,
  30581. i || I(e, t, this.length);
  30582. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30583. n += this[e + o] * r;
  30584. return n
  30585. }
  30586. ,
  30587. u.prototype.readUIntBE = function(e, t, i) {
  30588. e |= 0,
  30589. t |= 0,
  30590. i || I(e, t, this.length);
  30591. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30592. n += this[e + --t] * r;
  30593. return n
  30594. }
  30595. ,
  30596. u.prototype.readUInt8 = function(e, t) {
  30597. return t || I(e, 1, this.length),
  30598. this[e]
  30599. }
  30600. ,
  30601. u.prototype.readUInt16LE = function(e, t) {
  30602. return t || I(e, 2, this.length),
  30603. this[e] | this[e + 1] << 8
  30604. }
  30605. ,
  30606. u.prototype.readUInt16BE = function(e, t) {
  30607. return t || I(e, 2, this.length),
  30608. this[e] << 8 | this[e + 1]
  30609. }
  30610. ,
  30611. u.prototype.readUInt32LE = function(e, t) {
  30612. return t || I(e, 4, this.length),
  30613. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30614. }
  30615. ,
  30616. u.prototype.readUInt32BE = function(e, t) {
  30617. return t || I(e, 4, this.length),
  30618. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30619. }
  30620. ,
  30621. u.prototype.readIntLE = function(e, t, i) {
  30622. e |= 0,
  30623. t |= 0,
  30624. i || I(e, t, this.length);
  30625. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30626. n += this[e + o] * r;
  30627. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30628. n
  30629. }
  30630. ,
  30631. u.prototype.readIntBE = function(e, t, i) {
  30632. e |= 0,
  30633. t |= 0,
  30634. i || I(e, t, this.length);
  30635. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30636. o += this[e + --n] * r;
  30637. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30638. o
  30639. }
  30640. ,
  30641. u.prototype.readInt8 = function(e, t) {
  30642. return t || I(e, 1, this.length),
  30643. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30644. }
  30645. ,
  30646. u.prototype.readInt16LE = function(e, t) {
  30647. t || I(e, 2, this.length);
  30648. var i = this[e] | this[e + 1] << 8;
  30649. return 32768 & i ? 4294901760 | i : i
  30650. }
  30651. ,
  30652. u.prototype.readInt16BE = function(e, t) {
  30653. t || I(e, 2, this.length);
  30654. var i = this[e + 1] | this[e] << 8;
  30655. return 32768 & i ? 4294901760 | i : i
  30656. }
  30657. ,
  30658. u.prototype.readInt32LE = function(e, t) {
  30659. return t || I(e, 4, this.length),
  30660. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30661. }
  30662. ,
  30663. u.prototype.readInt32BE = function(e, t) {
  30664. return t || I(e, 4, this.length),
  30665. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30666. }
  30667. ,
  30668. u.prototype.readFloatLE = function(e, t) {
  30669. return t || I(e, 4, this.length),
  30670. O.read(this, e, !0, 23, 4)
  30671. }
  30672. ,
  30673. u.prototype.readFloatBE = function(e, t) {
  30674. return t || I(e, 4, this.length),
  30675. O.read(this, e, !1, 23, 4)
  30676. }
  30677. ,
  30678. u.prototype.readDoubleLE = function(e, t) {
  30679. return t || I(e, 8, this.length),
  30680. O.read(this, e, !0, 52, 8)
  30681. }
  30682. ,
  30683. u.prototype.readDoubleBE = function(e, t) {
  30684. return t || I(e, 8, this.length),
  30685. O.read(this, e, !1, 52, 8)
  30686. }
  30687. ,
  30688. u.prototype.writeUIntLE = function(e, t, i, n) {
  30689. e = +e,
  30690. t |= 0,
  30691. i |= 0,
  30692. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30693. var r = 1
  30694. , o = 0;
  30695. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30696. this[t + o] = e / r & 255;
  30697. return t + i
  30698. }
  30699. ,
  30700. u.prototype.writeUIntBE = function(e, t, i, n) {
  30701. e = +e,
  30702. t |= 0,
  30703. i |= 0,
  30704. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30705. var r = i - 1
  30706. , o = 1;
  30707. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30708. this[t + r] = e / o & 255;
  30709. return t + i
  30710. }
  30711. ,
  30712. u.prototype.writeUInt8 = function(e, t, i) {
  30713. return e = +e,
  30714. t |= 0,
  30715. i || E(this, e, t, 1, 255, 0),
  30716. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30717. this[t] = 255 & e,
  30718. t + 1
  30719. }
  30720. ,
  30721. u.prototype.writeUInt16LE = function(e, t, i) {
  30722. return e = +e,
  30723. t |= 0,
  30724. i || E(this, e, t, 2, 65535, 0),
  30725. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30726. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30727. t + 2
  30728. }
  30729. ,
  30730. u.prototype.writeUInt16BE = function(e, t, i) {
  30731. return e = +e,
  30732. t |= 0,
  30733. i || E(this, e, t, 2, 65535, 0),
  30734. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30735. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30736. t + 2
  30737. }
  30738. ,
  30739. u.prototype.writeUInt32LE = function(e, t, i) {
  30740. return e = +e,
  30741. t |= 0,
  30742. i || E(this, e, t, 4, 4294967295, 0),
  30743. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30744. this[t + 2] = e >>> 16,
  30745. this[t + 1] = e >>> 8,
  30746. this[t] = 255 & e) : b(this, e, t, !0),
  30747. t + 4
  30748. }
  30749. ,
  30750. u.prototype.writeUInt32BE = function(e, t, i) {
  30751. return e = +e,
  30752. t |= 0,
  30753. i || E(this, e, t, 4, 4294967295, 0),
  30754. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30755. this[t + 1] = e >>> 16,
  30756. this[t + 2] = e >>> 8,
  30757. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30758. t + 4
  30759. }
  30760. ,
  30761. u.prototype.writeIntLE = function(e, t, i, n) {
  30762. if (e = +e,
  30763. t |= 0,
  30764. !n) {
  30765. var r = Math.pow(2, 8 * i - 1);
  30766. E(this, e, t, i, r - 1, -r)
  30767. }
  30768. var o = 0
  30769. , a = 1
  30770. , s = 0;
  30771. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30772. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30773. this[t + o] = (e / a >> 0) - s & 255;
  30774. return t + i
  30775. }
  30776. ,
  30777. u.prototype.writeIntBE = function(e, t, i, n) {
  30778. if (e = +e,
  30779. t |= 0,
  30780. !n) {
  30781. var r = Math.pow(2, 8 * i - 1);
  30782. E(this, e, t, i, r - 1, -r)
  30783. }
  30784. var o = i - 1
  30785. , a = 1
  30786. , s = 0;
  30787. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30788. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30789. this[t + o] = (e / a >> 0) - s & 255;
  30790. return t + i
  30791. }
  30792. ,
  30793. u.prototype.writeInt8 = function(e, t, i) {
  30794. return e = +e,
  30795. t |= 0,
  30796. i || E(this, e, t, 1, 127, -128),
  30797. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30798. e < 0 && (e = 255 + e + 1),
  30799. this[t] = 255 & e,
  30800. t + 1
  30801. }
  30802. ,
  30803. u.prototype.writeInt16LE = function(e, t, i) {
  30804. return e = +e,
  30805. t |= 0,
  30806. i || E(this, e, t, 2, 32767, -32768),
  30807. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30808. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30809. t + 2
  30810. }
  30811. ,
  30812. u.prototype.writeInt16BE = function(e, t, i) {
  30813. return e = +e,
  30814. t |= 0,
  30815. i || E(this, e, t, 2, 32767, -32768),
  30816. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30817. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30818. t + 2
  30819. }
  30820. ,
  30821. u.prototype.writeInt32LE = function(e, t, i) {
  30822. return e = +e,
  30823. t |= 0,
  30824. i || E(this, e, t, 4, 2147483647, -2147483648),
  30825. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30826. this[t + 1] = e >>> 8,
  30827. this[t + 2] = e >>> 16,
  30828. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30829. t + 4
  30830. }
  30831. ,
  30832. u.prototype.writeInt32BE = function(e, t, i) {
  30833. return e = +e,
  30834. t |= 0,
  30835. i || E(this, e, t, 4, 2147483647, -2147483648),
  30836. e < 0 && (e = 4294967295 + e + 1),
  30837. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30838. this[t + 1] = e >>> 16,
  30839. this[t + 2] = e >>> 8,
  30840. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30841. t + 4
  30842. }
  30843. ,
  30844. u.prototype.writeFloatLE = function(e, t, i) {
  30845. return T(this, e, t, !0, i)
  30846. }
  30847. ,
  30848. u.prototype.writeFloatBE = function(e, t, i) {
  30849. return T(this, e, t, !1, i)
  30850. }
  30851. ,
  30852. u.prototype.writeDoubleLE = function(e, t, i) {
  30853. return x(this, e, t, !0, i)
  30854. }
  30855. ,
  30856. u.prototype.writeDoubleBE = function(e, t, i) {
  30857. return x(this, e, t, !1, i)
  30858. }
  30859. ,
  30860. u.prototype.copy = function(e, t, i, n) {
  30861. if (i = i || 0,
  30862. n || 0 === n || (n = this.length),
  30863. t >= e.length && (t = e.length),
  30864. t = t || 0,
  30865. 0 < n && n < i && (n = i),
  30866. n === i)
  30867. return 0;
  30868. if (0 === e.length || 0 === this.length)
  30869. return 0;
  30870. if (t < 0)
  30871. throw new RangeError("targetStart out of bounds");
  30872. if (i < 0 || i >= this.length)
  30873. throw new RangeError("sourceStart out of bounds");
  30874. if (n < 0)
  30875. throw new RangeError("sourceEnd out of bounds");
  30876. n > this.length && (n = this.length),
  30877. e.length - t < n - i && (n = e.length - t + i);
  30878. var r, o = n - i;
  30879. if (this === e && i < t && t < n)
  30880. for (r = o - 1; 0 <= r; --r)
  30881. e[r + t] = this[r + i];
  30882. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30883. for (r = 0; r < o; ++r)
  30884. e[r + t] = this[r + i];
  30885. else
  30886. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30887. return o
  30888. }
  30889. ,
  30890. u.prototype.fill = function(e, t, i, n) {
  30891. if ("string" == typeof e) {
  30892. if ("string" == typeof t ? (n = t,
  30893. t = 0,
  30894. i = this.length) : "string" == typeof i && (n = i,
  30895. i = this.length),
  30896. 1 === e.length) {
  30897. var r = e.charCodeAt(0);
  30898. r < 256 && (e = r)
  30899. }
  30900. if (void 0 !== n && "string" != typeof n)
  30901. throw new TypeError("encoding must be a string");
  30902. if ("string" == typeof n && !u.isEncoding(n))
  30903. throw new TypeError("Unknown encoding: " + n)
  30904. } else
  30905. "number" == typeof e && (e &= 255);
  30906. if (t < 0 || this.length < t || this.length < i)
  30907. throw new RangeError("Out of range index");
  30908. if (i <= t)
  30909. return this;
  30910. var o;
  30911. if (t >>>= 0,
  30912. i = void 0 === i ? this.length : i >>> 0,
  30913. "number" == typeof (e = e || 0))
  30914. for (o = t; o < i; ++o)
  30915. this[o] = e;
  30916. else {
  30917. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30918. , s = a.length;
  30919. for (o = 0; o < i - t; ++o)
  30920. this[o + t] = a[o % s]
  30921. }
  30922. return this
  30923. }
  30924. ;
  30925. var t = /[^+\/0-9A-Za-z-_]/g
  30926. }
  30927. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30928. }
  30929. , {
  30930. "base64-js": 199,
  30931. ieee754: 200,
  30932. isarray: 201
  30933. }],
  30934. 199: [function(e, t, i) {
  30935. "use strict";
  30936. function l(e) {
  30937. var t = e.length;
  30938. if (0 < t % 4)
  30939. throw new Error("Invalid string. Length must be a multiple of 4");
  30940. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30941. }
  30942. function c(e, t, i) {
  30943. for (var n, r = [], o = t; o < i; o += 3)
  30944. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30945. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30946. var a;
  30947. return r.join("")
  30948. }
  30949. i.byteLength = function(e) {
  30950. return 3 * e.length / 4 - l(e)
  30951. }
  30952. ,
  30953. i.toByteArray = function(e) {
  30954. var t, i, n, r, o, a = e.length;
  30955. r = l(e),
  30956. o = new d(3 * a / 4 - r),
  30957. i = 0 < r ? a - 4 : a;
  30958. var s = 0;
  30959. for (t = 0; t < i; t += 4,
  30960. 3)
  30961. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30962. o[s++] = n >> 16 & 255,
  30963. o[s++] = n >> 8 & 255,
  30964. o[s++] = 255 & n;
  30965. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30966. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30967. o[s++] = n >> 8 & 255,
  30968. o[s++] = 255 & n),
  30969. o
  30970. }
  30971. ,
  30972. i.fromByteArray = function(e) {
  30973. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30974. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30975. return 1 == n ? (t = e[i - 1],
  30976. r += h[t >> 2],
  30977. r += h[t << 4 & 63],
  30978. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30979. r += h[t >> 10],
  30980. r += h[t >> 4 & 63],
  30981. r += h[t << 2 & 63],
  30982. r += "="),
  30983. o.push(r),
  30984. o.join("")
  30985. }
  30986. ;
  30987. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30988. h[r] = n[r],
  30989. u[n.charCodeAt(r)] = r;
  30990. u["-".charCodeAt(0)] = 62,
  30991. u["_".charCodeAt(0)] = 63
  30992. }
  30993. , {}],
  30994. 200: [function(e, t, i) {
  30995. i.read = function(e, t, i, n, r) {
  30996. 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];
  30997. for (u += d,
  30998. o = p & (1 << -h) - 1,
  30999. p >>= -h,
  31000. h += s; 0 < h; o = 256 * o + e[t + u],
  31001. u += d,
  31002. h -= 8)
  31003. ;
  31004. for (a = o & (1 << -h) - 1,
  31005. o >>= -h,
  31006. h += n; 0 < h; a = 256 * a + e[t + u],
  31007. u += d,
  31008. h -= 8)
  31009. ;
  31010. if (0 === o)
  31011. o = 1 - c;
  31012. else {
  31013. if (o === l)
  31014. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  31015. a += Math.pow(2, n),
  31016. o -= c
  31017. }
  31018. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  31019. }
  31020. ,
  31021. i.write = function(e, t, i, n, r, o) {
  31022. 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;
  31023. for (t = Math.abs(t),
  31024. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  31025. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  31026. t * (l = Math.pow(2, -a)) < 1 && (a--,
  31027. l *= 2),
  31028. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  31029. l /= 2),
  31030. h <= a + u ? (s = 0,
  31031. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  31032. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  31033. a = 0)); 8 <= r; e[i + p] = 255 & s,
  31034. p += f,
  31035. s /= 256,
  31036. r -= 8)
  31037. ;
  31038. for (a = a << r | s,
  31039. c += r; 0 < c; e[i + p] = 255 & a,
  31040. p += f,
  31041. a /= 256,
  31042. c -= 8)
  31043. ;
  31044. e[i + p - f] |= 128 * g
  31045. }
  31046. }
  31047. , {}],
  31048. 201: [function(e, t, i) {
  31049. var n = {}.toString;
  31050. t.exports = Array.isArray || function(e) {
  31051. return "[object Array]" == n.call(e)
  31052. }
  31053. }
  31054. , {}],
  31055. 202: [function(e, t, i) {
  31056. function n() {
  31057. this._events = this._events || {},
  31058. this._maxListeners = this._maxListeners || void 0
  31059. }
  31060. function l(e) {
  31061. return "function" == typeof e
  31062. }
  31063. function c(e) {
  31064. return "object" == typeof e && null !== e
  31065. }
  31066. function h(e) {
  31067. return void 0 === e
  31068. }
  31069. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  31070. n.prototype._maxListeners = void 0,
  31071. n.defaultMaxListeners = 10,
  31072. n.prototype.setMaxListeners = function(e) {
  31073. if (!function(e) {
  31074. return "number" == typeof e
  31075. }(e) || e < 0 || isNaN(e))
  31076. throw TypeError("n must be a positive number");
  31077. return this._maxListeners = e,
  31078. this
  31079. }
  31080. ,
  31081. n.prototype.emit = function(e) {
  31082. var t, i, n, r, o, a;
  31083. if (this._events || (this._events = {}),
  31084. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  31085. if ((t = arguments[1])instanceof Error)
  31086. throw t;
  31087. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  31088. throw s.context = t,
  31089. s
  31090. }
  31091. if (h(i = this._events[e]))
  31092. return !1;
  31093. if (l(i))
  31094. switch (arguments.length) {
  31095. case 1:
  31096. i.call(this);
  31097. break;
  31098. case 2:
  31099. i.call(this, arguments[1]);
  31100. break;
  31101. case 3:
  31102. i.call(this, arguments[1], arguments[2]);
  31103. break;
  31104. default:
  31105. r = Array.prototype.slice.call(arguments, 1),
  31106. i.apply(this, r)
  31107. }
  31108. else if (c(i))
  31109. for (r = Array.prototype.slice.call(arguments, 1),
  31110. n = (a = i.slice()).length,
  31111. o = 0; o < n; o++)
  31112. a[o].apply(this, r);
  31113. return !0
  31114. }
  31115. ,
  31116. n.prototype.on = n.prototype.addListener = function(e, t) {
  31117. var i;
  31118. if (!l(t))
  31119. throw TypeError("listener must be a function");
  31120. return this._events || (this._events = {}),
  31121. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  31122. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  31123. 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,
  31124. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  31125. "function" == typeof console.trace && console.trace())),
  31126. this
  31127. }
  31128. ,
  31129. n.prototype.once = function(e, t) {
  31130. function i() {
  31131. this.removeListener(e, i),
  31132. n || (n = !0,
  31133. t.apply(this, arguments))
  31134. }
  31135. if (!l(t))
  31136. throw TypeError("listener must be a function");
  31137. var n = !1;
  31138. return i.listener = t,
  31139. this.on(e, i),
  31140. this
  31141. }
  31142. ,
  31143. n.prototype.removeListener = function(e, t) {
  31144. var i, n, r, o;
  31145. if (!l(t))
  31146. throw TypeError("listener must be a function");
  31147. if (!this._events || !this._events[e])
  31148. return this;
  31149. if (r = (i = this._events[e]).length,
  31150. n = -1,
  31151. i === t || l(i.listener) && i.listener === t)
  31152. delete this._events[e],
  31153. this._events.removeListener && this.emit("removeListener", e, t);
  31154. else if (c(i)) {
  31155. for (o = r; 0 < o--; )
  31156. if (i[o] === t || i[o].listener && i[o].listener === t) {
  31157. n = o;
  31158. break
  31159. }
  31160. if (n < 0)
  31161. return this;
  31162. 1 === i.length ? (i.length = 0,
  31163. delete this._events[e]) : i.splice(n, 1),
  31164. this._events.removeListener && this.emit("removeListener", e, t)
  31165. }
  31166. return this
  31167. }
  31168. ,
  31169. n.prototype.removeAllListeners = function(e) {
  31170. var t, i;
  31171. if (!this._events)
  31172. return this;
  31173. if (!this._events.removeListener)
  31174. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31175. this;
  31176. if (0 === arguments.length) {
  31177. for (t in this._events)
  31178. "removeListener" !== t && this.removeAllListeners(t);
  31179. return this.removeAllListeners("removeListener"),
  31180. this._events = {},
  31181. this
  31182. }
  31183. if (l(i = this._events[e]))
  31184. this.removeListener(e, i);
  31185. else if (i)
  31186. for (; i.length; )
  31187. this.removeListener(e, i[i.length - 1]);
  31188. return delete this._events[e],
  31189. this
  31190. }
  31191. ,
  31192. n.prototype.listeners = function(e) {
  31193. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31194. }
  31195. ,
  31196. n.prototype.listenerCount = function(e) {
  31197. if (this._events) {
  31198. var t = this._events[e];
  31199. if (l(t))
  31200. return 1;
  31201. if (t)
  31202. return t.length
  31203. }
  31204. return 0
  31205. }
  31206. ,
  31207. n.listenerCount = function(e, t) {
  31208. return e.listenerCount(t)
  31209. }
  31210. }
  31211. , {}],
  31212. 203: [function(e, t, i) {
  31213. function n() {
  31214. throw new Error("setTimeout has not been defined")
  31215. }
  31216. function r() {
  31217. throw new Error("clearTimeout has not been defined")
  31218. }
  31219. function o(t) {
  31220. if (h === setTimeout)
  31221. return setTimeout(t, 0);
  31222. if ((h === n || !h) && setTimeout)
  31223. return h = setTimeout,
  31224. setTimeout(t, 0);
  31225. try {
  31226. return h(t, 0)
  31227. } catch (e) {
  31228. try {
  31229. return h.call(null, t, 0)
  31230. } catch (e) {
  31231. return h.call(this, t, 0)
  31232. }
  31233. }
  31234. }
  31235. function a() {
  31236. g && p && (g = !1,
  31237. p.length ? f = p.concat(f) : m = -1,
  31238. f.length && s())
  31239. }
  31240. function s() {
  31241. if (!g) {
  31242. var e = o(a);
  31243. g = !0;
  31244. for (var t = f.length; t; ) {
  31245. for (p = f,
  31246. f = []; ++m < t; )
  31247. p && p[m].run();
  31248. m = -1,
  31249. t = f.length
  31250. }
  31251. p = null,
  31252. g = !1,
  31253. function(t) {
  31254. if (u === clearTimeout)
  31255. return clearTimeout(t);
  31256. if ((u === r || !u) && clearTimeout)
  31257. return u = clearTimeout,
  31258. clearTimeout(t);
  31259. try {
  31260. u(t)
  31261. } catch (e) {
  31262. try {
  31263. return u.call(null, t)
  31264. } catch (e) {
  31265. return u.call(this, t)
  31266. }
  31267. }
  31268. }(e)
  31269. }
  31270. }
  31271. function l(e, t) {
  31272. this.fun = e,
  31273. this.array = t
  31274. }
  31275. function c() {}
  31276. var h, u, d = t.exports = {};
  31277. !function() {
  31278. try {
  31279. h = "function" == typeof setTimeout ? setTimeout : n
  31280. } catch (e) {
  31281. h = n
  31282. }
  31283. try {
  31284. u = "function" == typeof clearTimeout ? clearTimeout : r
  31285. } catch (e) {
  31286. u = r
  31287. }
  31288. }();
  31289. var p, f = [], g = !1, m = -1;
  31290. d.nextTick = function(e) {
  31291. var t = new Array(arguments.length - 1);
  31292. if (1 < arguments.length)
  31293. for (var i = 1; i < arguments.length; i++)
  31294. t[i - 1] = arguments[i];
  31295. f.push(new l(e,t)),
  31296. 1 !== f.length || g || o(s)
  31297. }
  31298. ,
  31299. l.prototype.run = function() {
  31300. this.fun.apply(null, this.array)
  31301. }
  31302. ,
  31303. d.title = "browser",
  31304. d.browser = !0,
  31305. d.env = {},
  31306. d.argv = [],
  31307. d.version = "",
  31308. d.versions = {},
  31309. d.on = c,
  31310. d.addListener = c,
  31311. d.once = c,
  31312. d.off = c,
  31313. d.removeListener = c,
  31314. d.removeAllListeners = c,
  31315. d.emit = c,
  31316. d.binding = function(e) {
  31317. throw new Error("process.binding is not supported")
  31318. }
  31319. ,
  31320. d.cwd = function() {
  31321. return "/"
  31322. }
  31323. ,
  31324. d.chdir = function(e) {
  31325. throw new Error("process.chdir is not supported")
  31326. }
  31327. ,
  31328. d.umask = function() {
  31329. return 0
  31330. }
  31331. }
  31332. , {}],
  31333. 204: [function(e, O, L) {
  31334. (function(P) {
  31335. !function(e) {
  31336. function v(e) {
  31337. throw new RangeError(g[e])
  31338. }
  31339. function r(e, t) {
  31340. for (var i = e.length, n = []; i--; )
  31341. n[i] = t(e[i]);
  31342. return n
  31343. }
  31344. function t(e, t) {
  31345. var i = e.split("@")
  31346. , n = "";
  31347. return 1 < i.length && (n = i[0] + "@",
  31348. e = i[1]),
  31349. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31350. }
  31351. function y(e) {
  31352. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31353. 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),
  31354. r--) : n.push(t);
  31355. return n
  31356. }
  31357. function A(e) {
  31358. return r(e, function(e) {
  31359. var t = "";
  31360. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31361. e = 56320 | 1023 & e),
  31362. t + R(e)
  31363. }).join("")
  31364. }
  31365. function C(e, t) {
  31366. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31367. }
  31368. function I(e, t, i) {
  31369. var n = 0;
  31370. for (e = i ? M(e / u) : e >> 1,
  31371. e += M(e / t); m * w >> 1 < e; n += _)
  31372. e = M(e / m);
  31373. return M(n + (m + 1) * e / (e + h))
  31374. }
  31375. function i(e) {
  31376. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31377. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31378. n = 0; n < i; ++n)
  31379. 128 <= e.charCodeAt(n) && v("not-basic"),
  31380. d.push(e.charCodeAt(n));
  31381. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31382. for (o = f,
  31383. a = 1,
  31384. s = _; p <= r && v("invalid-input"),
  31385. u = e.charCodeAt(r++),
  31386. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31387. f += l * a,
  31388. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31389. a > M(E / (h = _ - c)) && v("overflow"),
  31390. a *= h;
  31391. m = I(f - o, t = d.length + 1, 0 == o),
  31392. M(f / t) > E - g && v("overflow"),
  31393. g += M(f / t),
  31394. f %= t,
  31395. d.splice(f++, 0, g)
  31396. }
  31397. return A(d)
  31398. }
  31399. function n(e) {
  31400. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31401. for (d = (e = y(e)).length,
  31402. t = x,
  31403. o = T,
  31404. a = i = 0; a < d; ++a)
  31405. (u = e[a]) < 128 && m.push(R(u));
  31406. for (n = r = m.length,
  31407. r && m.push(S); n < d; ) {
  31408. for (s = E,
  31409. a = 0; a < d; ++a)
  31410. t <= (u = e[a]) && u < s && (s = u);
  31411. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31412. i += (s - t) * p,
  31413. t = s,
  31414. a = 0; a < d; ++a)
  31415. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31416. u == t) {
  31417. for (l = i,
  31418. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31419. g = l - h,
  31420. f = _ - h,
  31421. m.push(R(C(h + g % f, 0))),
  31422. l = M(g / f);
  31423. m.push(R(C(l, 0))),
  31424. o = I(i, p, n == r),
  31425. i = 0,
  31426. ++n
  31427. }
  31428. ++i,
  31429. ++t
  31430. }
  31431. return m.join("")
  31432. }
  31433. var o = "object" == typeof L && L && !L.nodeType && L
  31434. , a = "object" == typeof O && O && !O.nodeType && O
  31435. , s = "object" == typeof P && P;
  31436. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31437. 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 = {
  31438. overflow: "Overflow: input needs wider integers to process",
  31439. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31440. "invalid-input": "Invalid input"
  31441. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31442. if (l = {
  31443. version: "1.4.1",
  31444. ucs2: {
  31445. decode: y,
  31446. encode: A
  31447. },
  31448. decode: i,
  31449. encode: n,
  31450. toASCII: function(e) {
  31451. return t(e, function(e) {
  31452. return p.test(e) ? "xn--" + n(e) : e
  31453. })
  31454. },
  31455. toUnicode: function(e) {
  31456. return t(e, function(e) {
  31457. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31458. })
  31459. }
  31460. },
  31461. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31462. define("punycode", function() {
  31463. return l
  31464. });
  31465. else if (o && a)
  31466. if (O.exports == o)
  31467. a.exports = l;
  31468. else
  31469. for (c in l)
  31470. l.hasOwnProperty(c) && (o[c] = l[c]);
  31471. else
  31472. e.punycode = l
  31473. }(this)
  31474. }
  31475. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31476. }
  31477. , {}],
  31478. 205: [function(e, t, i) {
  31479. "use strict";
  31480. t.exports = function(e, t, i, n) {
  31481. t = t || "&",
  31482. i = i || "=";
  31483. var r = {};
  31484. if ("string" != typeof e || 0 === e.length)
  31485. return r;
  31486. var o = /\+/g;
  31487. e = e.split(t);
  31488. var a = 1e3;
  31489. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31490. var s, l, c = e.length;
  31491. 0 < a && a < c && (c = a);
  31492. for (var h = 0; h < c; ++h) {
  31493. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31494. d = 0 <= m ? (u = g.substr(0, m),
  31495. g.substr(m + 1)) : (u = g,
  31496. ""),
  31497. p = decodeURIComponent(u),
  31498. f = decodeURIComponent(d),
  31499. s = r,
  31500. l = p,
  31501. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31502. }
  31503. return r
  31504. }
  31505. ;
  31506. var v = Array.isArray || function(e) {
  31507. return "[object Array]" === Object.prototype.toString.call(e)
  31508. }
  31509. }
  31510. , {}],
  31511. 206: [function(e, t, i) {
  31512. "use strict";
  31513. function o(e, t) {
  31514. if (e.map)
  31515. return e.map(t);
  31516. for (var i = [], n = 0; n < e.length; n++)
  31517. i.push(t(e[n], n));
  31518. return i
  31519. }
  31520. function a(e) {
  31521. switch (typeof e) {
  31522. case "string":
  31523. return e;
  31524. case "boolean":
  31525. return e ? "true" : "false";
  31526. case "number":
  31527. return isFinite(e) ? e : "";
  31528. default:
  31529. return ""
  31530. }
  31531. }
  31532. t.exports = function(i, n, r, e) {
  31533. return n = n || "&",
  31534. r = r || "=",
  31535. null === i && (i = void 0),
  31536. "object" == typeof i ? o(l(i), function(e) {
  31537. var t = encodeURIComponent(a(e)) + r;
  31538. return s(i[e]) ? o(i[e], function(e) {
  31539. return t + encodeURIComponent(a(e))
  31540. }).join(n) : t + encodeURIComponent(a(i[e]))
  31541. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31542. }
  31543. ;
  31544. var s = Array.isArray || function(e) {
  31545. return "[object Array]" === Object.prototype.toString.call(e)
  31546. }
  31547. , l = Object.keys || function(e) {
  31548. var t = [];
  31549. for (var i in e)
  31550. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31551. return t
  31552. }
  31553. }
  31554. , {}],
  31555. 207: [function(e, t, i) {
  31556. "use strict";
  31557. i.decode = i.parse = e("./decode"),
  31558. i.encode = i.stringify = e("./encode")
  31559. }
  31560. , {
  31561. "./decode": 205,
  31562. "./encode": 206
  31563. }],
  31564. 208: [function(e, t, i) {
  31565. "use strict";
  31566. function x() {
  31567. this.protocol = null,
  31568. this.slashes = null,
  31569. this.auth = null,
  31570. this.host = null,
  31571. this.port = null,
  31572. this.hostname = null,
  31573. this.hash = null,
  31574. this.search = null,
  31575. this.query = null,
  31576. this.pathname = null,
  31577. this.path = null,
  31578. this.href = null
  31579. }
  31580. function n(e, t, i) {
  31581. if (e && D.isObject(e) && e instanceof x)
  31582. return e;
  31583. var n = new x;
  31584. return n.parse(e, t, i),
  31585. n
  31586. }
  31587. var L = e("punycode")
  31588. , D = e("./util");
  31589. i.parse = n,
  31590. i.resolve = function(e, t) {
  31591. return n(e, !1, !0).resolve(t)
  31592. }
  31593. ,
  31594. i.resolveObject = function(e, t) {
  31595. return e ? n(e, !1, !0).resolveObject(t) : t
  31596. }
  31597. ,
  31598. i.format = function(e) {
  31599. return D.isString(e) && (e = n(e)),
  31600. e instanceof x ? e.format() : x.prototype.format.call(e)
  31601. }
  31602. ,
  31603. i.Url = x;
  31604. var N = /^([a-z0-9.+-]+:)/i
  31605. , r = /:[0-9]*$/
  31606. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31607. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31608. , B = ["'"].concat(o)
  31609. , V = ["%", "/", "?", ";", "#"].concat(B)
  31610. , k = ["/", "?", "#"]
  31611. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31612. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31613. , z = {
  31614. javascript: !0,
  31615. "javascript:": !0
  31616. }
  31617. , G = {
  31618. javascript: !0,
  31619. "javascript:": !0
  31620. }
  31621. , W = {
  31622. http: !0,
  31623. https: !0,
  31624. ftp: !0,
  31625. gopher: !0,
  31626. file: !0,
  31627. "http:": !0,
  31628. "https:": !0,
  31629. "ftp:": !0,
  31630. "gopher:": !0,
  31631. "file:": !0
  31632. }
  31633. , j = e("querystring");
  31634. x.prototype.parse = function(e, t, i) {
  31635. if (!D.isString(e))
  31636. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31637. var n = e.indexOf("?")
  31638. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31639. , o = e.split(r);
  31640. o[0] = o[0].replace(/\\/g, "/");
  31641. var a = e = o.join(r);
  31642. if (a = a.trim(),
  31643. !i && 1 === e.split("#").length) {
  31644. var s = F.exec(a);
  31645. if (s)
  31646. return this.path = a,
  31647. this.href = a,
  31648. this.pathname = s[1],
  31649. s[2] ? (this.search = s[2],
  31650. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31651. this.query = {}),
  31652. this
  31653. }
  31654. var l = N.exec(a);
  31655. if (l) {
  31656. var c = (l = l[0]).toLowerCase();
  31657. this.protocol = c,
  31658. a = a.substr(l.length)
  31659. }
  31660. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31661. var h = "//" === a.substr(0, 2);
  31662. !h || l && G[l] || (a = a.substr(2),
  31663. this.slashes = !0)
  31664. }
  31665. if (!G[l] && (h || l && !W[l])) {
  31666. for (var u = -1, d = 0; d < k.length; d++) {
  31667. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31668. }
  31669. var p, f;
  31670. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31671. a = a.slice(f + 1),
  31672. this.auth = decodeURIComponent(p)),
  31673. u = -1;
  31674. for (d = 0; d < V.length; d++) {
  31675. var g;
  31676. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31677. }
  31678. -1 === u && (u = a.length),
  31679. this.host = a.slice(0, u),
  31680. a = a.slice(u),
  31681. this.parseHost(),
  31682. this.hostname = this.hostname || "";
  31683. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31684. if (!m)
  31685. for (var v = this.hostname.split(/\./), y = (d = 0,
  31686. v.length); d < y; d++) {
  31687. var A = v[d];
  31688. if (A && !A.match(U)) {
  31689. for (var C = "", I = 0, E = A.length; I < E; I++)
  31690. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31691. if (!C.match(U)) {
  31692. var _ = v.slice(0, d)
  31693. , b = v.slice(d + 1)
  31694. , w = A.match(H);
  31695. w && (_.push(w[1]),
  31696. b.unshift(w[2])),
  31697. b.length && (a = "/" + b.join(".") + a),
  31698. this.hostname = _.join(".");
  31699. break
  31700. }
  31701. }
  31702. }
  31703. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31704. m || (this.hostname = L.toASCII(this.hostname));
  31705. var T = this.port ? ":" + this.port : ""
  31706. , x = this.hostname || "";
  31707. this.host = x + T,
  31708. this.href += this.host,
  31709. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31710. "/" !== a[0] && (a = "/" + a))
  31711. }
  31712. if (!z[c])
  31713. for (d = 0,
  31714. y = B.length; d < y; d++) {
  31715. var S = B[d];
  31716. if (-1 !== a.indexOf(S)) {
  31717. var M = encodeURIComponent(S);
  31718. M === S && (M = escape(S)),
  31719. a = a.split(S).join(M)
  31720. }
  31721. }
  31722. var R = a.indexOf("#");
  31723. -1 !== R && (this.hash = a.substr(R),
  31724. a = a.slice(0, R));
  31725. var P = a.indexOf("?");
  31726. if (-1 !== P ? (this.search = a.substr(P),
  31727. this.query = a.substr(P + 1),
  31728. t && (this.query = j.parse(this.query)),
  31729. a = a.slice(0, P)) : t && (this.search = "",
  31730. this.query = {}),
  31731. a && (this.pathname = a),
  31732. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31733. this.pathname || this.search) {
  31734. T = this.pathname || "";
  31735. var O = this.search || "";
  31736. this.path = T + O
  31737. }
  31738. return this.href = this.format(),
  31739. this
  31740. }
  31741. ,
  31742. x.prototype.format = function() {
  31743. var e = this.auth || "";
  31744. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31745. e += "@");
  31746. var t = this.protocol || ""
  31747. , i = this.pathname || ""
  31748. , n = this.hash || ""
  31749. , r = !1
  31750. , o = "";
  31751. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31752. this.port && (r += ":" + this.port)),
  31753. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31754. var a = this.search || o && "?" + o || "";
  31755. return t && ":" !== t.substr(-1) && (t += ":"),
  31756. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31757. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31758. n && "#" !== n.charAt(0) && (n = "#" + n),
  31759. a && "?" !== a.charAt(0) && (a = "?" + a),
  31760. t + r + (i = i.replace(/[?#]/g, function(e) {
  31761. return encodeURIComponent(e)
  31762. })) + (a = a.replace("#", "%23")) + n
  31763. }
  31764. ,
  31765. x.prototype.resolve = function(e) {
  31766. return this.resolveObject(n(e, !1, !0)).format()
  31767. }
  31768. ,
  31769. x.prototype.resolveObject = function(e) {
  31770. if (D.isString(e)) {
  31771. var t = new x;
  31772. t.parse(e, !1, !0),
  31773. e = t
  31774. }
  31775. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31776. var o = n[r];
  31777. i[o] = this[o]
  31778. }
  31779. if (i.hash = e.hash,
  31780. "" === e.href)
  31781. return i.href = i.format(),
  31782. i;
  31783. if (e.slashes && !e.protocol) {
  31784. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31785. var l = a[s];
  31786. "protocol" !== l && (i[l] = e[l])
  31787. }
  31788. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31789. i.href = i.format(),
  31790. i
  31791. }
  31792. if (e.protocol && e.protocol !== i.protocol) {
  31793. if (!W[e.protocol]) {
  31794. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31795. var u = c[h];
  31796. i[u] = e[u]
  31797. }
  31798. return i.href = i.format(),
  31799. i
  31800. }
  31801. if (i.protocol = e.protocol,
  31802. e.host || G[e.protocol])
  31803. i.pathname = e.pathname;
  31804. else {
  31805. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31806. ;
  31807. e.host || (e.host = ""),
  31808. e.hostname || (e.hostname = ""),
  31809. "" !== d[0] && d.unshift(""),
  31810. d.length < 2 && d.unshift(""),
  31811. i.pathname = d.join("/")
  31812. }
  31813. if (i.search = e.search,
  31814. i.query = e.query,
  31815. i.host = e.host || "",
  31816. i.auth = e.auth,
  31817. i.hostname = e.hostname || e.host,
  31818. i.port = e.port,
  31819. i.pathname || i.search) {
  31820. var p = i.pathname || ""
  31821. , f = i.search || "";
  31822. i.path = p + f
  31823. }
  31824. return i.slashes = i.slashes || e.slashes,
  31825. i.href = i.format(),
  31826. i
  31827. }
  31828. var g = i.pathname && "/" === i.pathname.charAt(0)
  31829. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31830. , v = m || g || i.host && e.pathname
  31831. , y = v
  31832. , A = i.pathname && i.pathname.split("/") || []
  31833. , C = (d = e.pathname && e.pathname.split("/") || [],
  31834. i.protocol && !W[i.protocol]);
  31835. if (C && (i.hostname = "",
  31836. i.port = null,
  31837. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31838. i.host = "",
  31839. e.protocol && (e.hostname = null,
  31840. e.port = null,
  31841. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31842. e.host = null),
  31843. v = v && ("" === d[0] || "" === A[0])),
  31844. m)
  31845. i.host = e.host || "" === e.host ? e.host : i.host,
  31846. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31847. i.search = e.search,
  31848. i.query = e.query,
  31849. A = d;
  31850. else if (d.length)
  31851. (A = A || []).pop(),
  31852. A = A.concat(d),
  31853. i.search = e.search,
  31854. i.query = e.query;
  31855. else if (!D.isNullOrUndefined(e.search)) {
  31856. if (C)
  31857. i.hostname = i.host = A.shift(),
  31858. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31859. i.host = i.hostname = w.shift());
  31860. return i.search = e.search,
  31861. i.query = e.query,
  31862. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31863. i.href = i.format(),
  31864. i
  31865. }
  31866. if (!A.length)
  31867. return i.pathname = null,
  31868. i.search ? i.path = "/" + i.search : i.path = null,
  31869. i.href = i.format(),
  31870. i;
  31871. 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--)
  31872. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31873. _++) : _ && (A.splice(b, 1),
  31874. _--);
  31875. if (!v && !y)
  31876. for (; _--; )
  31877. A.unshift("..");
  31878. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31879. E && "/" !== A.join("/").substr(-1) && A.push("");
  31880. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31881. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31882. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31883. i.host = i.hostname = w.shift()));
  31884. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31885. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31886. i.path = null),
  31887. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31888. i.auth = e.auth || i.auth,
  31889. i.slashes = i.slashes || e.slashes,
  31890. i.href = i.format(),
  31891. i
  31892. }
  31893. ,
  31894. x.prototype.parseHost = function() {
  31895. var e = this.host
  31896. , t = r.exec(e);
  31897. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31898. e = e.substr(0, e.length - t.length)),
  31899. e && (this.hostname = e)
  31900. }
  31901. }
  31902. , {
  31903. "./util": 209,
  31904. punycode: 204,
  31905. querystring: 207
  31906. }],
  31907. 209: [function(e, t, i) {
  31908. "use strict";
  31909. t.exports = {
  31910. isString: function(e) {
  31911. return "string" == typeof e
  31912. },
  31913. isObject: function(e) {
  31914. return "object" == typeof e && null !== e
  31915. },
  31916. isNull: function(e) {
  31917. return null === e
  31918. },
  31919. isNullOrUndefined: function(e) {
  31920. return null == e
  31921. }
  31922. }
  31923. }
  31924. , {}],
  31925. 210: [function(e, t, i) {
  31926. "use strict";
  31927. function r(e) {
  31928. return c + e
  31929. }
  31930. function s(e) {
  31931. if ("string" != typeof e)
  31932. throw new TypeError("key must be a string.")
  31933. }
  31934. var l = Object.prototype.hasOwnProperty
  31935. , c = "~";
  31936. t.exports = function(t) {
  31937. var o = Object.create(null)
  31938. , n = 0
  31939. , a = {};
  31940. return function(e, t) {
  31941. for (var i in t)
  31942. Object.defineProperty(e, i, {
  31943. value: t[i],
  31944. configurable: !0,
  31945. writable: !0
  31946. })
  31947. }(a, {
  31948. get: function(e, t) {
  31949. s(e);
  31950. var i = r(e);
  31951. return i in o ? o[i] : t
  31952. },
  31953. set: function(e, t) {
  31954. s(e);
  31955. var i = r(e);
  31956. return i in o || ++n,
  31957. o[i] = t
  31958. },
  31959. has: function(e) {
  31960. return s(e),
  31961. r(e)in o
  31962. },
  31963. delete: function(e) {
  31964. s(e);
  31965. var t = r(e);
  31966. return t in o && (--n,
  31967. delete o[t],
  31968. !0)
  31969. },
  31970. clear: function() {
  31971. o = Object.create(null),
  31972. n = 0
  31973. },
  31974. forEach: function(e, t) {
  31975. if ("function" != typeof e)
  31976. throw new TypeError("`callback` must be a function");
  31977. for (var i in o)
  31978. if (l.call(o, i)) {
  31979. var n = i.substring(c.length)
  31980. , r = o[i];
  31981. e.call(t, r, n, a)
  31982. }
  31983. }
  31984. }),
  31985. Object.defineProperty(a, "size", {
  31986. get: function() {
  31987. return n
  31988. },
  31989. configurable: !0
  31990. }),
  31991. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31992. a.set(e, t[e])
  31993. }),
  31994. a
  31995. }
  31996. }
  31997. , {}],
  31998. 211: [function(e, t, i) {
  31999. t.exports = e("./lib/heap")
  32000. }
  32001. , {
  32002. "./lib/heap": 212
  32003. }],
  32004. 212: [function(e, y, A) {
  32005. (function() {
  32006. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  32007. function v(e) {
  32008. this.cmp = null != e ? e : d,
  32009. this.nodes = []
  32010. }
  32011. l = Math.floor,
  32012. m = Math.min,
  32013. d = function(e, t) {
  32014. return e < t ? -1 : t < e ? 1 : 0
  32015. }
  32016. ,
  32017. g = function(e, t, i, n, r) {
  32018. var o;
  32019. if (null == i && (i = 0),
  32020. null == r && (r = d),
  32021. i < 0)
  32022. throw new Error("lo must be non-negative");
  32023. for (null == n && (n = e.length); i < n; )
  32024. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  32025. return [].splice.apply(e, [i, i - i].concat(t)),
  32026. t
  32027. }
  32028. ,
  32029. t = function(e, t, i) {
  32030. return null == i && (i = d),
  32031. e.push(t),
  32032. h(e, 0, e.length - 1, i)
  32033. }
  32034. ,
  32035. f = function(e, t) {
  32036. var i, n;
  32037. return null == t && (t = d),
  32038. i = e.pop(),
  32039. e.length ? (n = e[0],
  32040. e[0] = i,
  32041. u(e, 0, t)) : n = i,
  32042. n
  32043. }
  32044. ,
  32045. i = function(e, t, i) {
  32046. var n;
  32047. return null == i && (i = d),
  32048. n = e[0],
  32049. e[0] = t,
  32050. u(e, 0, i),
  32051. n
  32052. }
  32053. ,
  32054. c = function(e, t, i) {
  32055. var n;
  32056. return null == i && (i = d),
  32057. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  32058. e[0] = n[1],
  32059. u(e, 0, i)),
  32060. t
  32061. }
  32062. ,
  32063. p = function(i, e) {
  32064. var t, n, r, o, a, s;
  32065. for (null == e && (e = d),
  32066. a = [],
  32067. n = 0,
  32068. r = (o = function() {
  32069. s = [];
  32070. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  32071. s.push(e);
  32072. return s
  32073. }
  32074. .apply(this).reverse()).length; n < r; n++)
  32075. t = o[n],
  32076. a.push(u(i, t, e));
  32077. return a
  32078. }
  32079. ,
  32080. o = function(e, t, i) {
  32081. var n;
  32082. if (null == i && (i = d),
  32083. -1 !== (n = e.indexOf(t)))
  32084. return h(e, 0, n, i),
  32085. u(e, n, i)
  32086. }
  32087. ,
  32088. n = function(e, t, i) {
  32089. var n, r, o, a, s;
  32090. if (null == i && (i = d),
  32091. !(r = e.slice(0, t)).length)
  32092. return r;
  32093. for (p(r, i),
  32094. o = 0,
  32095. a = (s = e.slice(t)).length; o < a; o++)
  32096. n = s[o],
  32097. c(r, n, i);
  32098. return r.sort(i).reverse()
  32099. }
  32100. ,
  32101. r = function(e, t, i) {
  32102. var n, r, o, a, s, l, c, h, u;
  32103. if (null == i && (i = d),
  32104. 10 * t <= e.length) {
  32105. if (!(o = e.slice(0, t).sort(i)).length)
  32106. return o;
  32107. for (r = o[o.length - 1],
  32108. a = 0,
  32109. l = (c = e.slice(t)).length; a < l; a++)
  32110. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  32111. o.pop(),
  32112. r = o[o.length - 1]);
  32113. return o
  32114. }
  32115. for (p(e, i),
  32116. u = [],
  32117. s = 0,
  32118. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  32119. u.push(f(e, i));
  32120. return u
  32121. }
  32122. ,
  32123. h = function(e, t, i, n) {
  32124. var r, o, a;
  32125. for (null == n && (n = d),
  32126. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  32127. e[i] = o,
  32128. i = a;
  32129. return e[i] = r
  32130. }
  32131. ,
  32132. u = function(e, t, i) {
  32133. var n, r, o, a, s;
  32134. for (null == i && (i = d),
  32135. r = e.length,
  32136. o = e[s = t],
  32137. n = 2 * t + 1; n < r; )
  32138. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  32139. e[t] = e[n],
  32140. n = 2 * (t = n) + 1;
  32141. return e[t] = o,
  32142. h(e, s, t, i)
  32143. }
  32144. ,
  32145. v.push = t,
  32146. v.pop = f,
  32147. v.replace = i,
  32148. v.pushpop = c,
  32149. v.heapify = p,
  32150. v.updateItem = o,
  32151. v.nlargest = n,
  32152. v.nsmallest = r,
  32153. v.prototype.push = function(e) {
  32154. return t(this.nodes, e, this.cmp)
  32155. }
  32156. ,
  32157. v.prototype.pop = function() {
  32158. return f(this.nodes, this.cmp)
  32159. }
  32160. ,
  32161. v.prototype.peek = function() {
  32162. return this.nodes[0]
  32163. }
  32164. ,
  32165. v.prototype.contains = function(e) {
  32166. return -1 !== this.nodes.indexOf(e)
  32167. }
  32168. ,
  32169. v.prototype.replace = function(e) {
  32170. return i(this.nodes, e, this.cmp)
  32171. }
  32172. ,
  32173. v.prototype.pushpop = function(e) {
  32174. return c(this.nodes, e, this.cmp)
  32175. }
  32176. ,
  32177. v.prototype.heapify = function() {
  32178. return p(this.nodes, this.cmp)
  32179. }
  32180. ,
  32181. v.prototype.updateItem = function(e) {
  32182. return o(this.nodes, e, this.cmp)
  32183. }
  32184. ,
  32185. v.prototype.clear = function() {
  32186. return this.nodes = []
  32187. }
  32188. ,
  32189. v.prototype.empty = function() {
  32190. return 0 === this.nodes.length
  32191. }
  32192. ,
  32193. v.prototype.size = function() {
  32194. return this.nodes.length
  32195. }
  32196. ,
  32197. v.prototype.clone = function() {
  32198. var e;
  32199. return (e = new v).nodes = this.nodes.slice(0),
  32200. e
  32201. }
  32202. ,
  32203. v.prototype.toArray = function() {
  32204. return this.nodes.slice(0)
  32205. }
  32206. ,
  32207. v.prototype.insert = v.prototype.push,
  32208. v.prototype.top = v.prototype.peek,
  32209. v.prototype.front = v.prototype.peek,
  32210. v.prototype.has = v.prototype.contains,
  32211. v.prototype.copy = v.prototype.clone,
  32212. e = v,
  32213. a = this,
  32214. s = function() {
  32215. return e
  32216. }
  32217. ,
  32218. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32219. }
  32220. ).call(this)
  32221. }
  32222. , {}],
  32223. 213: [function(e, t, i) {
  32224. function n() {}
  32225. function o(e) {
  32226. if ("object" != typeof this)
  32227. throw new TypeError("Promises must be constructed via new");
  32228. if ("function" != typeof e)
  32229. throw new TypeError("not a function");
  32230. this._state = 0,
  32231. this._handled = !1,
  32232. this._value = void 0,
  32233. this._deferreds = [],
  32234. h(e, this)
  32235. }
  32236. function r(i, n) {
  32237. for (; 3 === i._state; )
  32238. i = i._value;
  32239. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32240. void o._immediateFn(function() {
  32241. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32242. if (null !== e) {
  32243. var t;
  32244. try {
  32245. t = e(i._value)
  32246. } catch (e) {
  32247. return void s(n.promise, e)
  32248. }
  32249. a(n.promise, t)
  32250. } else
  32251. (1 === i._state ? a : s)(n.promise, i._value)
  32252. }))
  32253. }
  32254. function a(e, t) {
  32255. try {
  32256. if (t === e)
  32257. throw new TypeError("A promise cannot be resolved with itself.");
  32258. if (t && ("object" == typeof t || "function" == typeof t)) {
  32259. var i = t.then;
  32260. if (t instanceof o)
  32261. return e._state = 3,
  32262. e._value = t,
  32263. void l(e);
  32264. if ("function" == typeof i)
  32265. return void h(function(e, t) {
  32266. return function() {
  32267. e.apply(t, arguments)
  32268. }
  32269. }(i, t), e)
  32270. }
  32271. e._state = 1,
  32272. e._value = t,
  32273. l(e)
  32274. } catch (t) {
  32275. s(e, t)
  32276. }
  32277. }
  32278. function s(e, t) {
  32279. e._state = 2,
  32280. e._value = t,
  32281. l(e)
  32282. }
  32283. function l(e) {
  32284. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32285. e._handled || o._unhandledRejectionFn(e._value)
  32286. });
  32287. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32288. r(e, e._deferreds[t]);
  32289. e._deferreds = null
  32290. }
  32291. function c(e, t, i) {
  32292. this.onFulfilled = "function" == typeof e ? e : null,
  32293. this.onRejected = "function" == typeof t ? t : null,
  32294. this.promise = i
  32295. }
  32296. function h(e, t) {
  32297. var i = !1;
  32298. try {
  32299. e(function(e) {
  32300. i || (i = !0,
  32301. a(t, e))
  32302. }, function(e) {
  32303. i || (i = !0,
  32304. s(t, e))
  32305. })
  32306. } catch (e) {
  32307. if (i)
  32308. return;
  32309. i = !0,
  32310. s(t, e)
  32311. }
  32312. }
  32313. var u, d;
  32314. u = this,
  32315. d = setTimeout,
  32316. o.prototype.catch = function(e) {
  32317. return this.then(null, e)
  32318. }
  32319. ,
  32320. o.prototype.then = function(e, t) {
  32321. var i = new this.constructor(n);
  32322. return r(this, new c(e,t,i)),
  32323. i
  32324. }
  32325. ,
  32326. o.all = function(e) {
  32327. var s = Array.prototype.slice.call(e);
  32328. return new o(function(n, r) {
  32329. function o(t, e) {
  32330. try {
  32331. if (e && ("object" == typeof e || "function" == typeof e)) {
  32332. var i = e.then;
  32333. if ("function" == typeof i)
  32334. return void i.call(e, function(e) {
  32335. o(t, e)
  32336. }, r)
  32337. }
  32338. s[t] = e,
  32339. 0 == --a && n(s)
  32340. } catch (e) {
  32341. r(e)
  32342. }
  32343. }
  32344. if (0 === s.length)
  32345. return n([]);
  32346. for (var a = s.length, e = 0; e < s.length; e++)
  32347. o(e, s[e])
  32348. }
  32349. )
  32350. }
  32351. ,
  32352. o.resolve = function(t) {
  32353. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32354. e(t)
  32355. }
  32356. )
  32357. }
  32358. ,
  32359. o.reject = function(i) {
  32360. return new o(function(e, t) {
  32361. t(i)
  32362. }
  32363. )
  32364. }
  32365. ,
  32366. o.race = function(r) {
  32367. return new o(function(e, t) {
  32368. for (var i = 0, n = r.length; i < n; i++)
  32369. r[i].then(e, t)
  32370. }
  32371. )
  32372. }
  32373. ,
  32374. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32375. setImmediate(e)
  32376. }
  32377. || function(e) {
  32378. d(e, 0)
  32379. }
  32380. ,
  32381. o._unhandledRejectionFn = function(e) {
  32382. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32383. }
  32384. ,
  32385. o._setImmediateFn = function(e) {
  32386. o._immediateFn = e
  32387. }
  32388. ,
  32389. o._setUnhandledRejectionFn = function(e) {
  32390. o._unhandledRejectionFn = e
  32391. }
  32392. ,
  32393. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32394. }
  32395. , {}],
  32396. 214: [function(p, i, e) {
  32397. (function(d) {
  32398. var e, t;
  32399. e = this,
  32400. t = function(I, e) {
  32401. "use strict";
  32402. var a, t, u, i, s, n, r, o = {};
  32403. return o.ByteBuffer = I,
  32404. o.Long = I.Long || null,
  32405. o.VERSION = "5.0.1",
  32406. o.WIRE_TYPES = {},
  32407. o.WIRE_TYPES.VARINT = 0,
  32408. o.WIRE_TYPES.BITS64 = 1,
  32409. o.WIRE_TYPES.LDELIM = 2,
  32410. o.WIRE_TYPES.STARTGROUP = 3,
  32411. o.WIRE_TYPES.ENDGROUP = 4,
  32412. o.WIRE_TYPES.BITS32 = 5,
  32413. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32414. o.TYPES = {
  32415. int32: {
  32416. name: "int32",
  32417. wireType: o.WIRE_TYPES.VARINT,
  32418. defaultValue: 0
  32419. },
  32420. uint32: {
  32421. name: "uint32",
  32422. wireType: o.WIRE_TYPES.VARINT,
  32423. defaultValue: 0
  32424. },
  32425. sint32: {
  32426. name: "sint32",
  32427. wireType: o.WIRE_TYPES.VARINT,
  32428. defaultValue: 0
  32429. },
  32430. int64: {
  32431. name: "int64",
  32432. wireType: o.WIRE_TYPES.VARINT,
  32433. defaultValue: o.Long ? o.Long.ZERO : void 0
  32434. },
  32435. uint64: {
  32436. name: "uint64",
  32437. wireType: o.WIRE_TYPES.VARINT,
  32438. defaultValue: o.Long ? o.Long.UZERO : void 0
  32439. },
  32440. sint64: {
  32441. name: "sint64",
  32442. wireType: o.WIRE_TYPES.VARINT,
  32443. defaultValue: o.Long ? o.Long.ZERO : void 0
  32444. },
  32445. bool: {
  32446. name: "bool",
  32447. wireType: o.WIRE_TYPES.VARINT,
  32448. defaultValue: !1
  32449. },
  32450. double: {
  32451. name: "double",
  32452. wireType: o.WIRE_TYPES.BITS64,
  32453. defaultValue: 0
  32454. },
  32455. string: {
  32456. name: "string",
  32457. wireType: o.WIRE_TYPES.LDELIM,
  32458. defaultValue: ""
  32459. },
  32460. bytes: {
  32461. name: "bytes",
  32462. wireType: o.WIRE_TYPES.LDELIM,
  32463. defaultValue: null
  32464. },
  32465. fixed32: {
  32466. name: "fixed32",
  32467. wireType: o.WIRE_TYPES.BITS32,
  32468. defaultValue: 0
  32469. },
  32470. sfixed32: {
  32471. name: "sfixed32",
  32472. wireType: o.WIRE_TYPES.BITS32,
  32473. defaultValue: 0
  32474. },
  32475. fixed64: {
  32476. name: "fixed64",
  32477. wireType: o.WIRE_TYPES.BITS64,
  32478. defaultValue: o.Long ? o.Long.UZERO : void 0
  32479. },
  32480. sfixed64: {
  32481. name: "sfixed64",
  32482. wireType: o.WIRE_TYPES.BITS64,
  32483. defaultValue: o.Long ? o.Long.ZERO : void 0
  32484. },
  32485. float: {
  32486. name: "float",
  32487. wireType: o.WIRE_TYPES.BITS32,
  32488. defaultValue: 0
  32489. },
  32490. enum: {
  32491. name: "enum",
  32492. wireType: o.WIRE_TYPES.VARINT,
  32493. defaultValue: 0
  32494. },
  32495. message: {
  32496. name: "message",
  32497. wireType: o.WIRE_TYPES.LDELIM,
  32498. defaultValue: null
  32499. },
  32500. group: {
  32501. name: "group",
  32502. wireType: o.WIRE_TYPES.STARTGROUP,
  32503. defaultValue: null
  32504. }
  32505. },
  32506. 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],
  32507. o.ID_MIN = 1,
  32508. o.ID_MAX = 536870911,
  32509. o.convertFieldsToCamelCase = !1,
  32510. o.populateAccessors = !0,
  32511. o.populateDefaults = !0,
  32512. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32513. r.XHR = function() {
  32514. for (var e = [function() {
  32515. return new XMLHttpRequest
  32516. }
  32517. , function() {
  32518. return new ActiveXObject("Msxml2.XMLHTTP")
  32519. }
  32520. , function() {
  32521. return new ActiveXObject("Msxml3.XMLHTTP")
  32522. }
  32523. , function() {
  32524. return new ActiveXObject("Microsoft.XMLHTTP")
  32525. }
  32526. ], t = null, i = 0; i < e.length; i++) {
  32527. try {
  32528. t = e[i]()
  32529. } catch (e) {
  32530. continue
  32531. }
  32532. break
  32533. }
  32534. if (!t)
  32535. throw Error("XMLHttpRequest is not supported");
  32536. return t
  32537. }
  32538. ,
  32539. r.fetch = function(e, i) {
  32540. if (i && "function" != typeof i && (i = null),
  32541. r.IS_NODE) {
  32542. var t = p("fs");
  32543. if (i)
  32544. t.readFile(e, function(e, t) {
  32545. i(e ? null : "" + t)
  32546. });
  32547. else
  32548. try {
  32549. return t.readFileSync(e)
  32550. } catch (e) {
  32551. return null
  32552. }
  32553. } else {
  32554. var n = r.XHR();
  32555. if (n.open("GET", e, !!i),
  32556. n.setRequestHeader("Accept", "text/plain"),
  32557. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32558. !i)
  32559. return n.send(null),
  32560. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32561. if (n.onreadystatechange = function() {
  32562. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32563. }
  32564. ,
  32565. 4 == n.readyState)
  32566. return;
  32567. n.send(null)
  32568. }
  32569. }
  32570. ,
  32571. r.toCamelCase = function(e) {
  32572. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32573. return t.toUpperCase()
  32574. })
  32575. }
  32576. ,
  32577. r),
  32578. o.Lang = {
  32579. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32580. RULE: /^(?:required|optional|repeated|map)$/,
  32581. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32582. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32583. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32584. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32585. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32586. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32587. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32588. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32589. NUMBER_OCT: /^0[0-7]+$/,
  32590. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32591. BOOL: /^(?:true|false)$/i,
  32592. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32593. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32594. WHITESPACE: /\s/,
  32595. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32596. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32597. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32598. },
  32599. o.DotProto = function(r, a) {
  32600. function s(e, t) {
  32601. var i = -1
  32602. , n = 1;
  32603. if ("-" == e.charAt(0) && (n = -1,
  32604. e = e.substring(1)),
  32605. a.NUMBER_DEC.test(e))
  32606. i = parseInt(e);
  32607. else if (a.NUMBER_HEX.test(e))
  32608. i = parseInt(e.substring(2), 16);
  32609. else {
  32610. if (!a.NUMBER_OCT.test(e))
  32611. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32612. i = parseInt(e.substring(1), 8)
  32613. }
  32614. if (i = n * i | 0,
  32615. !t && i < 0)
  32616. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32617. return i
  32618. }
  32619. function o(e) {
  32620. var t = 1;
  32621. if ("-" == e.charAt(0) && (t = -1,
  32622. e = e.substring(1)),
  32623. a.NUMBER_DEC.test(e))
  32624. return t * parseInt(e, 10);
  32625. if (a.NUMBER_HEX.test(e))
  32626. return t * parseInt(e.substring(2), 16);
  32627. if (a.NUMBER_OCT.test(e))
  32628. return t * parseInt(e.substring(1), 8);
  32629. if ("inf" === e)
  32630. return t * (1 / 0);
  32631. if ("nan" === e)
  32632. return NaN;
  32633. if (a.NUMBER_FLT.test(e))
  32634. return t * parseFloat(e);
  32635. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32636. }
  32637. function n(e, t, i) {
  32638. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32639. e[t].push(i))
  32640. }
  32641. function t(e) {
  32642. this.source = e + "",
  32643. this.index = 0,
  32644. this.line = 1,
  32645. this.stack = [],
  32646. this._stringOpen = null
  32647. }
  32648. var e = {}
  32649. , i = t.prototype;
  32650. i._readString = function() {
  32651. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32652. e.lastIndex = this.index - 1;
  32653. var t = e.exec(this.source);
  32654. if (!t)
  32655. throw Error("unterminated string");
  32656. return this.index = e.lastIndex,
  32657. this.stack.push(this._stringOpen),
  32658. this._stringOpen = null,
  32659. t[1]
  32660. }
  32661. ,
  32662. i.next = function() {
  32663. if (0 < this.stack.length)
  32664. return this.stack.shift();
  32665. if (this.index >= this.source.length)
  32666. return null;
  32667. if (null !== this._stringOpen)
  32668. return this._readString();
  32669. var e, t, i;
  32670. do {
  32671. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32672. if ("\n" === i && ++this.line,
  32673. ++this.index === this.source.length)
  32674. return null;
  32675. if ("/" === this.source.charAt(this.index))
  32676. if (++this.index,
  32677. "/" === this.source.charAt(this.index)) {
  32678. for (; "\n" !== this.source.charAt(++this.index); )
  32679. if (this.index == this.source.length)
  32680. return null;
  32681. ++this.index,
  32682. ++this.line,
  32683. e = !0
  32684. } else {
  32685. if ("*" !== (i = this.source.charAt(this.index)))
  32686. return "/";
  32687. do {
  32688. if ("\n" === i && ++this.line,
  32689. ++this.index === this.source.length)
  32690. return null;
  32691. t = i,
  32692. i = this.source.charAt(this.index)
  32693. } while ("*" !== t || "/" !== i);++this.index,
  32694. e = !0
  32695. }
  32696. } while (e);if (this.index === this.source.length)
  32697. return null;
  32698. var n = this.index;
  32699. if (a.DELIM.lastIndex = 0,
  32700. !a.DELIM.test(this.source.charAt(n++)))
  32701. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32702. ++n;
  32703. var r = this.source.substring(this.index, this.index = n);
  32704. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32705. r
  32706. }
  32707. ,
  32708. i.peek = function() {
  32709. if (0 === this.stack.length) {
  32710. var e = this.next();
  32711. if (null === e)
  32712. return null;
  32713. this.stack.push(e)
  32714. }
  32715. return this.stack[0]
  32716. }
  32717. ,
  32718. i.skip = function(e) {
  32719. var t = this.next();
  32720. if (t !== e)
  32721. throw Error("illegal '" + t + "', '" + e + "' expected")
  32722. }
  32723. ,
  32724. i.omit = function(e) {
  32725. return this.peek() === e && (this.next(),
  32726. !0)
  32727. }
  32728. ,
  32729. i.toString = function() {
  32730. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32731. }
  32732. ,
  32733. e.Tokenizer = t;
  32734. function l(e) {
  32735. this.tn = new t(e),
  32736. this.proto3 = !1
  32737. }
  32738. var c = l.prototype;
  32739. return c.parse = function() {
  32740. var e, t, i = {
  32741. name: "[ROOT]",
  32742. package: null,
  32743. messages: [],
  32744. enums: [],
  32745. imports: [],
  32746. options: {},
  32747. services: []
  32748. }, n = !0;
  32749. try {
  32750. for (; e = this.tn.next(); )
  32751. switch (e) {
  32752. case "package":
  32753. if (!n || null !== i.package)
  32754. throw Error("unexpected 'package'");
  32755. if (e = this.tn.next(),
  32756. !a.TYPEREF.test(e))
  32757. throw Error("illegal package name: " + e);
  32758. this.tn.skip(";"),
  32759. i.package = e;
  32760. break;
  32761. case "import":
  32762. if (!n)
  32763. throw Error("unexpected 'import'");
  32764. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32765. e = this._readString(),
  32766. this.tn.skip(";"),
  32767. t || i.imports.push(e);
  32768. break;
  32769. case "syntax":
  32770. if (!n)
  32771. throw Error("unexpected 'syntax'");
  32772. this.tn.skip("="),
  32773. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32774. this.tn.skip(";");
  32775. break;
  32776. case "message":
  32777. this._parseMessage(i, null),
  32778. n = !1;
  32779. break;
  32780. case "enum":
  32781. this._parseEnum(i),
  32782. n = !1;
  32783. break;
  32784. case "option":
  32785. this._parseOption(i);
  32786. break;
  32787. case "service":
  32788. this._parseService(i);
  32789. break;
  32790. case "extend":
  32791. this._parseExtend(i);
  32792. break;
  32793. default:
  32794. throw Error("unexpected '" + e + "'")
  32795. }
  32796. } catch (e) {
  32797. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32798. e
  32799. }
  32800. return delete i.name,
  32801. i
  32802. }
  32803. ,
  32804. l.parse = function(e) {
  32805. return new l(e).parse()
  32806. }
  32807. ,
  32808. c._readString = function() {
  32809. var e, t, i = "";
  32810. do {
  32811. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32812. throw Error("illegal string delimiter: " + t);
  32813. i += this.tn.next(),
  32814. this.tn.skip(t),
  32815. e = this.tn.peek()
  32816. } while ('"' === e || '"' === e);return i
  32817. }
  32818. ,
  32819. c._readValue = function(e) {
  32820. var t = this.tn.peek();
  32821. if ('"' === t || "'" === t)
  32822. return this._readString();
  32823. if (this.tn.next(),
  32824. a.NUMBER.test(t))
  32825. return o(t);
  32826. if (a.BOOL.test(t))
  32827. return "true" === t.toLowerCase();
  32828. if (e && a.TYPEREF.test(t))
  32829. return t;
  32830. throw Error("illegal value: " + t)
  32831. }
  32832. ,
  32833. c._parseOption = function(e, t) {
  32834. var i = this.tn.next()
  32835. , n = !1;
  32836. if ("(" === i && (n = !0,
  32837. i = this.tn.next()),
  32838. !a.TYPEREF.test(i))
  32839. throw Error("illegal option name: " + i);
  32840. var r = i;
  32841. n && (this.tn.skip(")"),
  32842. r = "(" + r + ")",
  32843. i = this.tn.peek(),
  32844. a.FQTYPEREF.test(i) && (r += i,
  32845. this.tn.next())),
  32846. this.tn.skip("="),
  32847. this._parseOptionValue(e, r),
  32848. t || this.tn.skip(";")
  32849. }
  32850. ,
  32851. c._parseOptionValue = function(e, t) {
  32852. var i = this.tn.peek();
  32853. if ("{" !== i)
  32854. n(e.options, t, this._readValue(!0));
  32855. else
  32856. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32857. if (!a.NAME.test(i))
  32858. throw Error("illegal option name: " + t + "." + i);
  32859. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32860. }
  32861. }
  32862. ,
  32863. c._parseService = function(e) {
  32864. var t = this.tn.next();
  32865. if (!a.NAME.test(t))
  32866. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32867. var i = {
  32868. name: t,
  32869. rpc: {},
  32870. options: {}
  32871. };
  32872. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32873. if ("option" === t)
  32874. this._parseOption(i);
  32875. else {
  32876. if ("rpc" !== t)
  32877. throw Error("illegal service token: " + t);
  32878. this._parseServiceRPC(i)
  32879. }
  32880. this.tn.omit(";"),
  32881. e.services.push(i)
  32882. }
  32883. ,
  32884. c._parseServiceRPC = function(e) {
  32885. var t = this.tn.next();
  32886. if (!a.NAME.test(t))
  32887. throw Error("illegal rpc service method name: " + t);
  32888. var i = t
  32889. , n = {
  32890. request: null,
  32891. response: null,
  32892. request_stream: !1,
  32893. response_stream: !1,
  32894. options: {}
  32895. };
  32896. if (this.tn.skip("("),
  32897. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32898. t = this.tn.next()),
  32899. !a.TYPEREF.test(t))
  32900. throw Error("illegal rpc service request type: " + t);
  32901. if (n.request = t,
  32902. this.tn.skip(")"),
  32903. "returns" !== (t = this.tn.next()).toLowerCase())
  32904. throw Error("illegal rpc service request type delimiter: " + t);
  32905. if (this.tn.skip("("),
  32906. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32907. t = this.tn.next()),
  32908. n.response = t,
  32909. this.tn.skip(")"),
  32910. "{" === (t = this.tn.peek())) {
  32911. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32912. if ("option" !== t)
  32913. throw Error("illegal rpc service token: " + t);
  32914. this._parseOption(n)
  32915. }
  32916. this.tn.omit(";")
  32917. } else
  32918. this.tn.skip(";");
  32919. void 0 === e.rpc && (e.rpc = {}),
  32920. e.rpc[i] = n
  32921. }
  32922. ,
  32923. c._parseMessage = function(e, t) {
  32924. var i = !!t
  32925. , n = this.tn.next()
  32926. , r = {
  32927. name: "",
  32928. fields: [],
  32929. enums: [],
  32930. messages: [],
  32931. options: {},
  32932. services: [],
  32933. oneofs: {}
  32934. };
  32935. if (!a.NAME.test(n))
  32936. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32937. for (r.name = n,
  32938. i && (this.tn.skip("="),
  32939. t.id = s(this.tn.next()),
  32940. r.isGroup = !0),
  32941. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32942. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32943. if (a.RULE.test(n))
  32944. this._parseMessageField(r, n);
  32945. else if ("oneof" === n)
  32946. this._parseMessageOneOf(r);
  32947. else if ("enum" === n)
  32948. this._parseEnum(r);
  32949. else if ("message" === n)
  32950. this._parseMessage(r);
  32951. else if ("option" === n)
  32952. this._parseOption(r);
  32953. else if ("service" === n)
  32954. this._parseService(r);
  32955. else if ("extensions" === n)
  32956. r.extensions = this._parseExtensionRanges();
  32957. else if ("reserved" === n)
  32958. this._parseIgnored();
  32959. else if ("extend" === n)
  32960. this._parseExtend(r);
  32961. else {
  32962. if (!a.TYPEREF.test(n))
  32963. throw Error("illegal message token: " + n);
  32964. if (!this.proto3)
  32965. throw Error("illegal field rule: " + n);
  32966. this._parseMessageField(r, "optional", n)
  32967. }
  32968. return this.tn.omit(";"),
  32969. e.messages.push(r),
  32970. r
  32971. }
  32972. ,
  32973. c._parseIgnored = function() {
  32974. for (; ";" !== this.tn.peek(); )
  32975. this.tn.next();
  32976. this.tn.skip(";")
  32977. }
  32978. ,
  32979. c._parseMessageField = function(e, t, i) {
  32980. if (!a.RULE.test(t))
  32981. throw Error("illegal message field rule: " + t);
  32982. var n, r = {
  32983. rule: t,
  32984. type: "",
  32985. name: "",
  32986. options: {},
  32987. id: 0
  32988. };
  32989. if ("map" === t) {
  32990. if (i)
  32991. throw Error("illegal type: " + i);
  32992. if (this.tn.skip("<"),
  32993. n = this.tn.next(),
  32994. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32995. throw Error("illegal message field type: " + n);
  32996. if (r.keytype = n,
  32997. this.tn.skip(","),
  32998. n = this.tn.next(),
  32999. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33000. throw Error("illegal message field: " + n);
  33001. if (r.type = n,
  33002. this.tn.skip(">"),
  33003. n = this.tn.next(),
  33004. !a.NAME.test(n))
  33005. throw Error("illegal message field name: " + n);
  33006. r.name = n,
  33007. this.tn.skip("="),
  33008. r.id = s(this.tn.next()),
  33009. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33010. this.tn.skip(";")
  33011. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  33012. var o = this._parseMessage(e, r);
  33013. if (!/^[A-Z]/.test(o.name))
  33014. throw Error("illegal group name: " + o.name);
  33015. r.type = o.name,
  33016. r.name = o.name.toLowerCase(),
  33017. this.tn.omit(";")
  33018. } else {
  33019. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  33020. throw Error("illegal message field type: " + i);
  33021. if (r.type = i,
  33022. n = this.tn.next(),
  33023. !a.NAME.test(n))
  33024. throw Error("illegal message field name: " + n);
  33025. r.name = n,
  33026. this.tn.skip("="),
  33027. r.id = s(this.tn.next()),
  33028. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33029. this.tn.skip(";")
  33030. }
  33031. return e.fields.push(r),
  33032. r
  33033. }
  33034. ,
  33035. c._parseMessageOneOf = function(e) {
  33036. var t = this.tn.next();
  33037. if (!a.NAME.test(t))
  33038. throw Error("illegal oneof name: " + t);
  33039. var i, n = t, r = [];
  33040. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33041. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  33042. r.push(i.id);
  33043. this.tn.omit(";"),
  33044. e.oneofs[n] = r
  33045. }
  33046. ,
  33047. c._parseFieldOptions = function(e) {
  33048. this.tn.skip("[");
  33049. for (var t = !0; "]" !== this.tn.peek(); )
  33050. t || this.tn.skip(","),
  33051. this._parseOption(e, !0),
  33052. t = !1;
  33053. this.tn.next()
  33054. }
  33055. ,
  33056. c._parseEnum = function(e) {
  33057. var t = {
  33058. name: "",
  33059. values: [],
  33060. options: {}
  33061. }
  33062. , i = this.tn.next();
  33063. if (!a.NAME.test(i))
  33064. throw Error("illegal name: " + i);
  33065. for (t.name = i,
  33066. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33067. if ("option" === i)
  33068. this._parseOption(t);
  33069. else {
  33070. if (!a.NAME.test(i))
  33071. throw Error("illegal name: " + i);
  33072. this.tn.skip("=");
  33073. var n = {
  33074. name: i,
  33075. id: s(this.tn.next(), !0)
  33076. };
  33077. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  33078. options: {}
  33079. }),
  33080. this.tn.skip(";"),
  33081. t.values.push(n)
  33082. }
  33083. this.tn.omit(";"),
  33084. e.enums.push(t)
  33085. }
  33086. ,
  33087. c._parseExtensionRanges = function() {
  33088. var e, t, i, n = [];
  33089. do {
  33090. for (t = []; ; ) {
  33091. switch (e = this.tn.next()) {
  33092. case "min":
  33093. i = r.ID_MIN;
  33094. break;
  33095. case "max":
  33096. i = r.ID_MAX;
  33097. break;
  33098. default:
  33099. i = o(e)
  33100. }
  33101. if (t.push(i),
  33102. 2 === t.length)
  33103. break;
  33104. if ("to" !== this.tn.peek()) {
  33105. t.push(i);
  33106. break
  33107. }
  33108. this.tn.next()
  33109. }
  33110. n.push(t)
  33111. } while (this.tn.omit(","));return this.tn.skip(";"),
  33112. n
  33113. }
  33114. ,
  33115. c._parseExtend = function(e) {
  33116. var t = this.tn.next();
  33117. if (!a.TYPEREF.test(t))
  33118. throw Error("illegal extend reference: " + t);
  33119. var i = {
  33120. ref: t,
  33121. fields: []
  33122. };
  33123. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33124. if (a.RULE.test(t))
  33125. this._parseMessageField(i, t);
  33126. else {
  33127. if (!a.TYPEREF.test(t))
  33128. throw Error("illegal extend token: " + t);
  33129. if (!this.proto3)
  33130. throw Error("illegal field rule: " + t);
  33131. this._parseMessageField(i, "optional", t)
  33132. }
  33133. return this.tn.omit(";"),
  33134. e.messages.push(i),
  33135. i
  33136. }
  33137. ,
  33138. c.toString = function() {
  33139. return "Parser at line " + this.tn.line
  33140. }
  33141. ,
  33142. e.Parser = l,
  33143. e
  33144. }(o, o.Lang),
  33145. o.Reflect = function(g) {
  33146. function a(e, t) {
  33147. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  33148. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  33149. if ("string" == typeof e)
  33150. return g.Long.fromString(e, t || !1, 10);
  33151. if ("number" == typeof e)
  33152. return g.Long.fromNumber(e, t || !1);
  33153. throw Error("not convertible to Long")
  33154. }
  33155. function m(e, t) {
  33156. var i = t.readVarint32()
  33157. , n = 7 & i
  33158. , r = i >>> 3;
  33159. switch (n) {
  33160. case g.WIRE_TYPES.VARINT:
  33161. for (; 128 == (128 & (i = t.readUint8())); )
  33162. ;
  33163. break;
  33164. case g.WIRE_TYPES.BITS64:
  33165. t.offset += 8;
  33166. break;
  33167. case g.WIRE_TYPES.LDELIM:
  33168. i = t.readVarint32(),
  33169. t.offset += i;
  33170. break;
  33171. case g.WIRE_TYPES.STARTGROUP:
  33172. m(r, t);
  33173. break;
  33174. case g.WIRE_TYPES.ENDGROUP:
  33175. if (r === e)
  33176. return !1;
  33177. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  33178. case g.WIRE_TYPES.BITS32:
  33179. t.offset += 4;
  33180. break;
  33181. default:
  33182. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  33183. }
  33184. return !0
  33185. }
  33186. function h(e, t, i) {
  33187. this.builder = e,
  33188. this.parent = t,
  33189. this.name = i,
  33190. this.className
  33191. }
  33192. var s = {}
  33193. , e = h.prototype;
  33194. e.fqn = function() {
  33195. for (var e = this.name, t = this; null != (t = t.parent); )
  33196. e = t.name + "." + e;
  33197. return e
  33198. }
  33199. ,
  33200. e.toString = function(e) {
  33201. return (e ? this.className + " " : "") + this.fqn()
  33202. }
  33203. ,
  33204. e.build = function() {
  33205. throw Error(this.toString(!0) + " cannot be built directly")
  33206. }
  33207. ,
  33208. s.T = h;
  33209. function l(e, t, i, n, r) {
  33210. h.call(this, e, t, i),
  33211. this.className = "Namespace",
  33212. this.children = [],
  33213. this.options = n || {},
  33214. this.syntax = r || "proto2"
  33215. }
  33216. var t = l.prototype = Object.create(h.prototype);
  33217. t.getChildren = function(e) {
  33218. if (null == (e = e || null))
  33219. return this.children.slice();
  33220. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33221. this.children[i]instanceof e && t.push(this.children[i]);
  33222. return t
  33223. }
  33224. ,
  33225. t.addChild = function(e) {
  33226. var t;
  33227. if (t = this.getChild(e.name))
  33228. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33229. t.name = t.originalName;
  33230. else {
  33231. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33232. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33233. e.name = e.originalName
  33234. }
  33235. this.children.push(e)
  33236. }
  33237. ,
  33238. t.getChild = function(e) {
  33239. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33240. if (this.children[i][t] === e)
  33241. return this.children[i];
  33242. return null
  33243. }
  33244. ,
  33245. t.resolve = function(e, t) {
  33246. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33247. if ("" === n[o]) {
  33248. for (; null !== r.parent; )
  33249. r = r.parent;
  33250. o++
  33251. }
  33252. do {
  33253. do {
  33254. if (!(r instanceof s.Namespace)) {
  33255. r = null;
  33256. break
  33257. }
  33258. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33259. r = null;
  33260. break
  33261. }
  33262. r = i,
  33263. o++
  33264. } while (o < n.length);if (null != r)
  33265. break;
  33266. if (null !== this.parent)
  33267. return this.parent.resolve(e, t)
  33268. } while (null != r);return r
  33269. }
  33270. ,
  33271. t.qn = function(e) {
  33272. for (var t = [], i = e; t.unshift(i.name),
  33273. null !== (i = i.parent); )
  33274. ;
  33275. for (var n = 1; n <= t.length; n++) {
  33276. var r = t.slice(t.length - n);
  33277. if (e === this.resolve(r, e instanceof s.Namespace))
  33278. return r.join(".")
  33279. }
  33280. return e.fqn()
  33281. }
  33282. ,
  33283. t.build = function() {
  33284. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33285. (e = i[n])instanceof l && (t[e.name] = e.build());
  33286. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33287. value: this.buildOpt()
  33288. }),
  33289. t
  33290. }
  33291. ,
  33292. t.buildOpt = function() {
  33293. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33294. var r = t[i]
  33295. , o = this.options[t[i]];
  33296. e[r] = o
  33297. }
  33298. return e
  33299. }
  33300. ,
  33301. t.getOption = function(e) {
  33302. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33303. }
  33304. ,
  33305. s.Namespace = l;
  33306. function u(e, t, i, n) {
  33307. if (this.type = e,
  33308. this.resolvedType = t,
  33309. this.isMapKey = i,
  33310. this.syntax = n,
  33311. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33312. throw Error("Invalid map key type: " + e.name)
  33313. }
  33314. var i = u.prototype;
  33315. u.defaultFieldValue = function(e) {
  33316. if ("string" == typeof e && (e = g.TYPES[e]),
  33317. void 0 === e.defaultValue)
  33318. throw Error("default value for type " + e.name + " is not supported");
  33319. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33320. }
  33321. ,
  33322. i.verifyValue = function(t) {
  33323. function i(e, t) {
  33324. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33325. }
  33326. var n = this;
  33327. switch (this.type) {
  33328. case g.TYPES.int32:
  33329. case g.TYPES.sint32:
  33330. case g.TYPES.sfixed32:
  33331. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33332. 4294967295 < t ? 0 | t : t;
  33333. case g.TYPES.uint32:
  33334. case g.TYPES.fixed32:
  33335. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33336. t < 0 ? t >>> 0 : t;
  33337. case g.TYPES.int64:
  33338. case g.TYPES.sint64:
  33339. case g.TYPES.sfixed64:
  33340. if (g.Long)
  33341. try {
  33342. return a(t, !1)
  33343. } catch (e) {
  33344. i(typeof t, e.message)
  33345. }
  33346. else
  33347. i(typeof t, "requires Long.js");
  33348. case g.TYPES.uint64:
  33349. case g.TYPES.fixed64:
  33350. if (g.Long)
  33351. try {
  33352. return a(t, !0)
  33353. } catch (e) {
  33354. i(typeof t, e.message)
  33355. }
  33356. else
  33357. i(typeof t, "requires Long.js");
  33358. case g.TYPES.bool:
  33359. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33360. t;
  33361. case g.TYPES.float:
  33362. case g.TYPES.double:
  33363. return "number" != typeof t && i(typeof t, "not a number"),
  33364. t;
  33365. case g.TYPES.string:
  33366. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33367. "" + t;
  33368. case g.TYPES.bytes:
  33369. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33370. case g.TYPES.enum:
  33371. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33372. for (o = 0; o < e.length; o++) {
  33373. if (e[o].name == t)
  33374. return e[o].id;
  33375. if (e[o].id == t)
  33376. return e[o].id
  33377. }
  33378. if ("proto3" === this.syntax)
  33379. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33380. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33381. t;
  33382. i(t, "not a valid enum value");
  33383. case g.TYPES.group:
  33384. case g.TYPES.message:
  33385. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33386. t instanceof this.resolvedType.clazz)
  33387. return t;
  33388. if (t instanceof g.Builder.Message) {
  33389. var r = {};
  33390. for (var o in t)
  33391. t.hasOwnProperty(o) && (r[o] = t[o]);
  33392. t = r
  33393. }
  33394. return new this.resolvedType.clazz(t)
  33395. }
  33396. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33397. }
  33398. ,
  33399. i.calculateLength = function(e, t) {
  33400. if (null === t)
  33401. return 0;
  33402. var i;
  33403. switch (this.type) {
  33404. case g.TYPES.int32:
  33405. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33406. case g.TYPES.uint32:
  33407. return I.calculateVarint32(t);
  33408. case g.TYPES.sint32:
  33409. return I.calculateVarint32(I.zigZagEncode32(t));
  33410. case g.TYPES.fixed32:
  33411. case g.TYPES.sfixed32:
  33412. case g.TYPES.float:
  33413. return 4;
  33414. case g.TYPES.int64:
  33415. case g.TYPES.uint64:
  33416. return I.calculateVarint64(t);
  33417. case g.TYPES.sint64:
  33418. return I.calculateVarint64(I.zigZagEncode64(t));
  33419. case g.TYPES.fixed64:
  33420. case g.TYPES.sfixed64:
  33421. return 8;
  33422. case g.TYPES.bool:
  33423. return 1;
  33424. case g.TYPES.enum:
  33425. return I.calculateVarint32(t);
  33426. case g.TYPES.double:
  33427. return 8;
  33428. case g.TYPES.string:
  33429. return i = I.calculateUTF8Bytes(t),
  33430. I.calculateVarint32(i) + i;
  33431. case g.TYPES.bytes:
  33432. if (t.remaining() < 0)
  33433. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33434. return I.calculateVarint32(t.remaining()) + t.remaining();
  33435. case g.TYPES.message:
  33436. return i = this.resolvedType.calculate(t),
  33437. I.calculateVarint32(i) + i;
  33438. case g.TYPES.group:
  33439. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33440. }
  33441. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33442. }
  33443. ,
  33444. i.encodeValue = function(e, t, i) {
  33445. if (null === t)
  33446. return i;
  33447. switch (this.type) {
  33448. case g.TYPES.int32:
  33449. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33450. break;
  33451. case g.TYPES.uint32:
  33452. i.writeVarint32(t);
  33453. break;
  33454. case g.TYPES.sint32:
  33455. i.writeVarint32ZigZag(t);
  33456. break;
  33457. case g.TYPES.fixed32:
  33458. i.writeUint32(t);
  33459. break;
  33460. case g.TYPES.sfixed32:
  33461. i.writeInt32(t);
  33462. break;
  33463. case g.TYPES.int64:
  33464. case g.TYPES.uint64:
  33465. i.writeVarint64(t);
  33466. break;
  33467. case g.TYPES.sint64:
  33468. i.writeVarint64ZigZag(t);
  33469. break;
  33470. case g.TYPES.fixed64:
  33471. i.writeUint64(t);
  33472. break;
  33473. case g.TYPES.sfixed64:
  33474. i.writeInt64(t);
  33475. break;
  33476. case g.TYPES.bool:
  33477. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33478. break;
  33479. case g.TYPES.enum:
  33480. i.writeVarint32(t);
  33481. break;
  33482. case g.TYPES.float:
  33483. i.writeFloat32(t);
  33484. break;
  33485. case g.TYPES.double:
  33486. i.writeFloat64(t);
  33487. break;
  33488. case g.TYPES.string:
  33489. i.writeVString(t);
  33490. break;
  33491. case g.TYPES.bytes:
  33492. if (t.remaining() < 0)
  33493. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33494. var n = t.offset;
  33495. i.writeVarint32(t.remaining()),
  33496. i.append(t),
  33497. t.offset = n;
  33498. break;
  33499. case g.TYPES.message:
  33500. var r = (new I).LE();
  33501. this.resolvedType.encode(t, r),
  33502. i.writeVarint32(r.offset),
  33503. i.append(r.flip());
  33504. break;
  33505. case g.TYPES.group:
  33506. this.resolvedType.encode(t, i),
  33507. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33508. break;
  33509. default:
  33510. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33511. }
  33512. return i
  33513. }
  33514. ,
  33515. i.decode = function(e, t, i) {
  33516. if (t != this.type.wireType)
  33517. throw Error("Unexpected wire type for element");
  33518. var n, r;
  33519. switch (this.type) {
  33520. case g.TYPES.int32:
  33521. return 0 | e.readVarint32();
  33522. case g.TYPES.uint32:
  33523. return e.readVarint32() >>> 0;
  33524. case g.TYPES.sint32:
  33525. return 0 | e.readVarint32ZigZag();
  33526. case g.TYPES.fixed32:
  33527. return e.readUint32() >>> 0;
  33528. case g.TYPES.sfixed32:
  33529. return 0 | e.readInt32();
  33530. case g.TYPES.int64:
  33531. return e.readVarint64();
  33532. case g.TYPES.uint64:
  33533. return e.readVarint64().toUnsigned();
  33534. case g.TYPES.sint64:
  33535. return e.readVarint64ZigZag();
  33536. case g.TYPES.fixed64:
  33537. return e.readUint64();
  33538. case g.TYPES.sfixed64:
  33539. return e.readInt64();
  33540. case g.TYPES.bool:
  33541. return !!e.readVarint32();
  33542. case g.TYPES.enum:
  33543. return e.readVarint32();
  33544. case g.TYPES.float:
  33545. return e.readFloat();
  33546. case g.TYPES.double:
  33547. return e.readDouble();
  33548. case g.TYPES.string:
  33549. return e.readVString();
  33550. case g.TYPES.bytes:
  33551. if (r = e.readVarint32(),
  33552. e.remaining() < r)
  33553. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33554. return (n = e.clone()).limit = n.offset + r,
  33555. e.offset += r,
  33556. n;
  33557. case g.TYPES.message:
  33558. return r = e.readVarint32(),
  33559. this.resolvedType.decode(e, r);
  33560. case g.TYPES.group:
  33561. return this.resolvedType.decode(e, -1, i)
  33562. }
  33563. throw Error("[INTERNAL] Illegal decode type")
  33564. }
  33565. ,
  33566. i.valueFromString = function(e) {
  33567. if (!this.isMapKey)
  33568. throw Error("valueFromString() called on non-map-key element");
  33569. switch (this.type) {
  33570. case g.TYPES.int32:
  33571. case g.TYPES.sint32:
  33572. case g.TYPES.sfixed32:
  33573. case g.TYPES.uint32:
  33574. case g.TYPES.fixed32:
  33575. return this.verifyValue(parseInt(e));
  33576. case g.TYPES.int64:
  33577. case g.TYPES.sint64:
  33578. case g.TYPES.sfixed64:
  33579. case g.TYPES.uint64:
  33580. case g.TYPES.fixed64:
  33581. return this.verifyValue(e);
  33582. case g.TYPES.bool:
  33583. return "true" === e;
  33584. case g.TYPES.string:
  33585. return this.verifyValue(e);
  33586. case g.TYPES.bytes:
  33587. return I.fromBinary(e)
  33588. }
  33589. }
  33590. ,
  33591. i.valueToString = function(e) {
  33592. if (!this.isMapKey)
  33593. throw Error("valueToString() called on non-map-key element");
  33594. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33595. }
  33596. ,
  33597. s.Element = u;
  33598. var d = function(e, t, i, n, r, o) {
  33599. l.call(this, e, t, i, n, o),
  33600. this.className = "Message",
  33601. this.extensions = void 0,
  33602. this.clazz = null,
  33603. this.isGroup = !!r,
  33604. this._fields = null,
  33605. this._fieldsById = null,
  33606. this._fieldsByName = null
  33607. }
  33608. , n = d.prototype = Object.create(l.prototype);
  33609. n.build = function(e) {
  33610. if (this.clazz && !e)
  33611. return this.clazz;
  33612. var t = function(u, a) {
  33613. function d(e, i, n, r) {
  33614. if (null === e || "object" != typeof e) {
  33615. if (r && r instanceof u.Reflect.Enum) {
  33616. var t = u.Reflect.Enum.getName(r.object, e);
  33617. if (null !== t)
  33618. return t
  33619. }
  33620. return e
  33621. }
  33622. if (I.isByteBuffer(e))
  33623. return i ? e.toBase64() : e.toBuffer();
  33624. if (u.Long.isLong(e))
  33625. return n ? e.toString() : u.Long.fromValue(e);
  33626. var o;
  33627. if (Array.isArray(e))
  33628. return o = [],
  33629. e.forEach(function(e, t) {
  33630. o[t] = d(e, i, n, r)
  33631. }),
  33632. o;
  33633. if (o = {},
  33634. e instanceof u.Map) {
  33635. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33636. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33637. return o
  33638. }
  33639. var l = e.$type
  33640. , c = void 0;
  33641. for (var h in e)
  33642. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33643. return o
  33644. }
  33645. var s = a.getChildren(u.Reflect.Message.Field)
  33646. , l = a.getChildren(u.Reflect.Message.OneOf)
  33647. , c = function(e, t) {
  33648. u.Builder.Message.call(this);
  33649. for (var i = 0, n = l.length; i < n; ++i)
  33650. this[l[i].name] = null;
  33651. for (i = 0,
  33652. n = s.length; i < n; ++i) {
  33653. var r = s[i];
  33654. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33655. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33656. }
  33657. var o;
  33658. if (0 < arguments.length)
  33659. 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)
  33660. for (i = 0,
  33661. n = arguments.length; i < n; ++i)
  33662. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33663. else
  33664. this.$set(e)
  33665. }
  33666. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33667. o.add = function(e, t, i) {
  33668. var n = a._fieldsByName[e];
  33669. if (!i) {
  33670. if (!n)
  33671. throw Error(this + "#" + e + " is undefined");
  33672. if (!(n instanceof u.Reflect.Message.Field))
  33673. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33674. if (!n.repeated)
  33675. throw Error(this + "#" + e + " is not a repeated field");
  33676. t = n.verifyValue(t, !0)
  33677. }
  33678. return null === this[e] && (this[e] = []),
  33679. this[e].push(t),
  33680. this
  33681. }
  33682. ,
  33683. o.$add = o.add,
  33684. o.set = function(e, t, i) {
  33685. if (e && "object" == typeof e) {
  33686. for (var n in i = t,
  33687. e)
  33688. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33689. return this
  33690. }
  33691. var r = a._fieldsByName[e];
  33692. if (i)
  33693. this[e] = t;
  33694. else {
  33695. if (!r)
  33696. throw Error(this + "#" + e + " is not a field: undefined");
  33697. if (!(r instanceof u.Reflect.Message.Field))
  33698. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33699. this[r.name] = t = r.verifyValue(t)
  33700. }
  33701. if (r && r.oneof) {
  33702. var o = this[r.oneof.name];
  33703. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33704. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33705. }
  33706. return this
  33707. }
  33708. ,
  33709. o.$set = o.set,
  33710. o.get = function(e, t) {
  33711. if (t)
  33712. return this[e];
  33713. var i = a._fieldsByName[e];
  33714. if (!(i && i instanceof u.Reflect.Message.Field))
  33715. throw Error(this + "#" + e + " is not a field: undefined");
  33716. if (!(i instanceof u.Reflect.Message.Field))
  33717. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33718. return this[i.name]
  33719. }
  33720. ,
  33721. o.$get = o.get;
  33722. for (var e = 0; e < s.length; e++) {
  33723. var t = s[e];
  33724. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33725. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33726. return e.toUpperCase().replace("_", "")
  33727. });
  33728. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33729. function t(e, t) {
  33730. return this[i.name] = t ? e : i.verifyValue(e),
  33731. this
  33732. }
  33733. function n() {
  33734. return this[i.name]
  33735. }
  33736. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33737. return "_" + e
  33738. });
  33739. null === a.getChild("set" + e) && (o["set" + e] = t),
  33740. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33741. null === a.getChild("get" + e) && (o["get" + e] = n),
  33742. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33743. }(t)
  33744. }
  33745. return o.encode = function(t, e) {
  33746. "boolean" == typeof t && (e = t,
  33747. t = void 0);
  33748. var i = !1;
  33749. t || (t = new I,
  33750. i = !0);
  33751. var n = t.littleEndian;
  33752. try {
  33753. return a.encode(this, t.LE(), e),
  33754. (i ? t.flip() : t).LE(n)
  33755. } catch (e) {
  33756. throw t.LE(n),
  33757. e
  33758. }
  33759. }
  33760. ,
  33761. c.encode = function(e, t, i) {
  33762. return new c(e).encode(t, i)
  33763. }
  33764. ,
  33765. o.calculate = function() {
  33766. return a.calculate(this)
  33767. }
  33768. ,
  33769. o.encodeDelimited = function(e, t) {
  33770. var i = !1;
  33771. e || (e = new I,
  33772. i = !0);
  33773. var n = (new I).LE();
  33774. return a.encode(this, n, t).flip(),
  33775. e.writeVarint32(n.remaining()),
  33776. e.append(n),
  33777. i ? e.flip() : e
  33778. }
  33779. ,
  33780. o.encodeAB = function() {
  33781. try {
  33782. return this.encode().toArrayBuffer()
  33783. } catch (e) {
  33784. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33785. e
  33786. }
  33787. }
  33788. ,
  33789. o.toArrayBuffer = o.encodeAB,
  33790. o.encodeNB = function() {
  33791. try {
  33792. return this.encode().toBuffer()
  33793. } catch (e) {
  33794. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33795. e
  33796. }
  33797. }
  33798. ,
  33799. o.toBuffer = o.encodeNB,
  33800. o.encode64 = function() {
  33801. try {
  33802. return this.encode().toBase64()
  33803. } catch (e) {
  33804. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33805. e
  33806. }
  33807. }
  33808. ,
  33809. o.toBase64 = o.encode64,
  33810. o.encodeHex = function() {
  33811. try {
  33812. return this.encode().toHex()
  33813. } catch (e) {
  33814. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33815. e
  33816. }
  33817. }
  33818. ,
  33819. o.toHex = o.encodeHex,
  33820. o.toRaw = function(e, t) {
  33821. return d(this, !!e, !!t, this.$type)
  33822. }
  33823. ,
  33824. o.encodeJSON = function() {
  33825. return JSON.stringify(d(this, !0, !0, this.$type))
  33826. }
  33827. ,
  33828. c.decode = function(t, e, i) {
  33829. "string" == typeof e && (i = e,
  33830. e = -1),
  33831. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33832. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33833. try {
  33834. var r = a.decode(t.LE());
  33835. return t.LE(n),
  33836. r
  33837. } catch (e) {
  33838. throw t.LE(n),
  33839. e
  33840. }
  33841. }
  33842. ,
  33843. c.decodeDelimited = function(t, e) {
  33844. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33845. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33846. return null;
  33847. var i = t.offset
  33848. , n = t.readVarint32();
  33849. if (t.remaining() < n)
  33850. return t.offset = i,
  33851. null;
  33852. try {
  33853. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33854. return t.offset += n,
  33855. r
  33856. } catch (e) {
  33857. throw t.offset += n,
  33858. e
  33859. }
  33860. }
  33861. ,
  33862. c.decode64 = function(e) {
  33863. return c.decode(e, "base64")
  33864. }
  33865. ,
  33866. c.decodeHex = function(e) {
  33867. return c.decode(e, "hex")
  33868. }
  33869. ,
  33870. c.decodeJSON = function(e) {
  33871. return new c(JSON.parse(e))
  33872. }
  33873. ,
  33874. o.toString = function() {
  33875. return a.toString()
  33876. }
  33877. ,
  33878. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33879. value: a.buildOpt()
  33880. }),
  33881. Object.defineProperty(o, "$options", {
  33882. value: c.$options
  33883. }),
  33884. Object.defineProperty(c, "$type", {
  33885. value: a
  33886. }),
  33887. Object.defineProperty(o, "$type", {
  33888. value: a
  33889. })),
  33890. c
  33891. }(g, this);
  33892. this._fields = [],
  33893. this._fieldsById = {},
  33894. this._fieldsByName = {};
  33895. for (var i, n = 0, r = this.children.length; n < r; n++)
  33896. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33897. if (t.hasOwnProperty(i.name))
  33898. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33899. t[i.name] = i.build()
  33900. } else if (i instanceof d.Field)
  33901. i.build(),
  33902. this._fields.push(i),
  33903. this._fieldsById[i.id] = i,
  33904. this._fieldsByName[i.name] = i;
  33905. else if (!(i instanceof d.OneOf || i instanceof v))
  33906. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33907. return this.clazz = t
  33908. }
  33909. ,
  33910. n.encode = function(e, t, i) {
  33911. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33912. r = e[(n = this._fields[a]).name],
  33913. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33914. if (null === o)
  33915. return t;
  33916. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33917. throw l.encoded = t,
  33918. l
  33919. }
  33920. ,
  33921. n.calculate = function(e) {
  33922. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33923. if (i = e[(t = this._fields[r]).name],
  33924. t.required && null === i)
  33925. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33926. n += t.calculate(i, e)
  33927. }
  33928. return n
  33929. }
  33930. ,
  33931. n.decode = function(e, t, i) {
  33932. t = "number" == typeof t ? t : -1;
  33933. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33934. if (o = (n = e.readVarint32()) >>> 3,
  33935. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33936. if (o !== i)
  33937. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33938. break
  33939. }
  33940. if (a = this._fieldsById[o]) {
  33941. if (a.repeated && !a.options.packed)
  33942. l[a.name].push(a.decode(r, e));
  33943. else if (a.map) {
  33944. var c = a.decode(r, e);
  33945. l[a.name].set(c[0], c[1])
  33946. } else if (l[a.name] = a.decode(r, e),
  33947. a.oneof) {
  33948. var h = l[a.oneof.name];
  33949. null !== h && h !== a.name && (l[h] = null),
  33950. l[a.oneof.name] = a.name
  33951. }
  33952. } else
  33953. switch (r) {
  33954. case g.WIRE_TYPES.VARINT:
  33955. e.readVarint32();
  33956. break;
  33957. case g.WIRE_TYPES.BITS32:
  33958. e.offset += 4;
  33959. break;
  33960. case g.WIRE_TYPES.BITS64:
  33961. e.offset += 8;
  33962. break;
  33963. case g.WIRE_TYPES.LDELIM:
  33964. var u = e.readVarint32();
  33965. e.offset += u;
  33966. break;
  33967. case g.WIRE_TYPES.STARTGROUP:
  33968. for (; m(o, e); )
  33969. ;
  33970. break;
  33971. default:
  33972. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33973. }
  33974. }
  33975. for (var d = 0, p = this._fields.length; d < p; ++d)
  33976. if (null === l[(a = this._fields[d]).name])
  33977. if ("proto3" === this.syntax)
  33978. l[a.name] = a.defaultValue;
  33979. else {
  33980. if (a.required) {
  33981. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33982. throw f.decoded = l,
  33983. f
  33984. }
  33985. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33986. }
  33987. return l
  33988. }
  33989. ,
  33990. s.Message = d;
  33991. function c(e, t, i, n, r, o, a, s, l, c) {
  33992. h.call(this, e, t, o),
  33993. this.className = "Message.Field",
  33994. this.required = "required" === i,
  33995. this.repeated = "repeated" === i,
  33996. this.map = "map" === i,
  33997. this.keyType = n || null,
  33998. this.type = r,
  33999. this.resolvedType = null,
  34000. this.id = a,
  34001. this.options = s || {},
  34002. this.defaultValue = null,
  34003. this.oneof = l || null,
  34004. this.syntax = c || "proto2",
  34005. this.originalName = this.name,
  34006. this.element = null,
  34007. this.keyElement = null,
  34008. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  34009. }
  34010. var r = c.prototype = Object.create(h.prototype);
  34011. r.build = function() {
  34012. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  34013. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  34014. "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)
  34015. }
  34016. ,
  34017. r.verifyValue = function(e, t) {
  34018. function i(e, t) {
  34019. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  34020. }
  34021. t = t || !1;
  34022. var n, r = this;
  34023. if (null === e)
  34024. return this.required && i(typeof e, "required"),
  34025. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  34026. null;
  34027. if (!this.repeated || t)
  34028. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  34029. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  34030. this.element.verifyValue(e));
  34031. Array.isArray(e) || (e = [e]);
  34032. var o = [];
  34033. for (n = 0; n < e.length; n++)
  34034. o.push(this.element.verifyValue(e[n]));
  34035. return o
  34036. }
  34037. ,
  34038. r.hasWirePresence = function(e, t) {
  34039. if ("proto3" !== this.syntax)
  34040. return null !== e;
  34041. if (this.oneof && t[this.oneof.name] === this.name)
  34042. return !0;
  34043. switch (this.type) {
  34044. case g.TYPES.int32:
  34045. case g.TYPES.sint32:
  34046. case g.TYPES.sfixed32:
  34047. case g.TYPES.uint32:
  34048. case g.TYPES.fixed32:
  34049. return 0 !== e;
  34050. case g.TYPES.int64:
  34051. case g.TYPES.sint64:
  34052. case g.TYPES.sfixed64:
  34053. case g.TYPES.uint64:
  34054. case g.TYPES.fixed64:
  34055. return 0 !== e.low || 0 !== e.high;
  34056. case g.TYPES.bool:
  34057. return e;
  34058. case g.TYPES.float:
  34059. case g.TYPES.double:
  34060. return 0 !== e;
  34061. case g.TYPES.string:
  34062. return 0 < e.length;
  34063. case g.TYPES.bytes:
  34064. return 0 < e.remaining();
  34065. case g.TYPES.enum:
  34066. return 0 !== e;
  34067. case g.TYPES.message:
  34068. return null !== e;
  34069. default:
  34070. return !0
  34071. }
  34072. }
  34073. ,
  34074. r.encode = function(t, r, e) {
  34075. if (null === this.type || "object" != typeof this.type)
  34076. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34077. if (null === t || this.repeated && 0 == t.length)
  34078. return r;
  34079. try {
  34080. var i;
  34081. if (this.repeated)
  34082. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34083. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34084. r.ensureCapacity(r.offset += 1);
  34085. var n = r.offset;
  34086. for (i = 0; i < t.length; i++)
  34087. this.element.encodeValue(this.id, t[i], r);
  34088. var o = r.offset - n
  34089. , a = I.calculateVarint32(o);
  34090. if (1 < a) {
  34091. var s = r.slice(n, r.offset);
  34092. n += a - 1,
  34093. r.offset = n,
  34094. r.append(s)
  34095. }
  34096. r.writeVarint32(o, n - a)
  34097. } else
  34098. for (i = 0; i < t.length; i++)
  34099. r.writeVarint32(this.id << 3 | this.type.wireType),
  34100. this.element.encodeValue(this.id, t[i], r);
  34101. else
  34102. this.map ? t.forEach(function(e, t, i) {
  34103. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34104. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34105. r.writeVarint32(n),
  34106. r.writeVarint32(8 | this.keyType.wireType),
  34107. this.keyElement.encodeValue(1, t, r),
  34108. r.writeVarint32(16 | this.type.wireType),
  34109. this.element.encodeValue(2, e, r)
  34110. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  34111. this.element.encodeValue(this.id, t, r))
  34112. } catch (e) {
  34113. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34114. }
  34115. return r
  34116. }
  34117. ,
  34118. r.calculate = function(t, e) {
  34119. if (t = this.verifyValue(t),
  34120. null === this.type || "object" != typeof this.type)
  34121. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34122. if (null === t || this.repeated && 0 == t.length)
  34123. return 0;
  34124. var r = 0;
  34125. try {
  34126. var i, n;
  34127. if (this.repeated)
  34128. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34129. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34130. i = n = 0; i < t.length; i++)
  34131. n += this.element.calculateLength(this.id, t[i]);
  34132. r += I.calculateVarint32(n),
  34133. r += n
  34134. } else
  34135. for (i = 0; i < t.length; i++)
  34136. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34137. r += this.element.calculateLength(this.id, t[i]);
  34138. else
  34139. this.map ? t.forEach(function(e, t, i) {
  34140. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34141. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34142. r += I.calculateVarint32(n),
  34143. r += n
  34144. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34145. r += this.element.calculateLength(this.id, t))
  34146. } catch (e) {
  34147. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34148. }
  34149. return r
  34150. }
  34151. ,
  34152. r.decode = function(e, t, i) {
  34153. var n, r;
  34154. 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))
  34155. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  34156. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  34157. r = t.readVarint32(),
  34158. r = t.offset + r;
  34159. for (var o = []; t.offset < r; )
  34160. o.push(this.decode(this.type.wireType, t, !0));
  34161. return o
  34162. }
  34163. if (this.map) {
  34164. var a = u.defaultFieldValue(this.keyType);
  34165. if (n = u.defaultFieldValue(this.type),
  34166. r = t.readVarint32(),
  34167. t.remaining() < r)
  34168. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  34169. var s = t.clone();
  34170. for (s.limit = s.offset + r,
  34171. t.offset += r; 0 < s.remaining(); ) {
  34172. var l = s.readVarint32();
  34173. e = 7 & l;
  34174. var c = l >>> 3;
  34175. if (1 == c)
  34176. a = this.keyElement.decode(s, e, c);
  34177. else {
  34178. if (2 != c)
  34179. throw Error("Unexpected tag in map field key/value submessage");
  34180. n = this.element.decode(s, e, c)
  34181. }
  34182. }
  34183. return [a, n]
  34184. }
  34185. return this.element.decode(t, e, this.id)
  34186. }
  34187. ,
  34188. s.Message.Field = c;
  34189. function o(e, t, i, n, r, o, a) {
  34190. c.call(this, e, t, i, null, n, r, o, a),
  34191. this.extension
  34192. }
  34193. o.prototype = Object.create(c.prototype),
  34194. s.Message.ExtensionField = o;
  34195. s.Message.OneOf = function(e, t, i) {
  34196. h.call(this, e, t, i),
  34197. this.fields = []
  34198. }
  34199. ;
  34200. var p = function(e, t, i, n, r) {
  34201. l.call(this, e, t, i, n, r),
  34202. this.className = "Enum",
  34203. this.object = null
  34204. };
  34205. p.getName = function(e, t) {
  34206. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34207. if (e[i = n[r]] === t)
  34208. return i;
  34209. return null
  34210. }
  34211. ,
  34212. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34213. if (this.object && !e)
  34214. return this.object;
  34215. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34216. t[i[n].name] = i[n].id;
  34217. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34218. value: this.buildOpt(),
  34219. enumerable: !1
  34220. }),
  34221. this.object = t
  34222. }
  34223. ,
  34224. s.Enum = p;
  34225. function f(e, t, i, n) {
  34226. h.call(this, e, t, i),
  34227. this.className = "Enum.Value",
  34228. this.id = n
  34229. }
  34230. f.prototype = Object.create(h.prototype),
  34231. s.Enum.Value = f;
  34232. var v = function(e, t, i, n) {
  34233. h.call(this, e, t, i),
  34234. this.field = n
  34235. };
  34236. v.prototype = Object.create(h.prototype),
  34237. s.Extension = v;
  34238. var y = function(e, t, i, n) {
  34239. l.call(this, e, t, i, n),
  34240. this.className = "Service",
  34241. this.clazz = null
  34242. };
  34243. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34244. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34245. for (var o = function(e) {
  34246. t.Builder.Service.call(this),
  34247. this.rpcImpl = e || function(e, t, i) {
  34248. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34249. }
  34250. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34251. !function(n) {
  34252. e[n.name] = function(e, i) {
  34253. try {
  34254. try {
  34255. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34256. } catch (e) {
  34257. if (!(e instanceof TypeError))
  34258. throw e
  34259. }
  34260. if (null === e || "object" != typeof e)
  34261. throw Error("Illegal arguments");
  34262. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34263. this.rpcImpl(n.fqn(), e, function(e, t) {
  34264. if (!e) {
  34265. null === t && (t = "");
  34266. try {
  34267. t = n.resolvedResponseType.clazz.decode(t)
  34268. } catch (e) {}
  34269. 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))
  34270. }
  34271. i(e)
  34272. })
  34273. } catch (e) {
  34274. setTimeout(i.bind(this, e), 0)
  34275. }
  34276. }
  34277. ,
  34278. o[n.name] = function(e, t, i) {
  34279. new o(e)[n.name](t, i)
  34280. }
  34281. ,
  34282. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34283. value: n.buildOpt()
  34284. }),
  34285. Object.defineProperty(e[n.name], "$options", {
  34286. value: o[n.name].$options
  34287. }))
  34288. }(i[n]);
  34289. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34290. value: r.buildOpt()
  34291. }),
  34292. Object.defineProperty(e, "$options", {
  34293. value: o.$options
  34294. }),
  34295. Object.defineProperty(o, "$type", {
  34296. value: r
  34297. }),
  34298. Object.defineProperty(e, "$type", {
  34299. value: r
  34300. })),
  34301. o
  34302. }(g, this)
  34303. }
  34304. ,
  34305. s.Service = y;
  34306. function A(e, t, i, n) {
  34307. h.call(this, e, t, i),
  34308. this.className = "Service.Method",
  34309. this.options = n || {}
  34310. }
  34311. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34312. s.Service.Method = A;
  34313. function C(e, t, i, n, r, o, a, s) {
  34314. A.call(this, e, t, i, s),
  34315. this.className = "Service.RPCMethod",
  34316. this.requestName = n,
  34317. this.responseName = r,
  34318. this.requestStream = o,
  34319. this.responseStream = a,
  34320. this.resolvedRequestType = null,
  34321. this.resolvedResponseType = null
  34322. }
  34323. return C.prototype = Object.create(A.prototype),
  34324. s.Service.RPCMethod = C,
  34325. s
  34326. }(o),
  34327. o.Builder = (i = (u = o).Lang,
  34328. s = o.Reflect,
  34329. n = h.prototype,
  34330. h.isMessage = function(e) {
  34331. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34332. }
  34333. ,
  34334. h.isMessageField = function(e) {
  34335. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34336. }
  34337. ,
  34338. h.isEnum = function(e) {
  34339. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34340. }
  34341. ,
  34342. h.isService = function(e) {
  34343. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34344. }
  34345. ,
  34346. h.isExtend = function(e) {
  34347. return "string" == typeof e.ref
  34348. }
  34349. ,
  34350. n.reset = function() {
  34351. return this.ptr = this.ns,
  34352. this
  34353. }
  34354. ,
  34355. n.define = function(e) {
  34356. if ("string" != typeof e || !i.TYPEREF.test(e))
  34357. throw Error("illegal namespace: " + e);
  34358. return e.split(".").forEach(function(e) {
  34359. var t = this.ptr.getChild(e);
  34360. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34361. this.ptr = t
  34362. }, this),
  34363. this
  34364. }
  34365. ,
  34366. n.create = function(e) {
  34367. if (!e)
  34368. return this;
  34369. if (Array.isArray(e)) {
  34370. if (0 === e.length)
  34371. return this;
  34372. e = e.slice()
  34373. } else
  34374. e = [e];
  34375. for (var t = [e]; 0 < t.length; ) {
  34376. if (e = t.pop(),
  34377. !Array.isArray(e))
  34378. throw Error("not a valid namespace: " + JSON.stringify(e));
  34379. for (; 0 < e.length; ) {
  34380. var i = e.shift();
  34381. if (h.isMessage(i)) {
  34382. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34383. , n = {};
  34384. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34385. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34386. }, this),
  34387. i.fields && i.fields.forEach(function(e) {
  34388. if (null !== o.getChild(0 | e.id))
  34389. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34390. if (e.options && "object" != typeof e.options)
  34391. throw Error("illegal field options in " + o.name + "#" + e.name);
  34392. var t = null;
  34393. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34394. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34395. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34396. t && t.fields.push(e),
  34397. o.addChild(e)
  34398. }, this);
  34399. var r = [];
  34400. if (i.enums && i.enums.forEach(function(e) {
  34401. r.push(e)
  34402. }),
  34403. i.messages && i.messages.forEach(function(e) {
  34404. r.push(e)
  34405. }),
  34406. i.services && i.services.forEach(function(e) {
  34407. r.push(e)
  34408. }),
  34409. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34410. this.ptr.addChild(o),
  34411. 0 < r.length) {
  34412. t.push(e),
  34413. e = r,
  34414. r = null,
  34415. this.ptr = o,
  34416. o = null;
  34417. continue
  34418. }
  34419. r = null
  34420. } else if (h.isEnum(i))
  34421. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34422. i.values.forEach(function(e) {
  34423. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34424. }, this),
  34425. this.ptr.addChild(o);
  34426. else if (h.isService(i))
  34427. o = new s.Service(this,this.ptr,i.name,i.options),
  34428. Object.keys(i.rpc).forEach(function(e) {
  34429. var t = i.rpc[e];
  34430. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34431. }, this),
  34432. this.ptr.addChild(o);
  34433. else {
  34434. if (!h.isExtend(i))
  34435. throw Error("not a valid definition: " + JSON.stringify(i));
  34436. if (o = this.ptr.resolve(i.ref, !0))
  34437. i.fields.forEach(function(t) {
  34438. if (null !== o.getChild(0 | t.id))
  34439. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34440. if (o.extensions) {
  34441. var i = !1;
  34442. if (o.extensions.forEach(function(e) {
  34443. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34444. }),
  34445. !i)
  34446. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34447. }
  34448. var e = t.name;
  34449. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34450. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34451. , r = new s.Extension(this,this.ptr,t.name,n);
  34452. n.extension = r,
  34453. this.ptr.addChild(r),
  34454. o.addChild(n)
  34455. }, this);
  34456. else if (!/\.?google\.protobuf\./.test(i.ref))
  34457. throw Error("extended message " + i.ref + " is not defined")
  34458. }
  34459. o = i = null
  34460. }
  34461. e = null,
  34462. this.ptr = this.ptr.parent
  34463. }
  34464. return this.resolved = !1,
  34465. this.result = null,
  34466. this
  34467. }
  34468. ,
  34469. n.import = function(t, e) {
  34470. var i = "/";
  34471. if ("string" == typeof e) {
  34472. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34473. !0 === this.files[e])
  34474. return this.reset();
  34475. this.files[e] = !0
  34476. } else if ("object" == typeof e) {
  34477. var n = e.root;
  34478. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34479. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34480. var r = n + i + e.file;
  34481. if (!0 === this.files[r])
  34482. return this.reset();
  34483. this.files[r] = !0
  34484. }
  34485. if (t.imports && 0 < t.imports.length) {
  34486. var o, a = !1;
  34487. "object" == typeof e ? (this.importRoot = e.root,
  34488. a = !0,
  34489. o = this.importRoot,
  34490. e = e.file,
  34491. (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(/\\[^\\]*$/, ""),
  34492. i = "\\") : o = "." : o = null;
  34493. for (var s = 0; s < t.imports.length; s++)
  34494. if ("string" == typeof t.imports[s]) {
  34495. if (!o)
  34496. throw Error("cannot determine import root");
  34497. var l = t.imports[s];
  34498. if ("google/protobuf/descriptor.proto" === l)
  34499. continue;
  34500. if (l = o + i + l,
  34501. !0 === this.files[l])
  34502. continue;
  34503. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34504. var c = u.Util.fetch(l);
  34505. if (null === c)
  34506. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34507. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34508. } else
  34509. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34510. return t + "_import" + s + "." + i
  34511. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34512. a && (this.importRoot = null)
  34513. }
  34514. t.package && this.define(t.package),
  34515. t.syntax && function t(i) {
  34516. i.messages && i.messages.forEach(function(e) {
  34517. e.syntax = i.syntax,
  34518. t(e)
  34519. }),
  34520. i.enums && i.enums.forEach(function(e) {
  34521. e.syntax = i.syntax
  34522. })
  34523. }(t);
  34524. var h = this.ptr;
  34525. return t.options && Object.keys(t.options).forEach(function(e) {
  34526. h.options[e] = t.options[e]
  34527. }),
  34528. t.messages && (this.create(t.messages),
  34529. this.ptr = h),
  34530. t.enums && (this.create(t.enums),
  34531. this.ptr = h),
  34532. t.services && (this.create(t.services),
  34533. this.ptr = h),
  34534. t.extends && this.create(t.extends),
  34535. this.reset()
  34536. }
  34537. ,
  34538. n.resolveAll = function() {
  34539. var e;
  34540. if (null == this.ptr || "object" == typeof this.ptr.type)
  34541. return this;
  34542. if (this.ptr instanceof s.Namespace)
  34543. this.ptr.children.forEach(function(e) {
  34544. this.ptr = e,
  34545. this.resolveAll()
  34546. }, this);
  34547. else if (this.ptr instanceof s.Message.Field) {
  34548. if (i.TYPE.test(this.ptr.type))
  34549. this.ptr.type = u.TYPES[this.ptr.type];
  34550. else {
  34551. if (!i.TYPEREF.test(this.ptr.type))
  34552. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34553. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34554. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34555. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34556. if (this.ptr.type = u.TYPES.enum,
  34557. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34558. throw Error("proto3 message cannot reference proto2 enum")
  34559. } else {
  34560. if (!(e instanceof s.Message))
  34561. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34562. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34563. }
  34564. }
  34565. if (this.ptr.map) {
  34566. if (!i.TYPE.test(this.ptr.keyType))
  34567. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34568. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34569. }
  34570. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34571. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34572. throw Error("illegal service type in " + this.ptr.toString(!0));
  34573. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34574. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34575. if (this.ptr.resolvedRequestType = e,
  34576. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34577. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34578. this.ptr.resolvedResponseType = e
  34579. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34580. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34581. return this.reset()
  34582. }
  34583. ,
  34584. n.build = function(e) {
  34585. if (this.reset(),
  34586. this.resolved || (this.resolveAll(),
  34587. this.resolved = !0,
  34588. this.result = null),
  34589. null === this.result && (this.result = this.ns.build()),
  34590. !e)
  34591. return this.result;
  34592. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34593. if (!i[t[n]]) {
  34594. i = null;
  34595. break
  34596. }
  34597. i = i[t[n]]
  34598. }
  34599. return i
  34600. }
  34601. ,
  34602. n.lookup = function(e, t) {
  34603. return e ? this.ns.resolve(e, t) : this.ns
  34604. }
  34605. ,
  34606. n.toString = function() {
  34607. return "Builder"
  34608. }
  34609. ,
  34610. h.Message = function() {}
  34611. ,
  34612. h.Enum = function() {}
  34613. ,
  34614. h.Service = function() {}
  34615. ,
  34616. h),
  34617. o.Map = (a = o.Reflect,
  34618. (t = c.prototype).clear = function() {
  34619. this.map = {}
  34620. }
  34621. ,
  34622. t.delete = function(e) {
  34623. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34624. , i = t in this.map;
  34625. return delete this.map[t],
  34626. i
  34627. }
  34628. ,
  34629. t.entries = function() {
  34630. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34631. t.push([(e = this.map[i[n]]).key, e.value]);
  34632. return l(t)
  34633. }
  34634. ,
  34635. t.keys = function() {
  34636. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34637. e.push(this.map[t[i]].key);
  34638. return l(e)
  34639. }
  34640. ,
  34641. t.values = function() {
  34642. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34643. e.push(this.map[t[i]].value);
  34644. return l(e)
  34645. }
  34646. ,
  34647. t.forEach = function(e, t) {
  34648. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34649. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34650. }
  34651. ,
  34652. t.set = function(e, t) {
  34653. var i = this.keyElem.verifyValue(e)
  34654. , n = this.valueElem.verifyValue(t);
  34655. return this.map[this.keyElem.valueToString(i)] = {
  34656. key: i,
  34657. value: n
  34658. },
  34659. this
  34660. }
  34661. ,
  34662. t.get = function(e) {
  34663. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34664. if (t in this.map)
  34665. return this.map[t].value
  34666. }
  34667. ,
  34668. t.has = function(e) {
  34669. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34670. }
  34671. ,
  34672. c),
  34673. o.loadProto = function(e, t, i) {
  34674. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34675. t = void 0),
  34676. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34677. }
  34678. ,
  34679. o.protoFromString = o.loadProto,
  34680. o.loadProtoFile = function(t, i, n) {
  34681. if (i && "object" == typeof i ? (n = i,
  34682. i = null) : i && "function" == typeof i || (i = null),
  34683. i)
  34684. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34685. if (null !== e)
  34686. try {
  34687. i(null, o.loadProto(e, n, t))
  34688. } catch (e) {
  34689. i(e)
  34690. }
  34691. else
  34692. i(Error("Failed to fetch file"))
  34693. });
  34694. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34695. return null === e ? null : o.loadProto(e, n, t)
  34696. }
  34697. ,
  34698. o.protoFromFile = o.loadProtoFile,
  34699. o.newBuilder = function(e) {
  34700. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34701. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34702. new o.Builder(e)
  34703. }
  34704. ,
  34705. o.loadJson = function(e, t, i) {
  34706. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34707. t = null),
  34708. t && "object" == typeof t || (t = o.newBuilder()),
  34709. "string" == typeof e && (e = JSON.parse(e)),
  34710. t.import(e, i),
  34711. t.resolveAll(),
  34712. t
  34713. }
  34714. ,
  34715. o.loadJsonFile = function(t, i, n) {
  34716. if (i && "object" == typeof i ? (n = i,
  34717. i = null) : i && "function" == typeof i || (i = null),
  34718. i)
  34719. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34720. if (null !== e)
  34721. try {
  34722. i(null, o.loadJson(JSON.parse(e), n, t))
  34723. } catch (e) {
  34724. i(e)
  34725. }
  34726. else
  34727. i(Error("Failed to fetch file"))
  34728. });
  34729. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34730. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34731. }
  34732. ,
  34733. o;
  34734. function l(e) {
  34735. var t = 0;
  34736. return {
  34737. next: function() {
  34738. return t < e.length ? {
  34739. done: !1,
  34740. value: e[t++]
  34741. } : {
  34742. done: !0
  34743. }
  34744. }
  34745. }
  34746. }
  34747. function c(e, t) {
  34748. if (!e.map)
  34749. throw Error("field is not a map");
  34750. if (this.field = e,
  34751. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34752. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34753. this.map = {},
  34754. Object.defineProperty(this, "size", {
  34755. get: function() {
  34756. return Object.keys(this.map).length
  34757. }
  34758. }),
  34759. t)
  34760. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34761. var r = this.keyElem.valueFromString(i[n])
  34762. , o = this.valueElem.verifyValue(t[i[n]]);
  34763. this.map[this.keyElem.valueToString(r)] = {
  34764. key: r,
  34765. value: o
  34766. }
  34767. }
  34768. }
  34769. function h(e) {
  34770. this.ns = new s.Namespace(this,null,""),
  34771. this.ptr = this.ns,
  34772. this.resolved = !1,
  34773. this.result = null,
  34774. this.files = {},
  34775. this.importRoot = null,
  34776. this.options = e || {}
  34777. }
  34778. }
  34779. ,
  34780. "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)
  34781. }
  34782. ).call(this, p("_process"))
  34783. }
  34784. , {
  34785. _process: 203,
  34786. bytebuffer: 215,
  34787. fs: 197,
  34788. path: 197
  34789. }],
  34790. 215: [function(t, e, i) {
  34791. var n, r;
  34792. n = this,
  34793. r = function(l) {
  34794. "use strict";
  34795. function s(e) {
  34796. var t = 0;
  34797. return function() {
  34798. return t < e.length ? e.charCodeAt(t++) : null
  34799. }
  34800. }
  34801. function c() {
  34802. var e = []
  34803. , t = [];
  34804. return function() {
  34805. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34806. e.length = 0),
  34807. void Array.prototype.push.apply(e, arguments))
  34808. }
  34809. }
  34810. function n(e, t, i, n, r) {
  34811. 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];
  34812. for (u += d,
  34813. o = p & (1 << -h) - 1,
  34814. p >>= -h,
  34815. h += s; 0 < h; o = 256 * o + e[t + u],
  34816. u += d,
  34817. h -= 8)
  34818. ;
  34819. for (a = o & (1 << -h) - 1,
  34820. o >>= -h,
  34821. h += n; 0 < h; a = 256 * a + e[t + u],
  34822. u += d,
  34823. h -= 8)
  34824. ;
  34825. if (0 === o)
  34826. o = 1 - c;
  34827. else {
  34828. if (o === l)
  34829. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34830. a += Math.pow(2, n),
  34831. o -= c
  34832. }
  34833. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34834. }
  34835. function r(e, t, i, n, r, o) {
  34836. 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;
  34837. for (t = Math.abs(t),
  34838. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34839. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34840. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34841. l *= 2),
  34842. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34843. l /= 2),
  34844. h <= a + u ? (s = 0,
  34845. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34846. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34847. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34848. p += f,
  34849. s /= 256,
  34850. r -= 8)
  34851. ;
  34852. for (a = a << r | s,
  34853. c += r; 0 < c; e[i + p] = 255 & a,
  34854. p += f,
  34855. a /= 256,
  34856. c -= 8)
  34857. ;
  34858. e[i + p - f] |= 128 * g
  34859. }
  34860. var f = function(e, t, i) {
  34861. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34862. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34863. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34864. !i) {
  34865. if ((e |= 0) < 0)
  34866. throw RangeError("Illegal capacity");
  34867. t = !!t,
  34868. i = !!i
  34869. }
  34870. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34871. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34872. this.offset = 0,
  34873. this.markedOffset = -1,
  34874. this.limit = e,
  34875. this.littleEndian = t,
  34876. this.noAssert = i
  34877. };
  34878. f.VERSION = "5.0.1",
  34879. f.LITTLE_ENDIAN = !0,
  34880. f.BIG_ENDIAN = !1,
  34881. f.DEFAULT_CAPACITY = 16,
  34882. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34883. f.DEFAULT_NOASSERT = !1,
  34884. f.Long = l || null;
  34885. var a = f.prototype;
  34886. a.__isByteBuffer__,
  34887. Object.defineProperty(a, "__isByteBuffer__", {
  34888. value: !0,
  34889. enumerable: !1,
  34890. configurable: !1
  34891. });
  34892. var o = new ArrayBuffer(0)
  34893. , i = String.fromCharCode;
  34894. f.accessor = function() {
  34895. return Uint8Array
  34896. }
  34897. ,
  34898. f.allocate = function(e, t, i) {
  34899. return new f(e,t,i)
  34900. }
  34901. ,
  34902. f.concat = function(e, t, i, n) {
  34903. "boolean" != typeof t && "string" == typeof t || (n = i,
  34904. i = t,
  34905. t = void 0);
  34906. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34907. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34908. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34909. if (0 === o)
  34910. return new f(0,i,n);
  34911. var l, c = new f(o,i,n);
  34912. for (a = 0; a < s; )
  34913. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34914. c.offset += r);
  34915. return c.limit = c.offset,
  34916. c.offset = 0,
  34917. c
  34918. }
  34919. ,
  34920. f.isByteBuffer = function(e) {
  34921. return !0 === (e && e.__isByteBuffer__)
  34922. }
  34923. ,
  34924. f.type = function() {
  34925. return ArrayBuffer
  34926. }
  34927. ,
  34928. f.wrap = function(e, t, i, n) {
  34929. if ("string" != typeof t && (n = i,
  34930. i = t,
  34931. t = void 0),
  34932. "string" == typeof e)
  34933. switch (void 0 === t && (t = "utf8"),
  34934. t) {
  34935. case "base64":
  34936. return f.fromBase64(e, i);
  34937. case "hex":
  34938. return f.fromHex(e, i);
  34939. case "binary":
  34940. return f.fromBinary(e, i);
  34941. case "utf8":
  34942. return f.fromUTF8(e, i);
  34943. case "debug":
  34944. return f.fromDebug(e, i);
  34945. default:
  34946. throw Error("Unsupported encoding: " + t)
  34947. }
  34948. if (null === e || "object" != typeof e)
  34949. throw TypeError("Illegal buffer");
  34950. var r;
  34951. if (f.isByteBuffer(e))
  34952. return (r = a.clone.call(e)).markedOffset = -1,
  34953. r;
  34954. if (e instanceof Uint8Array)
  34955. r = new f(0,i,n),
  34956. 0 < e.length && (r.buffer = e.buffer,
  34957. r.offset = e.byteOffset,
  34958. r.limit = e.byteOffset + e.byteLength,
  34959. r.view = new Uint8Array(e.buffer));
  34960. else if (e instanceof ArrayBuffer)
  34961. r = new f(0,i,n),
  34962. 0 < e.byteLength && (r.buffer = e,
  34963. r.offset = 0,
  34964. r.limit = e.byteLength,
  34965. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34966. else {
  34967. if ("[object Array]" !== Object.prototype.toString.call(e))
  34968. throw TypeError("Illegal buffer");
  34969. (r = new f(e.length,i,n)).limit = e.length;
  34970. for (var o = 0; o < e.length; ++o)
  34971. r.view[o] = e[o]
  34972. }
  34973. return r
  34974. }
  34975. ,
  34976. a.writeBitSet = function(e, t) {
  34977. var i = void 0 === t;
  34978. if (i && (t = this.offset),
  34979. !this.noAssert) {
  34980. if (!(e instanceof Array))
  34981. throw TypeError("Illegal BitSet: Not an array");
  34982. if ("number" != typeof t || t % 1 != 0)
  34983. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34984. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34985. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34986. }
  34987. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34988. for (t += this.writeVarint32(o, t); a--; )
  34989. 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,
  34990. this.writeByte(n, t++);
  34991. if (s < o) {
  34992. var l = 0;
  34993. for (n = 0; s < o; )
  34994. n |= (1 & !!e[s++]) << l++;
  34995. this.writeByte(n, t++)
  34996. }
  34997. return i ? (this.offset = t,
  34998. this) : t - r
  34999. }
  35000. ,
  35001. a.readBitSet = function(e) {
  35002. var t = void 0 === e;
  35003. t && (e = this.offset);
  35004. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  35005. for (e += n.length; o--; )
  35006. i = this.readByte(e++),
  35007. s[a++] = !!(1 & i),
  35008. s[a++] = !!(2 & i),
  35009. s[a++] = !!(4 & i),
  35010. s[a++] = !!(8 & i),
  35011. s[a++] = !!(16 & i),
  35012. s[a++] = !!(32 & i),
  35013. s[a++] = !!(64 & i),
  35014. s[a++] = !!(128 & i);
  35015. if (a < r) {
  35016. var l = 0;
  35017. for (i = this.readByte(e++); a < r; )
  35018. s[a++] = !!(i >> l++ & 1)
  35019. }
  35020. return t && (this.offset = e),
  35021. s
  35022. }
  35023. ,
  35024. a.readBytes = function(e, t) {
  35025. var i = void 0 === t;
  35026. if (i && (t = this.offset),
  35027. !this.noAssert) {
  35028. if ("number" != typeof t || t % 1 != 0)
  35029. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35030. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  35031. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  35032. }
  35033. var n = this.slice(t, t + e);
  35034. return i && (this.offset += e),
  35035. n
  35036. }
  35037. ,
  35038. a.writeBytes = a.append,
  35039. a.writeInt8 = function(e, t) {
  35040. var i = void 0 === t;
  35041. if (i && (t = this.offset),
  35042. !this.noAssert) {
  35043. if ("number" != typeof e || e % 1 != 0)
  35044. throw TypeError("Illegal value: " + e + " (not an integer)");
  35045. if (e |= 0,
  35046. "number" != typeof t || t % 1 != 0)
  35047. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35048. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35049. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35050. }
  35051. t += 1;
  35052. var n = this.buffer.byteLength;
  35053. return n < t && this.resize((n *= 2) > t ? n : t),
  35054. t -= 1,
  35055. this.view[t] = e,
  35056. i && (this.offset += 1),
  35057. this
  35058. }
  35059. ,
  35060. a.writeByte = a.writeInt8,
  35061. a.readInt8 = function(e) {
  35062. var t = void 0 === e;
  35063. if (t && (e = this.offset),
  35064. !this.noAssert) {
  35065. if ("number" != typeof e || e % 1 != 0)
  35066. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35067. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35068. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35069. }
  35070. var i = this.view[e];
  35071. return 128 == (128 & i) && (i = -(255 - i + 1)),
  35072. t && (this.offset += 1),
  35073. i
  35074. }
  35075. ,
  35076. a.readByte = a.readInt8,
  35077. a.writeUint8 = function(e, t) {
  35078. var i = void 0 === t;
  35079. if (i && (t = this.offset),
  35080. !this.noAssert) {
  35081. if ("number" != typeof e || e % 1 != 0)
  35082. throw TypeError("Illegal value: " + e + " (not an integer)");
  35083. if (e >>>= 0,
  35084. "number" != typeof t || t % 1 != 0)
  35085. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35086. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35087. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35088. }
  35089. t += 1;
  35090. var n = this.buffer.byteLength;
  35091. return n < t && this.resize((n *= 2) > t ? n : t),
  35092. t -= 1,
  35093. this.view[t] = e,
  35094. i && (this.offset += 1),
  35095. this
  35096. }
  35097. ,
  35098. a.writeUInt8 = a.writeUint8,
  35099. a.readUint8 = function(e) {
  35100. var t = void 0 === e;
  35101. if (t && (e = this.offset),
  35102. !this.noAssert) {
  35103. if ("number" != typeof e || e % 1 != 0)
  35104. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35105. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35106. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35107. }
  35108. var i = this.view[e];
  35109. return t && (this.offset += 1),
  35110. i
  35111. }
  35112. ,
  35113. a.readUInt8 = a.readUint8,
  35114. a.writeInt16 = function(e, t) {
  35115. var i = void 0 === t;
  35116. if (i && (t = this.offset),
  35117. !this.noAssert) {
  35118. if ("number" != typeof e || e % 1 != 0)
  35119. throw TypeError("Illegal value: " + e + " (not an integer)");
  35120. if (e |= 0,
  35121. "number" != typeof t || t % 1 != 0)
  35122. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35123. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35124. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35125. }
  35126. t += 2;
  35127. var n = this.buffer.byteLength;
  35128. return n < t && this.resize((n *= 2) > t ? n : t),
  35129. t -= 2,
  35130. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35131. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35132. this.view[t + 1] = 255 & e),
  35133. i && (this.offset += 2),
  35134. this
  35135. }
  35136. ,
  35137. a.writeShort = a.writeInt16,
  35138. a.readInt16 = function(e) {
  35139. var t = void 0 === e;
  35140. if (t && (e = this.offset),
  35141. !this.noAssert) {
  35142. if ("number" != typeof e || e % 1 != 0)
  35143. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35144. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35145. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35146. }
  35147. var i = 0;
  35148. return this.littleEndian ? (i = this.view[e],
  35149. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35150. i |= this.view[e + 1]),
  35151. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  35152. t && (this.offset += 2),
  35153. i
  35154. }
  35155. ,
  35156. a.readShort = a.readInt16,
  35157. a.writeUint16 = function(e, t) {
  35158. var i = void 0 === t;
  35159. if (i && (t = this.offset),
  35160. !this.noAssert) {
  35161. if ("number" != typeof e || e % 1 != 0)
  35162. throw TypeError("Illegal value: " + e + " (not an integer)");
  35163. if (e >>>= 0,
  35164. "number" != typeof t || t % 1 != 0)
  35165. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35166. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35167. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35168. }
  35169. t += 2;
  35170. var n = this.buffer.byteLength;
  35171. return n < t && this.resize((n *= 2) > t ? n : t),
  35172. t -= 2,
  35173. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35174. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35175. this.view[t + 1] = 255 & e),
  35176. i && (this.offset += 2),
  35177. this
  35178. }
  35179. ,
  35180. a.writeUInt16 = a.writeUint16,
  35181. a.readUint16 = function(e) {
  35182. var t = void 0 === e;
  35183. if (t && (e = this.offset),
  35184. !this.noAssert) {
  35185. if ("number" != typeof e || e % 1 != 0)
  35186. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35187. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35188. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35189. }
  35190. var i = 0;
  35191. return this.littleEndian ? (i = this.view[e],
  35192. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35193. i |= this.view[e + 1]),
  35194. t && (this.offset += 2),
  35195. i
  35196. }
  35197. ,
  35198. a.readUInt16 = a.readUint16,
  35199. a.writeInt32 = function(e, t) {
  35200. var i = void 0 === t;
  35201. if (i && (t = this.offset),
  35202. !this.noAssert) {
  35203. if ("number" != typeof e || e % 1 != 0)
  35204. throw TypeError("Illegal value: " + e + " (not an integer)");
  35205. if (e |= 0,
  35206. "number" != typeof t || t % 1 != 0)
  35207. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35208. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35209. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35210. }
  35211. t += 4;
  35212. var n = this.buffer.byteLength;
  35213. return n < t && this.resize((n *= 2) > t ? n : t),
  35214. t -= 4,
  35215. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35216. this.view[t + 2] = e >>> 16 & 255,
  35217. this.view[t + 1] = e >>> 8 & 255,
  35218. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35219. this.view[t + 1] = e >>> 16 & 255,
  35220. this.view[t + 2] = e >>> 8 & 255,
  35221. this.view[t + 3] = 255 & e),
  35222. i && (this.offset += 4),
  35223. this
  35224. }
  35225. ,
  35226. a.writeInt = a.writeInt32,
  35227. a.readInt32 = function(e) {
  35228. var t = void 0 === e;
  35229. if (t && (e = this.offset),
  35230. !this.noAssert) {
  35231. if ("number" != typeof e || e % 1 != 0)
  35232. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35233. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35234. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35235. }
  35236. var i = 0;
  35237. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35238. i |= this.view[e + 1] << 8,
  35239. i |= this.view[e],
  35240. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35241. i |= this.view[e + 2] << 8,
  35242. i |= this.view[e + 3],
  35243. i += this.view[e] << 24 >>> 0),
  35244. i |= 0,
  35245. t && (this.offset += 4),
  35246. i
  35247. }
  35248. ,
  35249. a.readInt = a.readInt32,
  35250. a.writeUint32 = function(e, t) {
  35251. var i = void 0 === t;
  35252. if (i && (t = this.offset),
  35253. !this.noAssert) {
  35254. if ("number" != typeof e || e % 1 != 0)
  35255. throw TypeError("Illegal value: " + e + " (not an integer)");
  35256. if (e >>>= 0,
  35257. "number" != typeof t || t % 1 != 0)
  35258. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35259. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35260. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35261. }
  35262. t += 4;
  35263. var n = this.buffer.byteLength;
  35264. return n < t && this.resize((n *= 2) > t ? n : t),
  35265. t -= 4,
  35266. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35267. this.view[t + 2] = e >>> 16 & 255,
  35268. this.view[t + 1] = e >>> 8 & 255,
  35269. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35270. this.view[t + 1] = e >>> 16 & 255,
  35271. this.view[t + 2] = e >>> 8 & 255,
  35272. this.view[t + 3] = 255 & e),
  35273. i && (this.offset += 4),
  35274. this
  35275. }
  35276. ,
  35277. a.writeUInt32 = a.writeUint32,
  35278. a.readUint32 = function(e) {
  35279. var t = void 0 === e;
  35280. if (t && (e = this.offset),
  35281. !this.noAssert) {
  35282. if ("number" != typeof e || e % 1 != 0)
  35283. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35284. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35285. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35286. }
  35287. var i = 0;
  35288. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35289. i |= this.view[e + 1] << 8,
  35290. i |= this.view[e],
  35291. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35292. i |= this.view[e + 2] << 8,
  35293. i |= this.view[e + 3],
  35294. i += this.view[e] << 24 >>> 0),
  35295. t && (this.offset += 4),
  35296. i
  35297. }
  35298. ,
  35299. a.readUInt32 = a.readUint32,
  35300. l && (a.writeInt64 = function(e, t) {
  35301. var i = void 0 === t;
  35302. if (i && (t = this.offset),
  35303. !this.noAssert) {
  35304. if ("number" == typeof e)
  35305. e = l.fromNumber(e);
  35306. else if ("string" == typeof e)
  35307. e = l.fromString(e);
  35308. else if (!(e && e instanceof l))
  35309. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35310. if ("number" != typeof t || t % 1 != 0)
  35311. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35312. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35313. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35314. }
  35315. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35316. t += 8;
  35317. var n = this.buffer.byteLength;
  35318. n < t && this.resize((n *= 2) > t ? n : t),
  35319. t -= 8;
  35320. var r = e.low
  35321. , o = e.high;
  35322. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35323. this.view[t + 2] = r >>> 16 & 255,
  35324. this.view[t + 1] = r >>> 8 & 255,
  35325. this.view[t] = 255 & r,
  35326. t += 4,
  35327. this.view[t + 3] = o >>> 24 & 255,
  35328. this.view[t + 2] = o >>> 16 & 255,
  35329. this.view[t + 1] = o >>> 8 & 255,
  35330. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35331. this.view[t + 1] = o >>> 16 & 255,
  35332. this.view[t + 2] = o >>> 8 & 255,
  35333. this.view[t + 3] = 255 & o,
  35334. t += 4,
  35335. this.view[t] = r >>> 24 & 255,
  35336. this.view[t + 1] = r >>> 16 & 255,
  35337. this.view[t + 2] = r >>> 8 & 255,
  35338. this.view[t + 3] = 255 & r),
  35339. i && (this.offset += 8),
  35340. this
  35341. }
  35342. ,
  35343. a.writeLong = a.writeInt64,
  35344. a.readInt64 = function(e) {
  35345. var t = void 0 === e;
  35346. if (t && (e = this.offset),
  35347. !this.noAssert) {
  35348. if ("number" != typeof e || e % 1 != 0)
  35349. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35350. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35351. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35352. }
  35353. var i = 0
  35354. , n = 0;
  35355. this.littleEndian ? (i = this.view[e + 2] << 16,
  35356. i |= this.view[e + 1] << 8,
  35357. i |= this.view[e],
  35358. i += this.view[e + 3] << 24 >>> 0,
  35359. e += 4,
  35360. n = this.view[e + 2] << 16,
  35361. n |= this.view[e + 1] << 8,
  35362. n |= this.view[e],
  35363. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35364. n |= this.view[e + 2] << 8,
  35365. n |= this.view[e + 3],
  35366. n += this.view[e] << 24 >>> 0,
  35367. e += 4,
  35368. i = this.view[e + 1] << 16,
  35369. i |= this.view[e + 2] << 8,
  35370. i |= this.view[e + 3],
  35371. i += this.view[e] << 24 >>> 0);
  35372. var r = new l(i,n,!1);
  35373. return t && (this.offset += 8),
  35374. r
  35375. }
  35376. ,
  35377. a.readLong = a.readInt64,
  35378. a.writeUint64 = function(e, t) {
  35379. var i = void 0 === t;
  35380. if (i && (t = this.offset),
  35381. !this.noAssert) {
  35382. if ("number" == typeof e)
  35383. e = l.fromNumber(e);
  35384. else if ("string" == typeof e)
  35385. e = l.fromString(e);
  35386. else if (!(e && e instanceof l))
  35387. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35388. if ("number" != typeof t || t % 1 != 0)
  35389. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35390. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35391. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35392. }
  35393. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35394. t += 8;
  35395. var n = this.buffer.byteLength;
  35396. n < t && this.resize((n *= 2) > t ? n : t),
  35397. t -= 8;
  35398. var r = e.low
  35399. , o = e.high;
  35400. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35401. this.view[t + 2] = r >>> 16 & 255,
  35402. this.view[t + 1] = r >>> 8 & 255,
  35403. this.view[t] = 255 & r,
  35404. t += 4,
  35405. this.view[t + 3] = o >>> 24 & 255,
  35406. this.view[t + 2] = o >>> 16 & 255,
  35407. this.view[t + 1] = o >>> 8 & 255,
  35408. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35409. this.view[t + 1] = o >>> 16 & 255,
  35410. this.view[t + 2] = o >>> 8 & 255,
  35411. this.view[t + 3] = 255 & o,
  35412. t += 4,
  35413. this.view[t] = r >>> 24 & 255,
  35414. this.view[t + 1] = r >>> 16 & 255,
  35415. this.view[t + 2] = r >>> 8 & 255,
  35416. this.view[t + 3] = 255 & r),
  35417. i && (this.offset += 8),
  35418. this
  35419. }
  35420. ,
  35421. a.writeUInt64 = a.writeUint64,
  35422. a.readUint64 = function(e) {
  35423. var t = void 0 === e;
  35424. if (t && (e = this.offset),
  35425. !this.noAssert) {
  35426. if ("number" != typeof e || e % 1 != 0)
  35427. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35428. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35429. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35430. }
  35431. var i = 0
  35432. , n = 0;
  35433. this.littleEndian ? (i = this.view[e + 2] << 16,
  35434. i |= this.view[e + 1] << 8,
  35435. i |= this.view[e],
  35436. i += this.view[e + 3] << 24 >>> 0,
  35437. e += 4,
  35438. n = this.view[e + 2] << 16,
  35439. n |= this.view[e + 1] << 8,
  35440. n |= this.view[e],
  35441. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35442. n |= this.view[e + 2] << 8,
  35443. n |= this.view[e + 3],
  35444. n += this.view[e] << 24 >>> 0,
  35445. e += 4,
  35446. i = this.view[e + 1] << 16,
  35447. i |= this.view[e + 2] << 8,
  35448. i |= this.view[e + 3],
  35449. i += this.view[e] << 24 >>> 0);
  35450. var r = new l(i,n,!0);
  35451. return t && (this.offset += 8),
  35452. r
  35453. }
  35454. ,
  35455. a.readUInt64 = a.readUint64),
  35456. a.writeFloat32 = function(e, t) {
  35457. var i = void 0 === t;
  35458. if (i && (t = this.offset),
  35459. !this.noAssert) {
  35460. if ("number" != typeof e)
  35461. throw TypeError("Illegal value: " + e + " (not a number)");
  35462. if ("number" != typeof t || t % 1 != 0)
  35463. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35464. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35465. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35466. }
  35467. t += 4;
  35468. var n = this.buffer.byteLength;
  35469. return n < t && this.resize((n *= 2) > t ? n : t),
  35470. t -= 4,
  35471. r(this.view, e, t, this.littleEndian, 23, 4),
  35472. i && (this.offset += 4),
  35473. this
  35474. }
  35475. ,
  35476. a.writeFloat = a.writeFloat32,
  35477. a.readFloat32 = function(e) {
  35478. var t = void 0 === e;
  35479. if (t && (e = this.offset),
  35480. !this.noAssert) {
  35481. if ("number" != typeof e || e % 1 != 0)
  35482. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35483. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35484. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35485. }
  35486. var i = n(this.view, e, this.littleEndian, 23, 4);
  35487. return t && (this.offset += 4),
  35488. i
  35489. }
  35490. ,
  35491. a.readFloat = a.readFloat32,
  35492. a.writeFloat64 = function(e, t) {
  35493. var i = void 0 === t;
  35494. if (i && (t = this.offset),
  35495. !this.noAssert) {
  35496. if ("number" != typeof e)
  35497. throw TypeError("Illegal value: " + e + " (not a number)");
  35498. if ("number" != typeof t || t % 1 != 0)
  35499. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35500. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35501. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35502. }
  35503. t += 8;
  35504. var n = this.buffer.byteLength;
  35505. return n < t && this.resize((n *= 2) > t ? n : t),
  35506. t -= 8,
  35507. r(this.view, e, t, this.littleEndian, 52, 8),
  35508. i && (this.offset += 8),
  35509. this
  35510. }
  35511. ,
  35512. a.writeDouble = a.writeFloat64,
  35513. a.readFloat64 = function(e) {
  35514. var t = void 0 === e;
  35515. if (t && (e = this.offset),
  35516. !this.noAssert) {
  35517. if ("number" != typeof e || e % 1 != 0)
  35518. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35519. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35520. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35521. }
  35522. var i = n(this.view, e, this.littleEndian, 52, 8);
  35523. return t && (this.offset += 8),
  35524. i
  35525. }
  35526. ,
  35527. a.readDouble = a.readFloat64,
  35528. f.MAX_VARINT32_BYTES = 5,
  35529. f.calculateVarint32 = function(e) {
  35530. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35531. }
  35532. ,
  35533. f.zigZagEncode32 = function(e) {
  35534. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35535. }
  35536. ,
  35537. f.zigZagDecode32 = function(e) {
  35538. return e >>> 1 ^ -(1 & e) | 0
  35539. }
  35540. ,
  35541. a.writeVarint32 = function(e, t) {
  35542. var i = void 0 === t;
  35543. if (i && (t = this.offset),
  35544. !this.noAssert) {
  35545. if ("number" != typeof e || e % 1 != 0)
  35546. throw TypeError("Illegal value: " + e + " (not an integer)");
  35547. if (e |= 0,
  35548. "number" != typeof t || t % 1 != 0)
  35549. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35550. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35551. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35552. }
  35553. var n, r = f.calculateVarint32(e);
  35554. t += r;
  35555. var o = this.buffer.byteLength;
  35556. for (o < t && this.resize((o *= 2) > t ? o : t),
  35557. t -= r,
  35558. e >>>= 0; 128 <= e; )
  35559. n = 127 & e | 128,
  35560. this.view[t++] = n,
  35561. e >>>= 7;
  35562. return this.view[t++] = e,
  35563. i ? (this.offset = t,
  35564. this) : r
  35565. }
  35566. ,
  35567. a.writeVarint32ZigZag = function(e, t) {
  35568. return this.writeVarint32(f.zigZagEncode32(e), t)
  35569. }
  35570. ,
  35571. a.readVarint32 = function(e) {
  35572. var t = void 0 === e;
  35573. if (t && (e = this.offset),
  35574. !this.noAssert) {
  35575. if ("number" != typeof e || e % 1 != 0)
  35576. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35577. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35578. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35579. }
  35580. var i, n = 0, r = 0;
  35581. do {
  35582. if (!this.noAssert && e > this.limit) {
  35583. var o = Error("Truncated");
  35584. throw o.truncated = !0,
  35585. o
  35586. }
  35587. i = this.view[e++],
  35588. n < 5 && (r |= (127 & i) << 7 * n),
  35589. ++n
  35590. } while (0 != (128 & i));return r |= 0,
  35591. t ? (this.offset = e,
  35592. r) : {
  35593. value: r,
  35594. length: n
  35595. }
  35596. }
  35597. ,
  35598. a.readVarint32ZigZag = function(e) {
  35599. var t = this.readVarint32(e);
  35600. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35601. t
  35602. }
  35603. ,
  35604. l && (f.MAX_VARINT64_BYTES = 10,
  35605. f.calculateVarint64 = function(e) {
  35606. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35607. var t = e.toInt() >>> 0
  35608. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35609. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35610. 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
  35611. }
  35612. ,
  35613. f.zigZagEncode64 = function(e) {
  35614. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35615. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35616. }
  35617. ,
  35618. f.zigZagDecode64 = function(e) {
  35619. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35620. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35621. }
  35622. ,
  35623. a.writeVarint64 = function(e, t) {
  35624. var i = void 0 === t;
  35625. if (i && (t = this.offset),
  35626. !this.noAssert) {
  35627. if ("number" == typeof e)
  35628. e = l.fromNumber(e);
  35629. else if ("string" == typeof e)
  35630. e = l.fromString(e);
  35631. else if (!(e && e instanceof l))
  35632. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35633. if ("number" != typeof t || t % 1 != 0)
  35634. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35635. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35636. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35637. }
  35638. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35639. var n = f.calculateVarint64(e)
  35640. , r = e.toInt() >>> 0
  35641. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35642. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35643. t += n;
  35644. var s = this.buffer.byteLength;
  35645. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35646. t -= n,
  35647. n) {
  35648. case 10:
  35649. this.view[t + 9] = a >>> 7 & 1;
  35650. case 9:
  35651. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35652. case 8:
  35653. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35654. case 7:
  35655. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35656. case 6:
  35657. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35658. case 5:
  35659. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35660. case 4:
  35661. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35662. case 3:
  35663. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35664. case 2:
  35665. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35666. case 1:
  35667. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35668. }
  35669. return i ? (this.offset += n,
  35670. this) : n
  35671. }
  35672. ,
  35673. a.writeVarint64ZigZag = function(e, t) {
  35674. return this.writeVarint64(f.zigZagEncode64(e), t)
  35675. }
  35676. ,
  35677. a.readVarint64 = function(e) {
  35678. var t = void 0 === e;
  35679. if (t && (e = this.offset),
  35680. !this.noAssert) {
  35681. if ("number" != typeof e || e % 1 != 0)
  35682. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35683. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35684. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35685. }
  35686. var i = e
  35687. , n = 0
  35688. , r = 0
  35689. , o = 0
  35690. , a = 0;
  35691. if (n = 127 & (a = this.view[e++]),
  35692. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35693. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35694. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35695. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35696. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35697. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35698. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35699. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35700. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35701. 128 & a || this.noAssert && void 0 === a))))))))))
  35702. throw Error("Buffer overrun");
  35703. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35704. return t ? (this.offset = e,
  35705. s) : {
  35706. value: s,
  35707. length: e - i
  35708. }
  35709. }
  35710. ,
  35711. a.readVarint64ZigZag = function(e) {
  35712. var t = this.readVarint64(e);
  35713. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35714. t
  35715. }
  35716. ),
  35717. a.writeCString = function(e, t) {
  35718. var i = void 0 === t;
  35719. i && (t = this.offset);
  35720. var n, r = e.length;
  35721. if (!this.noAssert) {
  35722. if ("string" != typeof e)
  35723. throw TypeError("Illegal str: Not a string");
  35724. for (n = 0; n < r; ++n)
  35725. if (0 === e.charCodeAt(n))
  35726. throw RangeError("Illegal str: Contains NULL-characters");
  35727. if ("number" != typeof t || t % 1 != 0)
  35728. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35729. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35730. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35731. }
  35732. r = d.calculateUTF16asUTF8(s(e))[1],
  35733. t += r + 1;
  35734. var o = this.buffer.byteLength;
  35735. return o < t && this.resize((o *= 2) > t ? o : t),
  35736. t -= r + 1,
  35737. d.encodeUTF16toUTF8(s(e), function(e) {
  35738. this.view[t++] = e
  35739. }
  35740. .bind(this)),
  35741. this.view[t++] = 0,
  35742. i ? (this.offset = t,
  35743. this) : r
  35744. }
  35745. ,
  35746. a.readCString = function(e) {
  35747. var t = void 0 === e;
  35748. if (t && (e = this.offset),
  35749. !this.noAssert) {
  35750. if ("number" != typeof e || e % 1 != 0)
  35751. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35752. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35753. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35754. }
  35755. var i, n = e, r = -1;
  35756. return d.decodeUTF8toUTF16(function() {
  35757. if (0 === r)
  35758. return null;
  35759. if (e >= this.limit)
  35760. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35761. return 0 === (r = this.view[e++]) ? null : r
  35762. }
  35763. .bind(this), i = c(), !0),
  35764. t ? (this.offset = e,
  35765. i()) : {
  35766. string: i(),
  35767. length: e - n
  35768. }
  35769. }
  35770. ,
  35771. a.writeIString = function(e, t) {
  35772. var i = void 0 === t;
  35773. if (i && (t = this.offset),
  35774. !this.noAssert) {
  35775. if ("string" != typeof e)
  35776. throw TypeError("Illegal str: Not a string");
  35777. if ("number" != typeof t || t % 1 != 0)
  35778. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35779. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35780. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35781. }
  35782. var n, r = t;
  35783. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35784. t += 4 + n;
  35785. var o = this.buffer.byteLength;
  35786. if (o < t && this.resize((o *= 2) > t ? o : t),
  35787. t -= 4 + n,
  35788. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35789. this.view[t + 2] = n >>> 16 & 255,
  35790. this.view[t + 1] = n >>> 8 & 255,
  35791. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35792. this.view[t + 1] = n >>> 16 & 255,
  35793. this.view[t + 2] = n >>> 8 & 255,
  35794. this.view[t + 3] = 255 & n),
  35795. t += 4,
  35796. d.encodeUTF16toUTF8(s(e), function(e) {
  35797. this.view[t++] = e
  35798. }
  35799. .bind(this)),
  35800. t !== r + 4 + n)
  35801. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35802. return i ? (this.offset = t,
  35803. this) : t - r
  35804. }
  35805. ,
  35806. a.readIString = function(e) {
  35807. var t = void 0 === e;
  35808. if (t && (e = this.offset),
  35809. !this.noAssert) {
  35810. if ("number" != typeof e || e % 1 != 0)
  35811. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35812. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35813. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35814. }
  35815. var i = e
  35816. , n = this.readUint32(e)
  35817. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35818. return e += r.length,
  35819. t ? (this.offset = e,
  35820. r.string) : {
  35821. string: r.string,
  35822. length: e - i
  35823. }
  35824. }
  35825. ,
  35826. f.METRICS_CHARS = "c",
  35827. f.METRICS_BYTES = "b",
  35828. a.writeUTF8String = function(e, t) {
  35829. var i = void 0 === t;
  35830. if (i && (t = this.offset),
  35831. !this.noAssert) {
  35832. if ("number" != typeof t || t % 1 != 0)
  35833. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35834. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35835. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35836. }
  35837. var n, r = t;
  35838. n = d.calculateUTF16asUTF8(s(e))[1],
  35839. t += n;
  35840. var o = this.buffer.byteLength;
  35841. return o < t && this.resize((o *= 2) > t ? o : t),
  35842. t -= n,
  35843. d.encodeUTF16toUTF8(s(e), function(e) {
  35844. this.view[t++] = e
  35845. }
  35846. .bind(this)),
  35847. i ? (this.offset = t,
  35848. this) : t - r
  35849. }
  35850. ,
  35851. a.writeString = a.writeUTF8String,
  35852. f.calculateUTF8Chars = function(e) {
  35853. return d.calculateUTF16asUTF8(s(e))[0]
  35854. }
  35855. ,
  35856. f.calculateUTF8Bytes = function(e) {
  35857. return d.calculateUTF16asUTF8(s(e))[1]
  35858. }
  35859. ,
  35860. f.calculateString = f.calculateUTF8Bytes,
  35861. a.readUTF8String = function(e, t, i) {
  35862. "number" == typeof t && (i = t,
  35863. t = void 0);
  35864. var n = void 0 === i;
  35865. if (n && (i = this.offset),
  35866. void 0 === t && (t = f.METRICS_CHARS),
  35867. !this.noAssert) {
  35868. if ("number" != typeof e || e % 1 != 0)
  35869. throw TypeError("Illegal length: " + e + " (not an integer)");
  35870. if (e |= 0,
  35871. "number" != typeof i || i % 1 != 0)
  35872. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35873. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35874. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35875. }
  35876. var r, o = 0, a = i;
  35877. if (t === f.METRICS_CHARS) {
  35878. if (r = c(),
  35879. d.decodeUTF8(function() {
  35880. return o < e && i < this.limit ? this.view[i++] : null
  35881. }
  35882. .bind(this), function(e) {
  35883. ++o,
  35884. d.UTF8toUTF16(e, r)
  35885. }),
  35886. o !== e)
  35887. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35888. return n ? (this.offset = i,
  35889. r()) : {
  35890. string: r(),
  35891. length: i - a
  35892. }
  35893. }
  35894. if (t !== f.METRICS_BYTES)
  35895. throw TypeError("Unsupported metrics: " + t);
  35896. if (!this.noAssert) {
  35897. if ("number" != typeof i || i % 1 != 0)
  35898. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35899. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35900. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35901. }
  35902. var s = i + e;
  35903. if (d.decodeUTF8toUTF16(function() {
  35904. return i < s ? this.view[i++] : null
  35905. }
  35906. .bind(this), r = c(), this.noAssert),
  35907. i !== s)
  35908. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35909. return n ? (this.offset = i,
  35910. r()) : {
  35911. string: r(),
  35912. length: i - a
  35913. }
  35914. }
  35915. ,
  35916. a.readString = a.readUTF8String,
  35917. a.writeVString = function(e, t) {
  35918. var i = void 0 === t;
  35919. if (i && (t = this.offset),
  35920. !this.noAssert) {
  35921. if ("string" != typeof e)
  35922. throw TypeError("Illegal str: Not a string");
  35923. if ("number" != typeof t || t % 1 != 0)
  35924. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35925. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35926. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35927. }
  35928. var n, r, o = t;
  35929. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35930. r = f.calculateVarint32(n),
  35931. t += r + n;
  35932. var a = this.buffer.byteLength;
  35933. if (a < t && this.resize((a *= 2) > t ? a : t),
  35934. t -= r + n,
  35935. t += this.writeVarint32(n, t),
  35936. d.encodeUTF16toUTF8(s(e), function(e) {
  35937. this.view[t++] = e
  35938. }
  35939. .bind(this)),
  35940. t !== o + n + r)
  35941. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35942. return i ? (this.offset = t,
  35943. this) : t - o
  35944. }
  35945. ,
  35946. a.readVString = function(e) {
  35947. var t = void 0 === e;
  35948. if (t && (e = this.offset),
  35949. !this.noAssert) {
  35950. if ("number" != typeof e || e % 1 != 0)
  35951. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35952. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35953. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35954. }
  35955. var i = e
  35956. , n = this.readVarint32(e)
  35957. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35958. return e += r.length,
  35959. t ? (this.offset = e,
  35960. r.string) : {
  35961. string: r.string,
  35962. length: e - i
  35963. }
  35964. }
  35965. ,
  35966. a.append = function(e, t, i) {
  35967. "number" != typeof t && "string" == typeof t || (i = t,
  35968. t = void 0);
  35969. var n = void 0 === i;
  35970. if (n && (i = this.offset),
  35971. !this.noAssert) {
  35972. if ("number" != typeof i || i % 1 != 0)
  35973. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35974. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35975. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35976. }
  35977. e instanceof f || (e = f.wrap(e, t));
  35978. var r = e.limit - e.offset;
  35979. if (r <= 0)
  35980. return this;
  35981. i += r;
  35982. var o = this.buffer.byteLength;
  35983. return o < i && this.resize((o *= 2) > i ? o : i),
  35984. i -= r,
  35985. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35986. e.offset += r,
  35987. n && (this.offset += r),
  35988. this
  35989. }
  35990. ,
  35991. a.appendTo = function(e, t) {
  35992. return e.append(this, t),
  35993. this
  35994. }
  35995. ,
  35996. a.assert = function(e) {
  35997. return this.noAssert = !e,
  35998. this
  35999. }
  36000. ,
  36001. a.capacity = function() {
  36002. return this.buffer.byteLength
  36003. }
  36004. ,
  36005. a.clear = function() {
  36006. return this.offset = 0,
  36007. this.limit = this.buffer.byteLength,
  36008. this.markedOffset = -1,
  36009. this
  36010. }
  36011. ,
  36012. a.clone = function(e) {
  36013. var t = new f(0,this.littleEndian,this.noAssert);
  36014. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  36015. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  36016. t.view = this.view),
  36017. t.offset = this.offset,
  36018. t.markedOffset = this.markedOffset,
  36019. t.limit = this.limit,
  36020. t
  36021. }
  36022. ,
  36023. a.compact = function(e, t) {
  36024. if (void 0 === e && (e = this.offset),
  36025. void 0 === t && (t = this.limit),
  36026. !this.noAssert) {
  36027. if ("number" != typeof e || e % 1 != 0)
  36028. throw TypeError("Illegal begin: Not an integer");
  36029. if (e >>>= 0,
  36030. "number" != typeof t || t % 1 != 0)
  36031. throw TypeError("Illegal end: Not an integer");
  36032. if (t >>>= 0,
  36033. e < 0 || t < e || t > this.buffer.byteLength)
  36034. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36035. }
  36036. if (0 === e && t === this.buffer.byteLength)
  36037. return this;
  36038. var i = t - e;
  36039. if (0 == i)
  36040. return this.buffer = o,
  36041. this.view = null,
  36042. 0 <= this.markedOffset && (this.markedOffset -= e),
  36043. this.offset = 0,
  36044. this.limit = 0,
  36045. this;
  36046. var n = new ArrayBuffer(i)
  36047. , r = new Uint8Array(n);
  36048. return r.set(this.view.subarray(e, t)),
  36049. this.buffer = n,
  36050. this.view = r,
  36051. 0 <= this.markedOffset && (this.markedOffset -= e),
  36052. this.offset = 0,
  36053. this.limit = i,
  36054. this
  36055. }
  36056. ,
  36057. a.copy = function(e, t) {
  36058. if (void 0 === e && (e = this.offset),
  36059. void 0 === t && (t = this.limit),
  36060. !this.noAssert) {
  36061. if ("number" != typeof e || e % 1 != 0)
  36062. throw TypeError("Illegal begin: Not an integer");
  36063. if (e >>>= 0,
  36064. "number" != typeof t || t % 1 != 0)
  36065. throw TypeError("Illegal end: Not an integer");
  36066. if (t >>>= 0,
  36067. e < 0 || t < e || t > this.buffer.byteLength)
  36068. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36069. }
  36070. if (e === t)
  36071. return new f(0,this.littleEndian,this.noAssert);
  36072. var i = t - e
  36073. , n = new f(i,this.littleEndian,this.noAssert);
  36074. return n.offset = 0,
  36075. n.limit = i,
  36076. 0 <= n.markedOffset && (n.markedOffset -= e),
  36077. this.copyTo(n, 0, e, t),
  36078. n
  36079. }
  36080. ,
  36081. a.copyTo = function(e, t, i, n) {
  36082. var r, o;
  36083. if (!this.noAssert && !f.isByteBuffer(e))
  36084. throw TypeError("Illegal target: Not a ByteBuffer");
  36085. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  36086. i = (r = void 0 === i) ? this.offset : 0 | i,
  36087. n = void 0 === n ? this.limit : 0 | n,
  36088. t < 0 || t > e.buffer.byteLength)
  36089. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  36090. if (i < 0 || n > this.buffer.byteLength)
  36091. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  36092. var a = n - i;
  36093. return 0 == a ? e : (e.ensureCapacity(t + a),
  36094. e.view.set(this.view.subarray(i, n), t),
  36095. r && (this.offset += a),
  36096. o && (e.offset += a),
  36097. this)
  36098. }
  36099. ,
  36100. a.ensureCapacity = function(e) {
  36101. var t = this.buffer.byteLength;
  36102. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36103. }
  36104. ,
  36105. a.fill = function(e, t, i) {
  36106. var n = void 0 === t;
  36107. if (n && (t = this.offset),
  36108. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  36109. void 0 === t && (t = this.offset),
  36110. void 0 === i && (i = this.limit),
  36111. !this.noAssert) {
  36112. if ("number" != typeof e || e % 1 != 0)
  36113. throw TypeError("Illegal value: " + e + " (not an integer)");
  36114. if (e |= 0,
  36115. "number" != typeof t || t % 1 != 0)
  36116. throw TypeError("Illegal begin: Not an integer");
  36117. if (t >>>= 0,
  36118. "number" != typeof i || i % 1 != 0)
  36119. throw TypeError("Illegal end: Not an integer");
  36120. if (i >>>= 0,
  36121. t < 0 || i < t || i > this.buffer.byteLength)
  36122. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36123. }
  36124. if (i <= t)
  36125. return this;
  36126. for (; t < i; )
  36127. this.view[t++] = e;
  36128. return n && (this.offset = t),
  36129. this
  36130. }
  36131. ,
  36132. a.flip = function() {
  36133. return this.limit = this.offset,
  36134. this.offset = 0,
  36135. this
  36136. }
  36137. ,
  36138. a.mark = function(e) {
  36139. if (e = void 0 === e ? this.offset : e,
  36140. !this.noAssert) {
  36141. if ("number" != typeof e || e % 1 != 0)
  36142. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36143. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  36144. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  36145. }
  36146. return this.markedOffset = e,
  36147. this
  36148. }
  36149. ,
  36150. a.order = function(e) {
  36151. if (!this.noAssert && "boolean" != typeof e)
  36152. throw TypeError("Illegal littleEndian: Not a boolean");
  36153. return this.littleEndian = !!e,
  36154. this
  36155. }
  36156. ,
  36157. a.LE = function(e) {
  36158. return this.littleEndian = void 0 === e || !!e,
  36159. this
  36160. }
  36161. ,
  36162. a.BE = function(e) {
  36163. return this.littleEndian = void 0 !== e && !e,
  36164. this
  36165. }
  36166. ,
  36167. a.prepend = function(e, t, i) {
  36168. "number" != typeof t && "string" == typeof t || (i = t,
  36169. t = void 0);
  36170. var n = void 0 === i;
  36171. if (n && (i = this.offset),
  36172. !this.noAssert) {
  36173. if ("number" != typeof i || i % 1 != 0)
  36174. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36175. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36176. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36177. }
  36178. e instanceof f || (e = f.wrap(e, t));
  36179. var r = e.limit - e.offset;
  36180. if (r <= 0)
  36181. return this;
  36182. var o = r - i;
  36183. if (0 < o) {
  36184. var a = new ArrayBuffer(this.buffer.byteLength + o)
  36185. , s = new Uint8Array(a);
  36186. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  36187. this.buffer = a,
  36188. this.view = s,
  36189. this.offset += o,
  36190. 0 <= this.markedOffset && (this.markedOffset += o),
  36191. this.limit += o,
  36192. i += o
  36193. } else
  36194. new Uint8Array(this.buffer);
  36195. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36196. e.offset = e.limit,
  36197. n && (this.offset -= r),
  36198. this
  36199. }
  36200. ,
  36201. a.prependTo = function(e, t) {
  36202. return e.prepend(this, t),
  36203. this
  36204. }
  36205. ,
  36206. a.printDebug = function(e) {
  36207. "function" != typeof e && (e = console.log.bind(console)),
  36208. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36209. }
  36210. ,
  36211. a.remaining = function() {
  36212. return this.limit - this.offset
  36213. }
  36214. ,
  36215. a.reset = function() {
  36216. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36217. this.markedOffset = -1) : this.offset = 0,
  36218. this
  36219. }
  36220. ,
  36221. a.resize = function(e) {
  36222. if (!this.noAssert) {
  36223. if ("number" != typeof e || e % 1 != 0)
  36224. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36225. if ((e |= 0) < 0)
  36226. throw RangeError("Illegal capacity: 0 <= " + e)
  36227. }
  36228. if (this.buffer.byteLength < e) {
  36229. var t = new ArrayBuffer(e)
  36230. , i = new Uint8Array(t);
  36231. i.set(this.view),
  36232. this.buffer = t,
  36233. this.view = i
  36234. }
  36235. return this
  36236. }
  36237. ,
  36238. a.reverse = function(e, t) {
  36239. if (void 0 === e && (e = this.offset),
  36240. void 0 === t && (t = this.limit),
  36241. !this.noAssert) {
  36242. if ("number" != typeof e || e % 1 != 0)
  36243. throw TypeError("Illegal begin: Not an integer");
  36244. if (e >>>= 0,
  36245. "number" != typeof t || t % 1 != 0)
  36246. throw TypeError("Illegal end: Not an integer");
  36247. if (t >>>= 0,
  36248. e < 0 || t < e || t > this.buffer.byteLength)
  36249. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36250. }
  36251. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36252. this
  36253. }
  36254. ,
  36255. a.skip = function(e) {
  36256. if (!this.noAssert) {
  36257. if ("number" != typeof e || e % 1 != 0)
  36258. throw TypeError("Illegal length: " + e + " (not an integer)");
  36259. e |= 0
  36260. }
  36261. var t = this.offset + e;
  36262. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36263. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36264. return this.offset = t,
  36265. this
  36266. }
  36267. ,
  36268. a.slice = function(e, t) {
  36269. if (void 0 === e && (e = this.offset),
  36270. void 0 === t && (t = this.limit),
  36271. !this.noAssert) {
  36272. if ("number" != typeof e || e % 1 != 0)
  36273. throw TypeError("Illegal begin: Not an integer");
  36274. if (e >>>= 0,
  36275. "number" != typeof t || t % 1 != 0)
  36276. throw TypeError("Illegal end: Not an integer");
  36277. if (t >>>= 0,
  36278. e < 0 || t < e || t > this.buffer.byteLength)
  36279. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36280. }
  36281. var i = this.clone();
  36282. return i.offset = e,
  36283. i.limit = t,
  36284. i
  36285. }
  36286. ,
  36287. a.toBuffer = function(e) {
  36288. var t = this.offset
  36289. , i = this.limit;
  36290. if (!this.noAssert) {
  36291. if ("number" != typeof t || t % 1 != 0)
  36292. throw TypeError("Illegal offset: Not an integer");
  36293. if (t >>>= 0,
  36294. "number" != typeof i || i % 1 != 0)
  36295. throw TypeError("Illegal limit: Not an integer");
  36296. if (i >>>= 0,
  36297. t < 0 || i < t || i > this.buffer.byteLength)
  36298. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36299. }
  36300. if (!e && 0 === t && i === this.buffer.byteLength)
  36301. return this.buffer;
  36302. if (t === i)
  36303. return o;
  36304. var n = new ArrayBuffer(i - t);
  36305. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36306. n
  36307. }
  36308. ,
  36309. a.toArrayBuffer = a.toBuffer,
  36310. a.toString = function(e, t, i) {
  36311. if (void 0 === e)
  36312. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36313. switch ("number" == typeof e && (i = t = e = "utf8"),
  36314. e) {
  36315. case "utf8":
  36316. return this.toUTF8(t, i);
  36317. case "base64":
  36318. return this.toBase64(t, i);
  36319. case "hex":
  36320. return this.toHex(t, i);
  36321. case "binary":
  36322. return this.toBinary(t, i);
  36323. case "debug":
  36324. return this.toDebug();
  36325. case "columns":
  36326. return this.toColumns();
  36327. default:
  36328. throw Error("Unsupported encoding: " + e)
  36329. }
  36330. }
  36331. ;
  36332. var h = function() {
  36333. 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)
  36334. a[r[t]] = t;
  36335. return e.encode = function(e, t) {
  36336. for (var i, n; null !== (i = e()); )
  36337. t(r[i >> 2 & 63]),
  36338. n = (3 & i) << 4,
  36339. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36340. n = (15 & i) << 2,
  36341. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36342. t(r[63 & i])) : (t(r[63 & n]),
  36343. t(61))) : (t(r[63 & n]),
  36344. t(61),
  36345. t(61))
  36346. }
  36347. ,
  36348. e.decode = function(e, t) {
  36349. function i(e) {
  36350. throw Error("Illegal character code: " + e)
  36351. }
  36352. for (var n, r, o; null !== (n = e()); )
  36353. if (void 0 === (r = a[n]) && i(n),
  36354. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36355. t(r << 2 >>> 0 | (48 & o) >> 4),
  36356. null !== (n = e()))) {
  36357. if (void 0 === (r = a[n])) {
  36358. if (61 === n)
  36359. break;
  36360. i(n)
  36361. }
  36362. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36363. null !== (n = e())) {
  36364. if (void 0 === (o = a[n])) {
  36365. if (61 === n)
  36366. break;
  36367. i(n)
  36368. }
  36369. t((3 & r) << 6 >>> 0 | o)
  36370. }
  36371. }
  36372. }
  36373. ,
  36374. e.test = function(e) {
  36375. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36376. }
  36377. ,
  36378. e
  36379. }();
  36380. a.toBase64 = function(e, t) {
  36381. if (void 0 === e && (e = this.offset),
  36382. void 0 === t && (t = this.limit),
  36383. t |= 0,
  36384. (e |= 0) < 0 || t > this.capacity || t < e)
  36385. throw RangeError("begin, end");
  36386. var i;
  36387. return h.encode(function() {
  36388. return e < t ? this.view[e++] : null
  36389. }
  36390. .bind(this), i = c()),
  36391. i()
  36392. }
  36393. ,
  36394. f.fromBase64 = function(e, t) {
  36395. if ("string" != typeof e)
  36396. throw TypeError("str");
  36397. var i = new f(e.length / 4 * 3,t)
  36398. , n = 0;
  36399. return h.decode(s(e), function(e) {
  36400. i.view[n++] = e
  36401. }),
  36402. i.limit = n,
  36403. i
  36404. }
  36405. ,
  36406. f.btoa = function(e) {
  36407. return f.fromBinary(e).toBase64()
  36408. }
  36409. ,
  36410. f.atob = function(e) {
  36411. return f.fromBase64(e).toBinary()
  36412. }
  36413. ,
  36414. a.toBinary = function(e, t) {
  36415. if (void 0 === e && (e = this.offset),
  36416. void 0 === t && (t = this.limit),
  36417. t |= 0,
  36418. (e |= 0) < 0 || t > this.capacity() || t < e)
  36419. throw RangeError("begin, end");
  36420. if (e === t)
  36421. return "";
  36422. for (var i = [], n = []; e < t; )
  36423. i.push(this.view[e++]),
  36424. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36425. i = []);
  36426. return n.join("") + String.fromCharCode.apply(String, i)
  36427. }
  36428. ,
  36429. f.fromBinary = function(e, t) {
  36430. if ("string" != typeof e)
  36431. throw TypeError("str");
  36432. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36433. if (255 < (i = e.charCodeAt(n)))
  36434. throw RangeError("illegal char code: " + i);
  36435. o.view[n++] = i
  36436. }
  36437. return o.limit = r,
  36438. o
  36439. }
  36440. ,
  36441. a.toDebug = function(e) {
  36442. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36443. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36444. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36445. ++i,
  36446. e && 0 < i && i % 16 == 0 && i !== n) {
  36447. for (; r.length < 51; )
  36448. r += " ";
  36449. a += r + o + "\n",
  36450. r = o = ""
  36451. }
  36452. 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 ? " " : ""
  36453. }
  36454. if (e && " " !== r) {
  36455. for (; r.length < 51; )
  36456. r += " ";
  36457. a += r + o + "\n"
  36458. }
  36459. return e ? a : r
  36460. }
  36461. ,
  36462. f.fromDebug = function(e, t, i) {
  36463. 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; ) {
  36464. switch (n = e.charAt(s++)) {
  36465. case "!":
  36466. if (!i) {
  36467. if (h || u || d) {
  36468. p = !0;
  36469. break
  36470. }
  36471. h = u = d = !0
  36472. }
  36473. a.offset = a.markedOffset = a.limit = l,
  36474. c = !1;
  36475. break;
  36476. case "|":
  36477. if (!i) {
  36478. if (h || d) {
  36479. p = !0;
  36480. break
  36481. }
  36482. h = d = !0
  36483. }
  36484. a.offset = a.limit = l,
  36485. c = !1;
  36486. break;
  36487. case "[":
  36488. if (!i) {
  36489. if (h || u) {
  36490. p = !0;
  36491. break
  36492. }
  36493. h = u = !0
  36494. }
  36495. a.offset = a.markedOffset = l,
  36496. c = !1;
  36497. break;
  36498. case "<":
  36499. if (!i) {
  36500. if (h) {
  36501. p = !0;
  36502. break
  36503. }
  36504. h = !0
  36505. }
  36506. a.offset = l,
  36507. c = !1;
  36508. break;
  36509. case "]":
  36510. if (!i) {
  36511. if (d || u) {
  36512. p = !0;
  36513. break
  36514. }
  36515. d = u = !0
  36516. }
  36517. a.limit = a.markedOffset = l,
  36518. c = !1;
  36519. break;
  36520. case ">":
  36521. if (!i) {
  36522. if (d) {
  36523. p = !0;
  36524. break
  36525. }
  36526. d = !0
  36527. }
  36528. a.limit = l,
  36529. c = !1;
  36530. break;
  36531. case "'":
  36532. if (!i) {
  36533. if (u) {
  36534. p = !0;
  36535. break
  36536. }
  36537. u = !0
  36538. }
  36539. a.markedOffset = l,
  36540. c = !1;
  36541. break;
  36542. case " ":
  36543. c = !1;
  36544. break;
  36545. default:
  36546. if (!i && c) {
  36547. p = !0;
  36548. break
  36549. }
  36550. if (r = parseInt(n + e.charAt(s++), 16),
  36551. !i && (isNaN(r) || r < 0 || 255 < r))
  36552. throw TypeError("Illegal str: Not a debug encoded string");
  36553. a.view[l++] = r,
  36554. c = !0
  36555. }
  36556. if (p)
  36557. throw TypeError("Illegal str: Invalid symbol at " + s)
  36558. }
  36559. if (!i) {
  36560. if (!h || !d)
  36561. throw TypeError("Illegal str: Missing offset or limit");
  36562. if (l < a.buffer.byteLength)
  36563. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36564. }
  36565. return a
  36566. }
  36567. ,
  36568. a.toHex = function(e, t) {
  36569. if (e = void 0 === e ? this.offset : e,
  36570. t = void 0 === t ? this.limit : t,
  36571. !this.noAssert) {
  36572. if ("number" != typeof e || e % 1 != 0)
  36573. throw TypeError("Illegal begin: Not an integer");
  36574. if (e >>>= 0,
  36575. "number" != typeof t || t % 1 != 0)
  36576. throw TypeError("Illegal end: Not an integer");
  36577. if (t >>>= 0,
  36578. e < 0 || t < e || t > this.buffer.byteLength)
  36579. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36580. }
  36581. for (var i, n = new Array(t - e); e < t; )
  36582. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36583. return n.join("")
  36584. }
  36585. ,
  36586. f.fromHex = function(e, t, i) {
  36587. if (!i) {
  36588. if ("string" != typeof e)
  36589. throw TypeError("Illegal str: Not a string");
  36590. if (e.length % 2 != 0)
  36591. throw TypeError("Illegal str: Length not a multiple of 2")
  36592. }
  36593. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36594. if (n = parseInt(e.substring(a, a + 2), 16),
  36595. !i && (!isFinite(n) || n < 0 || 255 < n))
  36596. throw TypeError("Illegal str: Contains non-hex characters");
  36597. o.view[s++] = n
  36598. }
  36599. return o.limit = s,
  36600. o
  36601. }
  36602. ;
  36603. var u, d = u = {
  36604. MAX_CODEPOINT: 1114111,
  36605. encodeUTF8: function(e, t) {
  36606. var i = null;
  36607. for ("number" == typeof e && (i = e,
  36608. e = function() {
  36609. return null
  36610. }
  36611. ); null !== i || null !== (i = e()); )
  36612. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36613. t(i >> 12 & 63 | 128)),
  36614. t(i >> 6 & 63 | 128)),
  36615. t(63 & i | 128)),
  36616. i = null
  36617. },
  36618. decodeUTF8: function(e, t) {
  36619. for (var i, n, r, o, a = function(e) {
  36620. e = e.slice(0, e.indexOf(null));
  36621. var t = Error(e.toString());
  36622. throw t.name = "TruncatedError",
  36623. t.bytes = e,
  36624. t
  36625. }; null !== (i = e()); )
  36626. if (0 == (128 & i))
  36627. t(i);
  36628. else if (192 == (224 & i))
  36629. null === (n = e()) && a([i, n]),
  36630. t((31 & i) << 6 | 63 & n);
  36631. else if (224 == (240 & i))
  36632. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36633. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36634. else {
  36635. if (240 != (248 & i))
  36636. throw RangeError("Illegal starting byte: " + i);
  36637. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36638. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36639. }
  36640. },
  36641. UTF16toUTF8: function(e, t) {
  36642. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36643. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36644. n = null) : t(i);
  36645. null !== n && t(n)
  36646. },
  36647. UTF8toUTF16: function(e, t) {
  36648. var i = null;
  36649. for ("number" == typeof e && (i = e,
  36650. e = function() {
  36651. return null
  36652. }
  36653. ); null !== i || null !== (i = e()); )
  36654. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36655. t(i % 1024 + 56320)),
  36656. i = null
  36657. },
  36658. encodeUTF16toUTF8: function(e, t) {
  36659. u.UTF16toUTF8(e, function(e) {
  36660. u.encodeUTF8(e, t)
  36661. })
  36662. },
  36663. decodeUTF8toUTF16: function(e, t) {
  36664. u.decodeUTF8(e, function(e) {
  36665. u.UTF8toUTF16(e, t)
  36666. })
  36667. },
  36668. calculateCodePoint: function(e) {
  36669. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36670. },
  36671. calculateUTF8: function(e) {
  36672. for (var t, i = 0; null !== (t = e()); )
  36673. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36674. return i
  36675. },
  36676. calculateUTF16asUTF8: function(e) {
  36677. var t = 0
  36678. , i = 0;
  36679. return u.UTF16toUTF8(e, function(e) {
  36680. ++t,
  36681. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36682. }),
  36683. [t, i]
  36684. }
  36685. };
  36686. return a.toUTF8 = function(t, i) {
  36687. if (void 0 === t && (t = this.offset),
  36688. void 0 === i && (i = this.limit),
  36689. !this.noAssert) {
  36690. if ("number" != typeof t || t % 1 != 0)
  36691. throw TypeError("Illegal begin: Not an integer");
  36692. if (t >>>= 0,
  36693. "number" != typeof i || i % 1 != 0)
  36694. throw TypeError("Illegal end: Not an integer");
  36695. if (i >>>= 0,
  36696. t < 0 || i < t || i > this.buffer.byteLength)
  36697. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36698. }
  36699. var e;
  36700. try {
  36701. d.decodeUTF8toUTF16(function() {
  36702. return t < i ? this.view[t++] : null
  36703. }
  36704. .bind(this), e = c())
  36705. } catch (e) {
  36706. if (t !== i)
  36707. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36708. }
  36709. return e()
  36710. }
  36711. ,
  36712. f.fromUTF8 = function(e, t, i) {
  36713. if (!i && "string" != typeof e)
  36714. throw TypeError("Illegal str: Not a string");
  36715. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36716. , r = 0;
  36717. return d.encodeUTF16toUTF8(s(e), function(e) {
  36718. n.view[r++] = e
  36719. }),
  36720. n.limit = r,
  36721. n
  36722. }
  36723. ,
  36724. f
  36725. }
  36726. ,
  36727. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36728. var e;
  36729. try {
  36730. e = t("long")
  36731. } catch (e) {}
  36732. return r(e)
  36733. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36734. }
  36735. , {
  36736. long: 216
  36737. }],
  36738. 216: [function(e, t, i) {
  36739. var n, r;
  36740. n = this,
  36741. r = function() {
  36742. "use strict";
  36743. function n(e, t, i) {
  36744. this.low = 0 | e,
  36745. this.high = 0 | t,
  36746. this.unsigned = !!i
  36747. }
  36748. function p(e) {
  36749. return !0 === (e && e.__isLong__)
  36750. }
  36751. function e(e, t) {
  36752. var i, n, r;
  36753. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36754. r && (a[e] = i),
  36755. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36756. r && (o[e] = i),
  36757. i)
  36758. }
  36759. function f(e, t) {
  36760. if (isNaN(e) || !isFinite(e))
  36761. return t ? l : y;
  36762. if (t) {
  36763. if (e < 0)
  36764. return l;
  36765. if (r <= e)
  36766. return I
  36767. } else {
  36768. if (e <= -s)
  36769. return E;
  36770. if (s <= e + 1)
  36771. return C
  36772. }
  36773. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36774. }
  36775. function g(e, t, i) {
  36776. return new n(e,t,i)
  36777. }
  36778. function h(e, t, i) {
  36779. if (0 === e.length)
  36780. throw Error("empty string");
  36781. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36782. return y;
  36783. if (t = "number" == typeof t ? (i = t,
  36784. !1) : !!t,
  36785. (i = i || 10) < 2 || 36 < i)
  36786. throw RangeError("radix");
  36787. var n;
  36788. if (0 < (n = e.indexOf("-")))
  36789. throw Error("interior hyphen");
  36790. if (0 === n)
  36791. return h(e.substring(1), t, i).neg();
  36792. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36793. var s = Math.min(8, e.length - a)
  36794. , l = parseInt(e.substring(a, a + s), i);
  36795. if (s < 8) {
  36796. var c = f(u(i, s));
  36797. o = o.mul(c).add(f(l))
  36798. } else
  36799. o = (o = o.mul(r)).add(f(l))
  36800. }
  36801. return o.unsigned = t,
  36802. o
  36803. }
  36804. function m(e) {
  36805. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36806. }
  36807. Object.defineProperty(n.prototype, "__isLong__", {
  36808. value: !0,
  36809. enumerable: !1,
  36810. configurable: !1
  36811. }),
  36812. n.isLong = p;
  36813. var o = {}
  36814. , a = {};
  36815. n.fromInt = e,
  36816. n.fromNumber = f,
  36817. n.fromBits = g;
  36818. var u = Math.pow;
  36819. n.fromString = h,
  36820. n.fromValue = m;
  36821. var i = 4294967296
  36822. , r = 0x10000000000000000
  36823. , s = r / 2
  36824. , v = e(1 << 24)
  36825. , y = e(0);
  36826. n.ZERO = y;
  36827. var l = e(0, !0);
  36828. n.UZERO = l;
  36829. var c = e(1);
  36830. n.ONE = c;
  36831. var d = e(1, !0);
  36832. n.UONE = d;
  36833. var A = e(-1);
  36834. n.NEG_ONE = A;
  36835. var C = g(-1, 2147483647, !1);
  36836. n.MAX_VALUE = C;
  36837. var I = g(-1, -1, !0);
  36838. n.MAX_UNSIGNED_VALUE = I;
  36839. var E = g(0, -2147483648, !1);
  36840. n.MIN_VALUE = E;
  36841. var t = n.prototype;
  36842. return t.toInt = function() {
  36843. return this.unsigned ? this.low >>> 0 : this.low
  36844. }
  36845. ,
  36846. t.toNumber = function() {
  36847. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36848. }
  36849. ,
  36850. t.toString = function(e) {
  36851. if ((e = e || 10) < 2 || 36 < e)
  36852. throw RangeError("radix");
  36853. if (this.isZero())
  36854. return "0";
  36855. if (this.isNegative()) {
  36856. if (this.eq(E)) {
  36857. var t = f(e)
  36858. , i = this.div(t)
  36859. , n = i.mul(t).sub(this);
  36860. return i.toString(e) + n.toInt().toString(e)
  36861. }
  36862. return "-" + this.neg().toString(e)
  36863. }
  36864. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36865. var s = o.div(r)
  36866. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36867. if ((o = s).isZero())
  36868. return l + a;
  36869. for (; l.length < 6; )
  36870. l = "0" + l;
  36871. a = "" + l + a
  36872. }
  36873. }
  36874. ,
  36875. t.getHighBits = function() {
  36876. return this.high
  36877. }
  36878. ,
  36879. t.getHighBitsUnsigned = function() {
  36880. return this.high >>> 0
  36881. }
  36882. ,
  36883. t.getLowBits = function() {
  36884. return this.low
  36885. }
  36886. ,
  36887. t.getLowBitsUnsigned = function() {
  36888. return this.low >>> 0
  36889. }
  36890. ,
  36891. t.getNumBitsAbs = function() {
  36892. if (this.isNegative())
  36893. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36894. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36895. ;
  36896. return 0 != this.high ? t + 33 : t + 1
  36897. }
  36898. ,
  36899. t.isZero = function() {
  36900. return 0 === this.high && 0 === this.low
  36901. }
  36902. ,
  36903. t.isNegative = function() {
  36904. return !this.unsigned && this.high < 0
  36905. }
  36906. ,
  36907. t.isPositive = function() {
  36908. return this.unsigned || 0 <= this.high
  36909. }
  36910. ,
  36911. t.isOdd = function() {
  36912. return 1 == (1 & this.low)
  36913. }
  36914. ,
  36915. t.isEven = function() {
  36916. return 0 == (1 & this.low)
  36917. }
  36918. ,
  36919. t.equals = function(e) {
  36920. return p(e) || (e = m(e)),
  36921. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36922. }
  36923. ,
  36924. t.eq = t.equals,
  36925. t.notEquals = function(e) {
  36926. return !this.eq(e)
  36927. }
  36928. ,
  36929. t.neq = t.notEquals,
  36930. t.lessThan = function(e) {
  36931. return this.comp(e) < 0
  36932. }
  36933. ,
  36934. t.lt = t.lessThan,
  36935. t.lessThanOrEqual = function(e) {
  36936. return this.comp(e) <= 0
  36937. }
  36938. ,
  36939. t.lte = t.lessThanOrEqual,
  36940. t.greaterThan = function(e) {
  36941. return 0 < this.comp(e)
  36942. }
  36943. ,
  36944. t.gt = t.greaterThan,
  36945. t.greaterThanOrEqual = function(e) {
  36946. return 0 <= this.comp(e)
  36947. }
  36948. ,
  36949. t.gte = t.greaterThanOrEqual,
  36950. t.compare = function(e) {
  36951. if (p(e) || (e = m(e)),
  36952. this.eq(e))
  36953. return 0;
  36954. var t = this.isNegative()
  36955. , i = e.isNegative();
  36956. 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
  36957. }
  36958. ,
  36959. t.comp = t.compare,
  36960. t.negate = function() {
  36961. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36962. }
  36963. ,
  36964. t.neg = t.negate,
  36965. t.add = function(e) {
  36966. p(e) || (e = m(e));
  36967. var t = this.high >>> 16
  36968. , i = 65535 & this.high
  36969. , n = this.low >>> 16
  36970. , r = 65535 & this.low
  36971. , o = e.high >>> 16
  36972. , a = 65535 & e.high
  36973. , s = e.low >>> 16
  36974. , l = 0
  36975. , c = 0
  36976. , h = 0
  36977. , u = 0;
  36978. return h += (u += r + (65535 & e.low)) >>> 16,
  36979. c += (h += n + s) >>> 16,
  36980. l += (c += i + a) >>> 16,
  36981. l += t + o,
  36982. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36983. }
  36984. ,
  36985. t.subtract = function(e) {
  36986. return p(e) || (e = m(e)),
  36987. this.add(e.neg())
  36988. }
  36989. ,
  36990. t.sub = t.subtract,
  36991. t.multiply = function(e) {
  36992. if (this.isZero())
  36993. return y;
  36994. if (p(e) || (e = m(e)),
  36995. e.isZero())
  36996. return y;
  36997. if (this.eq(E))
  36998. return e.isOdd() ? E : y;
  36999. if (e.eq(E))
  37000. return this.isOdd() ? E : y;
  37001. if (this.isNegative())
  37002. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  37003. if (e.isNegative())
  37004. return this.mul(e.neg()).neg();
  37005. if (this.lt(v) && e.lt(v))
  37006. return f(this.toNumber() * e.toNumber(), this.unsigned);
  37007. var t = this.high >>> 16
  37008. , i = 65535 & this.high
  37009. , n = this.low >>> 16
  37010. , r = 65535 & this.low
  37011. , o = e.high >>> 16
  37012. , a = 65535 & e.high
  37013. , s = e.low >>> 16
  37014. , l = 65535 & e.low
  37015. , c = 0
  37016. , h = 0
  37017. , u = 0
  37018. , d = 0;
  37019. return u += (d += r * l) >>> 16,
  37020. h += (u += n * l) >>> 16,
  37021. u &= 65535,
  37022. h += (u += r * s) >>> 16,
  37023. c += (h += i * l) >>> 16,
  37024. h &= 65535,
  37025. c += (h += n * s) >>> 16,
  37026. h &= 65535,
  37027. c += (h += r * a) >>> 16,
  37028. c += t * l + i * s + n * a + r * o,
  37029. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  37030. }
  37031. ,
  37032. t.mul = t.multiply,
  37033. t.divide = function(e) {
  37034. if (p(e) || (e = m(e)),
  37035. e.isZero())
  37036. throw Error("division by zero");
  37037. if (this.isZero())
  37038. return this.unsigned ? l : y;
  37039. var t, i, n;
  37040. if (this.unsigned) {
  37041. if (e.unsigned || (e = e.toUnsigned()),
  37042. e.gt(this))
  37043. return l;
  37044. if (e.gt(this.shru(1)))
  37045. return d;
  37046. n = l
  37047. } else {
  37048. if (this.eq(E))
  37049. 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)),
  37050. n = t.add(i.div(e)));
  37051. if (e.eq(E))
  37052. return this.unsigned ? l : y;
  37053. if (this.isNegative())
  37054. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  37055. if (e.isNegative())
  37056. return this.div(e.neg()).neg();
  37057. n = y
  37058. }
  37059. for (i = this; i.gte(e); ) {
  37060. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  37061. 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); )
  37062. s = (a = f(t -= o, this.unsigned)).mul(e);
  37063. a.isZero() && (a = c),
  37064. n = n.add(a),
  37065. i = i.sub(s)
  37066. }
  37067. return n
  37068. }
  37069. ,
  37070. t.div = t.divide,
  37071. t.modulo = function(e) {
  37072. return p(e) || (e = m(e)),
  37073. this.sub(this.div(e).mul(e))
  37074. }
  37075. ,
  37076. t.mod = t.modulo,
  37077. t.not = function() {
  37078. return g(~this.low, ~this.high, this.unsigned)
  37079. }
  37080. ,
  37081. t.and = function(e) {
  37082. return p(e) || (e = m(e)),
  37083. g(this.low & e.low, this.high & e.high, this.unsigned)
  37084. }
  37085. ,
  37086. t.or = function(e) {
  37087. return p(e) || (e = m(e)),
  37088. g(this.low | e.low, this.high | e.high, this.unsigned)
  37089. }
  37090. ,
  37091. t.xor = function(e) {
  37092. return p(e) || (e = m(e)),
  37093. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37094. }
  37095. ,
  37096. t.shiftLeft = function(e) {
  37097. return p(e) && (e = e.toInt()),
  37098. 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)
  37099. }
  37100. ,
  37101. t.shl = t.shiftLeft,
  37102. t.shiftRight = function(e) {
  37103. return p(e) && (e = e.toInt()),
  37104. 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)
  37105. }
  37106. ,
  37107. t.shr = t.shiftRight,
  37108. t.shiftRightUnsigned = function(e) {
  37109. if (p(e) && (e = e.toInt()),
  37110. 0 === (e &= 63))
  37111. return this;
  37112. var t = this.high;
  37113. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  37114. }
  37115. ,
  37116. t.shru = t.shiftRightUnsigned,
  37117. t.toSigned = function() {
  37118. return this.unsigned ? g(this.low, this.high, !1) : this
  37119. }
  37120. ,
  37121. t.toUnsigned = function() {
  37122. return this.unsigned ? this : g(this.low, this.high, !0)
  37123. }
  37124. ,
  37125. t.toBytes = function(e) {
  37126. return e ? this.toBytesLE() : this.toBytesBE()
  37127. }
  37128. ,
  37129. t.toBytesLE = function() {
  37130. var e = this.high
  37131. , t = this.low;
  37132. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37133. }
  37134. ,
  37135. t.toBytesBE = function() {
  37136. var e = this.high
  37137. , t = this.low;
  37138. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37139. }
  37140. ,
  37141. n
  37142. }
  37143. ,
  37144. "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()
  37145. }
  37146. , {}],
  37147. 217: [function(e, t, i) {
  37148. 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 = {
  37149. REVISION: "75"
  37150. };
  37151. function Ii(e, t) {
  37152. return e.distance - t.distance
  37153. }
  37154. function Ei(e, t, i, n) {
  37155. if (!1 !== e.visible && (e.raycast(t, i),
  37156. !0 === n))
  37157. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  37158. Ei(r[o], t, i, !0)
  37159. }
  37160. function _i(e, t, i) {
  37161. return i < 0 && (i += 1),
  37162. 1 < i && (i -= 1),
  37163. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37164. }
  37165. function bi(e, t, i, n, r, o, a) {
  37166. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  37167. r.multiplyScalar(Vt.x),
  37168. o.multiplyScalar(Vt.y),
  37169. a.multiplyScalar(Vt.z),
  37170. r.add(o).add(a),
  37171. r.clone()
  37172. }
  37173. function wi(e, t, i, n, r, o, a) {
  37174. var s = e.material;
  37175. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  37176. return null;
  37177. Ut.copy(a),
  37178. Ut.applyMatrix4(e.matrixWorld);
  37179. var l = t.ray.origin.distanceTo(Ut);
  37180. return l < t.near || l > t.far ? null : {
  37181. distance: l,
  37182. point: Ut.clone(),
  37183. object: e
  37184. }
  37185. }
  37186. function Ti(e, t, i, n, r, o, a, s) {
  37187. Mt.fromArray(n, 3 * o),
  37188. Rt.fromArray(n, 3 * a),
  37189. Pt.fromArray(n, 3 * s);
  37190. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  37191. return l && (r && (Nt.fromArray(r, 2 * o),
  37192. Ft.fromArray(r, 2 * a),
  37193. Bt.fromArray(r, 2 * s),
  37194. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  37195. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  37196. l.faceIndex = o),
  37197. l
  37198. }
  37199. function xi() {}
  37200. function Si(e, t, i, n, r, o) {
  37201. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  37202. if (s = e[o[t]].x,
  37203. l = e[o[t]].y,
  37204. c = e[o[i]].x,
  37205. h = e[o[i]].y,
  37206. u = e[o[n]].x,
  37207. d = e[o[n]].y,
  37208. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37209. return !1;
  37210. for (g = u - c,
  37211. m = d - h,
  37212. v = s - u,
  37213. y = l - d,
  37214. A = c - s,
  37215. C = h - l,
  37216. a = 0; a < r; a++)
  37217. if (p = e[o[a]].x,
  37218. f = e[o[a]].y,
  37219. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37220. E = v * (f - d) - y * (p - u),
  37221. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37222. return !1;
  37223. return !0
  37224. }
  37225. function Mi(e) {
  37226. switch (e) {
  37227. case Ci.LinearEncoding:
  37228. return ["Linear", "( value )"];
  37229. case Ci.sRGBEncoding:
  37230. return ["sRGB", "( value )"];
  37231. case Ci.RGBEEncoding:
  37232. return ["RGBE", "( value )"];
  37233. case Ci.RGBM7Encoding:
  37234. return ["RGBM", "( value, 7.0 )"];
  37235. case Ci.RGBM16Encoding:
  37236. return ["RGBM", "( value, 16.0 )"];
  37237. case Ci.RGBDEncoding:
  37238. return ["RGBD", "( value, 256.0 )"];
  37239. case Ci.GammaEncoding:
  37240. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37241. default:
  37242. throw new Error("unsupported encoding: " + e)
  37243. }
  37244. }
  37245. function Ri(e, t) {
  37246. var i = Mi(t);
  37247. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37248. }
  37249. function Pi(e) {
  37250. return "" !== e
  37251. }
  37252. function Oi(e, t) {
  37253. 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)
  37254. }
  37255. function Li(e) {
  37256. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37257. var i = Ci.ShaderChunk[t];
  37258. if (void 0 === i)
  37259. throw new Error("Can not resolve #include <" + t + ">");
  37260. return Li(i)
  37261. })
  37262. }
  37263. function Di(e) {
  37264. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37265. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37266. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37267. return r
  37268. })
  37269. }
  37270. function Ni(e, t, i, n) {
  37271. gi.set(t, i, n).unproject(mi);
  37272. var r = fi[e];
  37273. if (void 0 !== r)
  37274. for (var o = 0, a = r.length; o < a; o++)
  37275. pi.vertices[r[o]].copy(gi)
  37276. }
  37277. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37278. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37279. void 0 === Math.sign && (Math.sign = function(e) {
  37280. return e < 0 ? -1 : 0 < e ? 1 : +e
  37281. }
  37282. ),
  37283. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37284. get: function() {
  37285. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37286. }
  37287. }),
  37288. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37289. writable: !0,
  37290. configurable: !0,
  37291. value: function(e) {
  37292. "use strict";
  37293. if (null == e)
  37294. throw new TypeError("Cannot convert first argument to object");
  37295. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37296. var r = arguments[i];
  37297. if (null != r) {
  37298. r = Object(r);
  37299. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37300. var l = o[a]
  37301. , c = Object.getOwnPropertyDescriptor(r, l);
  37302. void 0 !== c && c.enumerable && (t[l] = r[l])
  37303. }
  37304. }
  37305. }
  37306. return t
  37307. }
  37308. }),
  37309. Ci.MOUSE = {
  37310. LEFT: 0,
  37311. MIDDLE: 1,
  37312. RIGHT: 2
  37313. },
  37314. Ci.CullFaceNone = 0,
  37315. Ci.CullFaceBack = 1,
  37316. Ci.CullFaceFront = 2,
  37317. Ci.CullFaceFrontBack = 3,
  37318. Ci.FrontFaceDirectionCW = 0,
  37319. Ci.FrontFaceDirectionCCW = 1,
  37320. Ci.BasicShadowMap = 0,
  37321. Ci.PCFShadowMap = 1,
  37322. Ci.PCFSoftShadowMap = 2,
  37323. Ci.FrontSide = 0,
  37324. Ci.BackSide = 1,
  37325. Ci.DoubleSide = 2,
  37326. Ci.FlatShading = 1,
  37327. Ci.SmoothShading = 2,
  37328. Ci.NoColors = 0,
  37329. Ci.FaceColors = 1,
  37330. Ci.VertexColors = 2,
  37331. Ci.NoBlending = 0,
  37332. Ci.NormalBlending = 1,
  37333. Ci.AdditiveBlending = 2,
  37334. Ci.SubtractiveBlending = 3,
  37335. Ci.MultiplyBlending = 4,
  37336. Ci.CustomBlending = 5,
  37337. Ci.AddEquation = 100,
  37338. Ci.SubtractEquation = 101,
  37339. Ci.ReverseSubtractEquation = 102,
  37340. Ci.MinEquation = 103,
  37341. Ci.MaxEquation = 104,
  37342. Ci.ZeroFactor = 200,
  37343. Ci.OneFactor = 201,
  37344. Ci.SrcColorFactor = 202,
  37345. Ci.OneMinusSrcColorFactor = 203,
  37346. Ci.SrcAlphaFactor = 204,
  37347. Ci.OneMinusSrcAlphaFactor = 205,
  37348. Ci.DstAlphaFactor = 206,
  37349. Ci.OneMinusDstAlphaFactor = 207,
  37350. Ci.DstColorFactor = 208,
  37351. Ci.OneMinusDstColorFactor = 209,
  37352. Ci.SrcAlphaSaturateFactor = 210,
  37353. Ci.NeverDepth = 0,
  37354. Ci.AlwaysDepth = 1,
  37355. Ci.LessDepth = 2,
  37356. Ci.LessEqualDepth = 3,
  37357. Ci.EqualDepth = 4,
  37358. Ci.GreaterEqualDepth = 5,
  37359. Ci.GreaterDepth = 6,
  37360. Ci.NotEqualDepth = 7,
  37361. Ci.MultiplyOperation = 0,
  37362. Ci.MixOperation = 1,
  37363. Ci.AddOperation = 2,
  37364. Ci.NoToneMapping = 0,
  37365. Ci.LinearToneMapping = 1,
  37366. Ci.ReinhardToneMapping = 2,
  37367. Ci.Uncharted2ToneMapping = 3,
  37368. Ci.CineonToneMapping = 4,
  37369. Ci.UVMapping = 300,
  37370. Ci.CubeReflectionMapping = 301,
  37371. Ci.CubeRefractionMapping = 302,
  37372. Ci.EquirectangularReflectionMapping = 303,
  37373. Ci.EquirectangularRefractionMapping = 304,
  37374. Ci.SphericalReflectionMapping = 305,
  37375. Ci.CubeUVReflectionMapping = 306,
  37376. Ci.CubeUVRefractionMapping = 307,
  37377. Ci.RepeatWrapping = 1e3,
  37378. Ci.ClampToEdgeWrapping = 1001,
  37379. Ci.MirroredRepeatWrapping = 1002,
  37380. Ci.NearestFilter = 1003,
  37381. Ci.NearestMipMapNearestFilter = 1004,
  37382. Ci.NearestMipMapLinearFilter = 1005,
  37383. Ci.LinearFilter = 1006,
  37384. Ci.LinearMipMapNearestFilter = 1007,
  37385. Ci.LinearMipMapLinearFilter = 1008,
  37386. Ci.UnsignedByteType = 1009,
  37387. Ci.ByteType = 1010,
  37388. Ci.ShortType = 1011,
  37389. Ci.UnsignedShortType = 1012,
  37390. Ci.IntType = 1013,
  37391. Ci.UnsignedIntType = 1014,
  37392. Ci.FloatType = 1015,
  37393. Ci.HalfFloatType = 1025,
  37394. Ci.UnsignedShort4444Type = 1016,
  37395. Ci.UnsignedShort5551Type = 1017,
  37396. Ci.UnsignedShort565Type = 1018,
  37397. Ci.AlphaFormat = 1019,
  37398. Ci.RGBFormat = 1020,
  37399. Ci.RGBAFormat = 1021,
  37400. Ci.LuminanceFormat = 1022,
  37401. Ci.LuminanceAlphaFormat = 1023,
  37402. Ci.RGBEFormat = Ci.RGBAFormat,
  37403. Ci.RGB_S3TC_DXT1_Format = 2001,
  37404. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37405. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37406. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37407. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37408. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37409. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37410. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37411. Ci.RGB_ETC1_Format = 2151,
  37412. Ci.LoopOnce = 2200,
  37413. Ci.LoopRepeat = 2201,
  37414. Ci.LoopPingPong = 2202,
  37415. Ci.InterpolateDiscrete = 2300,
  37416. Ci.InterpolateLinear = 2301,
  37417. Ci.InterpolateSmooth = 2302,
  37418. Ci.ZeroCurvatureEnding = 2400,
  37419. Ci.ZeroSlopeEnding = 2401,
  37420. Ci.WrapAroundEnding = 2402,
  37421. Ci.TrianglesDrawMode = 0,
  37422. Ci.TriangleStripDrawMode = 1,
  37423. Ci.TriangleFanDrawMode = 2,
  37424. Ci.LinearEncoding = 3e3,
  37425. Ci.sRGBEncoding = 3001,
  37426. Ci.GammaEncoding = 3007,
  37427. Ci.RGBEEncoding = 3002,
  37428. Ci.LogLuvEncoding = 3003,
  37429. Ci.RGBM7Encoding = 3004,
  37430. Ci.RGBM16Encoding = 3005,
  37431. Ci.RGBDEncoding = 3006,
  37432. Ci.Color = function(e) {
  37433. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37434. }
  37435. ,
  37436. Ci.Color.prototype = {
  37437. constructor: Ci.Color,
  37438. r: 1,
  37439. g: 1,
  37440. b: 1,
  37441. set: function(e) {
  37442. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37443. this
  37444. },
  37445. setScalar: function(e) {
  37446. this.r = e,
  37447. this.g = e,
  37448. this.b = e
  37449. },
  37450. setHex: function(e) {
  37451. return e = Math.floor(e),
  37452. this.r = (e >> 16 & 255) / 255,
  37453. this.g = (e >> 8 & 255) / 255,
  37454. this.b = (255 & e) / 255,
  37455. this
  37456. },
  37457. setRGB: function(e, t, i) {
  37458. return this.r = e,
  37459. this.g = t,
  37460. this.b = i,
  37461. this
  37462. },
  37463. setHSL: function(e, t, i) {
  37464. if (e = Ci.Math.euclideanModulo(e, 1),
  37465. t = Ci.Math.clamp(t, 0, 1),
  37466. i = Ci.Math.clamp(i, 0, 1),
  37467. 0 === t)
  37468. this.r = this.g = this.b = i;
  37469. else {
  37470. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37471. , r = 2 * i - n;
  37472. this.r = _i(r, n, e + 1 / 3),
  37473. this.g = _i(r, n, e),
  37474. this.b = _i(r, n, e - 1 / 3)
  37475. }
  37476. return this
  37477. },
  37478. setStyle: function(t) {
  37479. function e(e) {
  37480. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37481. }
  37482. var i;
  37483. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37484. var n, r = i[1], o = i[2];
  37485. switch (r) {
  37486. case "rgb":
  37487. case "rgba":
  37488. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37489. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37490. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37491. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37492. e(n[5]),
  37493. this;
  37494. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37495. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37496. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37497. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37498. e(n[5]),
  37499. this;
  37500. break;
  37501. case "hsl":
  37502. case "hsla":
  37503. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37504. var a = parseFloat(n[1]) / 360
  37505. , s = parseInt(n[2], 10) / 100
  37506. , l = parseInt(n[3], 10) / 100;
  37507. return e(n[5]),
  37508. this.setHSL(a, s, l)
  37509. }
  37510. }
  37511. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37512. var c, h = (c = i[1]).length;
  37513. if (3 === h)
  37514. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37515. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37516. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37517. this;
  37518. if (6 === h)
  37519. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37520. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37521. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37522. this
  37523. }
  37524. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37525. return this
  37526. },
  37527. clone: function() {
  37528. return new this.constructor(this.r,this.g,this.b)
  37529. },
  37530. copy: function(e) {
  37531. return this.r = e.r,
  37532. this.g = e.g,
  37533. this.b = e.b,
  37534. this
  37535. },
  37536. copyGammaToLinear: function(e, t) {
  37537. return void 0 === t && (t = 2),
  37538. this.r = Math.pow(e.r, t),
  37539. this.g = Math.pow(e.g, t),
  37540. this.b = Math.pow(e.b, t),
  37541. this
  37542. },
  37543. copyLinearToGamma: function(e, t) {
  37544. void 0 === t && (t = 2);
  37545. var i = 0 < t ? 1 / t : 1;
  37546. return this.r = Math.pow(e.r, i),
  37547. this.g = Math.pow(e.g, i),
  37548. this.b = Math.pow(e.b, i),
  37549. this
  37550. },
  37551. convertGammaToLinear: function() {
  37552. var e = this.r
  37553. , t = this.g
  37554. , i = this.b;
  37555. return this.r = e * e,
  37556. this.g = t * t,
  37557. this.b = i * i,
  37558. this
  37559. },
  37560. convertLinearToGamma: function() {
  37561. return this.r = Math.sqrt(this.r),
  37562. this.g = Math.sqrt(this.g),
  37563. this.b = Math.sqrt(this.b),
  37564. this
  37565. },
  37566. getHex: function() {
  37567. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37568. },
  37569. getHexString: function() {
  37570. return ("000000" + this.getHex().toString(16)).slice(-6)
  37571. },
  37572. getHSL: function(e) {
  37573. var t, i, n = e || {
  37574. h: 0,
  37575. s: 0,
  37576. l: 0
  37577. }, 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;
  37578. if (l === s)
  37579. i = t = 0;
  37580. else {
  37581. var h = s - l;
  37582. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37583. s) {
  37584. case r:
  37585. t = (o - a) / h + (o < a ? 6 : 0);
  37586. break;
  37587. case o:
  37588. t = (a - r) / h + 2;
  37589. break;
  37590. case a:
  37591. t = (r - o) / h + 4
  37592. }
  37593. t /= 6
  37594. }
  37595. return n.h = t,
  37596. n.s = i,
  37597. n.l = c,
  37598. n
  37599. },
  37600. getStyle: function() {
  37601. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37602. },
  37603. offsetHSL: function(e, t, i) {
  37604. var n = this.getHSL();
  37605. return n.h += e,
  37606. n.s += t,
  37607. n.l += i,
  37608. this.setHSL(n.h, n.s, n.l),
  37609. this
  37610. },
  37611. add: function(e) {
  37612. return this.r += e.r,
  37613. this.g += e.g,
  37614. this.b += e.b,
  37615. this
  37616. },
  37617. addColors: function(e, t) {
  37618. return this.r = e.r + t.r,
  37619. this.g = e.g + t.g,
  37620. this.b = e.b + t.b,
  37621. this
  37622. },
  37623. addScalar: function(e) {
  37624. return this.r += e,
  37625. this.g += e,
  37626. this.b += e,
  37627. this
  37628. },
  37629. multiply: function(e) {
  37630. return this.r *= e.r,
  37631. this.g *= e.g,
  37632. this.b *= e.b,
  37633. this
  37634. },
  37635. multiplyScalar: function(e) {
  37636. return this.r *= e,
  37637. this.g *= e,
  37638. this.b *= e,
  37639. this
  37640. },
  37641. lerp: function(e, t) {
  37642. return this.r += (e.r - this.r) * t,
  37643. this.g += (e.g - this.g) * t,
  37644. this.b += (e.b - this.b) * t,
  37645. this
  37646. },
  37647. equals: function(e) {
  37648. return e.r === this.r && e.g === this.g && e.b === this.b
  37649. },
  37650. fromArray: function(e, t) {
  37651. return void 0 === t && (t = 0),
  37652. this.r = e[t],
  37653. this.g = e[t + 1],
  37654. this.b = e[t + 2],
  37655. this
  37656. },
  37657. toArray: function(e, t) {
  37658. return void 0 === e && (e = []),
  37659. void 0 === t && (t = 0),
  37660. e[t] = this.r,
  37661. e[t + 1] = this.g,
  37662. e[t + 2] = this.b,
  37663. e
  37664. }
  37665. },
  37666. Ci.ColorKeywords = {
  37667. aliceblue: 15792383,
  37668. antiquewhite: 16444375,
  37669. aqua: 65535,
  37670. aquamarine: 8388564,
  37671. azure: 15794175,
  37672. beige: 16119260,
  37673. bisque: 16770244,
  37674. black: 0,
  37675. blanchedalmond: 16772045,
  37676. blue: 255,
  37677. blueviolet: 9055202,
  37678. brown: 10824234,
  37679. burlywood: 14596231,
  37680. cadetblue: 6266528,
  37681. chartreuse: 8388352,
  37682. chocolate: 13789470,
  37683. coral: 16744272,
  37684. cornflowerblue: 6591981,
  37685. cornsilk: 16775388,
  37686. crimson: 14423100,
  37687. cyan: 65535,
  37688. darkblue: 139,
  37689. darkcyan: 35723,
  37690. darkgoldenrod: 12092939,
  37691. darkgray: 11119017,
  37692. darkgreen: 25600,
  37693. darkgrey: 11119017,
  37694. darkkhaki: 12433259,
  37695. darkmagenta: 9109643,
  37696. darkolivegreen: 5597999,
  37697. darkorange: 16747520,
  37698. darkorchid: 10040012,
  37699. darkred: 9109504,
  37700. darksalmon: 15308410,
  37701. darkseagreen: 9419919,
  37702. darkslateblue: 4734347,
  37703. darkslategray: 3100495,
  37704. darkslategrey: 3100495,
  37705. darkturquoise: 52945,
  37706. darkviolet: 9699539,
  37707. deeppink: 16716947,
  37708. deepskyblue: 49151,
  37709. dimgray: 6908265,
  37710. dimgrey: 6908265,
  37711. dodgerblue: 2003199,
  37712. firebrick: 11674146,
  37713. floralwhite: 16775920,
  37714. forestgreen: 2263842,
  37715. fuchsia: 16711935,
  37716. gainsboro: 14474460,
  37717. ghostwhite: 16316671,
  37718. gold: 16766720,
  37719. goldenrod: 14329120,
  37720. gray: 8421504,
  37721. green: 32768,
  37722. greenyellow: 11403055,
  37723. grey: 8421504,
  37724. honeydew: 15794160,
  37725. hotpink: 16738740,
  37726. indianred: 13458524,
  37727. indigo: 4915330,
  37728. ivory: 16777200,
  37729. khaki: 15787660,
  37730. lavender: 15132410,
  37731. lavenderblush: 16773365,
  37732. lawngreen: 8190976,
  37733. lemonchiffon: 16775885,
  37734. lightblue: 11393254,
  37735. lightcoral: 15761536,
  37736. lightcyan: 14745599,
  37737. lightgoldenrodyellow: 16448210,
  37738. lightgray: 13882323,
  37739. lightgreen: 9498256,
  37740. lightgrey: 13882323,
  37741. lightpink: 16758465,
  37742. lightsalmon: 16752762,
  37743. lightseagreen: 2142890,
  37744. lightskyblue: 8900346,
  37745. lightslategray: 7833753,
  37746. lightslategrey: 7833753,
  37747. lightsteelblue: 11584734,
  37748. lightyellow: 16777184,
  37749. lime: 65280,
  37750. limegreen: 3329330,
  37751. linen: 16445670,
  37752. magenta: 16711935,
  37753. maroon: 8388608,
  37754. mediumaquamarine: 6737322,
  37755. mediumblue: 205,
  37756. mediumorchid: 12211667,
  37757. mediumpurple: 9662683,
  37758. mediumseagreen: 3978097,
  37759. mediumslateblue: 8087790,
  37760. mediumspringgreen: 64154,
  37761. mediumturquoise: 4772300,
  37762. mediumvioletred: 13047173,
  37763. midnightblue: 1644912,
  37764. mintcream: 16121850,
  37765. mistyrose: 16770273,
  37766. moccasin: 16770229,
  37767. navajowhite: 16768685,
  37768. navy: 128,
  37769. oldlace: 16643558,
  37770. olive: 8421376,
  37771. olivedrab: 7048739,
  37772. orange: 16753920,
  37773. orangered: 16729344,
  37774. orchid: 14315734,
  37775. palegoldenrod: 15657130,
  37776. palegreen: 10025880,
  37777. paleturquoise: 11529966,
  37778. palevioletred: 14381203,
  37779. papayawhip: 16773077,
  37780. peachpuff: 16767673,
  37781. peru: 13468991,
  37782. pink: 16761035,
  37783. plum: 14524637,
  37784. powderblue: 11591910,
  37785. purple: 8388736,
  37786. red: 16711680,
  37787. rosybrown: 12357519,
  37788. royalblue: 4286945,
  37789. saddlebrown: 9127187,
  37790. salmon: 16416882,
  37791. sandybrown: 16032864,
  37792. seagreen: 3050327,
  37793. seashell: 16774638,
  37794. sienna: 10506797,
  37795. silver: 12632256,
  37796. skyblue: 8900331,
  37797. slateblue: 6970061,
  37798. slategray: 7372944,
  37799. slategrey: 7372944,
  37800. snow: 16775930,
  37801. springgreen: 65407,
  37802. steelblue: 4620980,
  37803. tan: 13808780,
  37804. teal: 32896,
  37805. thistle: 14204888,
  37806. tomato: 16737095,
  37807. turquoise: 4251856,
  37808. violet: 15631086,
  37809. wheat: 16113331,
  37810. white: 16777215,
  37811. whitesmoke: 16119285,
  37812. yellow: 16776960,
  37813. yellowgreen: 10145074
  37814. },
  37815. Ci.Quaternion = function(e, t, i, n) {
  37816. this._x = e || 0,
  37817. this._y = t || 0,
  37818. this._z = i || 0,
  37819. this._w = void 0 !== n ? n : 1
  37820. }
  37821. ,
  37822. Ci.Quaternion.prototype = {
  37823. constructor: Ci.Quaternion,
  37824. get x() {
  37825. return this._x
  37826. },
  37827. set x(e) {
  37828. this._x = e,
  37829. this.onChangeCallback()
  37830. },
  37831. get y() {
  37832. return this._y
  37833. },
  37834. set y(e) {
  37835. this._y = e,
  37836. this.onChangeCallback()
  37837. },
  37838. get z() {
  37839. return this._z
  37840. },
  37841. set z(e) {
  37842. this._z = e,
  37843. this.onChangeCallback()
  37844. },
  37845. get w() {
  37846. return this._w
  37847. },
  37848. set w(e) {
  37849. this._w = e,
  37850. this.onChangeCallback()
  37851. },
  37852. set: function(e, t, i, n) {
  37853. return this._x = e,
  37854. this._y = t,
  37855. this._z = i,
  37856. this._w = n,
  37857. this.onChangeCallback(),
  37858. this
  37859. },
  37860. clone: function() {
  37861. return new this.constructor(this._x,this._y,this._z,this._w)
  37862. },
  37863. toObject:function(){//add
  37864. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37865. },
  37866. copy: function(e) {
  37867. return this._x = e.x,
  37868. this._y = e.y,
  37869. this._z = e.z,
  37870. this._w = e.w,
  37871. this.onChangeCallback(),
  37872. this
  37873. },
  37874. setFromEuler: function(e, t) {
  37875. if (e instanceof Ci.Euler == 0)
  37876. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37877. var i = Math.cos(e._x / 2)
  37878. , n = Math.cos(e._y / 2)
  37879. , r = Math.cos(e._z / 2)
  37880. , o = Math.sin(e._x / 2)
  37881. , a = Math.sin(e._y / 2)
  37882. , s = Math.sin(e._z / 2)
  37883. , l = e.order;
  37884. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37885. this._y = i * a * r - o * n * s,
  37886. this._z = i * n * s + o * a * r,
  37887. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37888. this._y = i * a * r - o * n * s,
  37889. this._z = i * n * s - o * a * r,
  37890. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37891. this._y = i * a * r + o * n * s,
  37892. this._z = i * n * s + o * a * r,
  37893. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37894. this._y = i * a * r + o * n * s,
  37895. this._z = i * n * s - o * a * r,
  37896. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37897. this._y = i * a * r + o * n * s,
  37898. this._z = i * n * s - o * a * r,
  37899. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37900. this._y = i * a * r - o * n * s,
  37901. this._z = i * n * s + o * a * r,
  37902. this._w = i * n * r + o * a * s),
  37903. !1 !== t && this.onChangeCallback(),
  37904. this
  37905. },
  37906. setFromAxisAngle: function(e, t) {
  37907. var i = t / 2
  37908. , n = Math.sin(i);
  37909. return this._x = e.x * n,
  37910. this._y = e.y * n,
  37911. this._z = e.z * n,
  37912. this._w = Math.cos(i),
  37913. this.onChangeCallback(),
  37914. this
  37915. },
  37916. setFromRotationMatrix: function(e) {
  37917. 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;
  37918. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37919. this._w = .25 / t,
  37920. this._x = (h - l) * t,
  37921. this._y = (o - c) * t,
  37922. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37923. this._w = (h - l) / t,
  37924. this._x = .25 * t,
  37925. this._y = (r + a) / t,
  37926. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37927. this._w = (o - c) / t,
  37928. this._x = (r + a) / t,
  37929. this._y = .25 * t,
  37930. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37931. this._w = (a - r) / t,
  37932. this._x = (o + c) / t,
  37933. this._y = (l + h) / t,
  37934. this._z = .25 * t),
  37935. this.onChangeCallback(),
  37936. this
  37937. },
  37938. setFromUnitVectors: function(e, t) {
  37939. return void 0 === Be && (Be = new Ci.Vector3),
  37940. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37941. 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),
  37942. this._x = Be.x,
  37943. this._y = Be.y,
  37944. this._z = Be.z,
  37945. this._w = Ve,
  37946. this.normalize(),
  37947. this
  37948. },
  37949. inverse: function() {
  37950. return this.conjugate().normalize(),
  37951. this
  37952. },
  37953. conjugate: function() {
  37954. return this._x *= -1,
  37955. this._y *= -1,
  37956. this._z *= -1,
  37957. this.onChangeCallback(),
  37958. this
  37959. },
  37960. dot: function(e) {
  37961. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37962. },
  37963. lengthSq: function() {
  37964. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37965. },
  37966. length: function() {
  37967. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37968. },
  37969. normalize: function() {
  37970. var e = this.length();
  37971. return 0 === e ? (this._x = 0,
  37972. this._y = 0,
  37973. this._z = 0,
  37974. this._w = 1) : (e = 1 / e,
  37975. this._x = this._x * e,
  37976. this._y = this._y * e,
  37977. this._z = this._z * e,
  37978. this._w = this._w * e),
  37979. this.onChangeCallback(),
  37980. this
  37981. },
  37982. multiply: function(e, t) {
  37983. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37984. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37985. },
  37986. multiplyQuaternions: function(e, t) {
  37987. var i = e._x
  37988. , n = e._y
  37989. , r = e._z
  37990. , o = e._w
  37991. , a = t._x
  37992. , s = t._y
  37993. , l = t._z
  37994. , c = t._w;
  37995. return this._x = i * c + o * a + n * l - r * s,
  37996. this._y = n * c + o * s + r * a - i * l,
  37997. this._z = r * c + o * l + i * s - n * a,
  37998. this._w = o * c - i * a - n * s - r * l,
  37999. this.onChangeCallback(),
  38000. this
  38001. },
  38002. slerp: function(e, t) {
  38003. if (0 === t)
  38004. return this;
  38005. if (1 === t)
  38006. return this.copy(e);
  38007. var i = this._x
  38008. , n = this._y
  38009. , r = this._z
  38010. , o = this._w
  38011. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  38012. if (a < 0 ? (this._w = -e._w,
  38013. this._x = -e._x,
  38014. this._y = -e._y,
  38015. this._z = -e._z,
  38016. a = -a) : this.copy(e),
  38017. 1 <= a)
  38018. return this._w = o,
  38019. this._x = i,
  38020. this._y = n,
  38021. this._z = r,
  38022. this;
  38023. var s = Math.sqrt(1 - a * a);
  38024. if (Math.abs(s) < .001)
  38025. return this._w = .5 * (o + this._w),
  38026. this._x = .5 * (i + this._x),
  38027. this._y = .5 * (n + this._y),
  38028. this._z = .5 * (r + this._z),
  38029. this;
  38030. var l = Math.atan2(s, a)
  38031. , c = Math.sin((1 - t) * l) / s
  38032. , h = Math.sin(t * l) / s;
  38033. return this._w = o * c + this._w * h,
  38034. this._x = i * c + this._x * h,
  38035. this._y = n * c + this._y * h,
  38036. this._z = r * c + this._z * h,
  38037. this.onChangeCallback(),
  38038. this
  38039. },
  38040. equals: function(e) {
  38041. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  38042. },
  38043. fromArray: function(e, t) {
  38044. return void 0 === t && (t = 0),
  38045. this._x = e[t],
  38046. this._y = e[t + 1],
  38047. this._z = e[t + 2],
  38048. this._w = e[t + 3],
  38049. this.onChangeCallback(),
  38050. this
  38051. },
  38052. toArray: function(e, t) {
  38053. return void 0 === e && (e = []),
  38054. void 0 === t && (t = 0),
  38055. e[t] = this._x,
  38056. e[t + 1] = this._y,
  38057. e[t + 2] = this._z,
  38058. e[t + 3] = this._w,
  38059. e
  38060. },
  38061. onChange: function(e) {
  38062. return this.onChangeCallback = e,
  38063. this
  38064. },
  38065. onChangeCallback: function() {}
  38066. },
  38067. Object.assign(Ci.Quaternion, {
  38068. slerp: function(e, t, i, n) {
  38069. return i.copy(e).slerp(t, n)
  38070. },
  38071. slerpFlat: function(e, t, i, n, r, o, a) {
  38072. var s = i[n + 0]
  38073. , l = i[n + 1]
  38074. , c = i[n + 2]
  38075. , h = i[n + 3]
  38076. , u = r[o + 0]
  38077. , d = r[o + 1]
  38078. , p = r[o + 2]
  38079. , f = r[o + 3];
  38080. if (h !== f || s !== u || l !== d || c !== p) {
  38081. var g = 1 - a
  38082. , m = s * u + l * d + c * p + h * f
  38083. , v = 0 <= m ? 1 : -1
  38084. , y = 1 - m * m;
  38085. if (y > Number.EPSILON) {
  38086. var A = Math.sqrt(y)
  38087. , C = Math.atan2(A, m * v);
  38088. g = Math.sin(g * C) / A,
  38089. a = Math.sin(a * C) / A
  38090. }
  38091. var I = a * v;
  38092. if (s = s * g + u * I,
  38093. l = l * g + d * I,
  38094. c = c * g + p * I,
  38095. h = h * g + f * I,
  38096. g === 1 - a) {
  38097. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  38098. s *= E,
  38099. l *= E,
  38100. c *= E,
  38101. h *= E
  38102. }
  38103. }
  38104. e[t] = s,
  38105. e[t + 1] = l,
  38106. e[t + 2] = c,
  38107. e[t + 3] = h
  38108. }
  38109. }),
  38110. Ci.Vector2 = function(e, t) {
  38111. this.x = e || 0,
  38112. this.y = t || 0
  38113. }
  38114. ,
  38115. Ci.Vector2.prototype = {
  38116. constructor: Ci.Vector2,
  38117. get width() {
  38118. return this.x
  38119. },
  38120. set width(e) {
  38121. this.x = e
  38122. },
  38123. get height() {
  38124. return this.y
  38125. },
  38126. set height(e) {
  38127. this.y = e
  38128. },
  38129. set: function(e, t) {
  38130. return this.x = e,
  38131. this.y = t,
  38132. this
  38133. },
  38134. setScalar: function(e) {
  38135. return this.x = e,
  38136. this.y = e,
  38137. this
  38138. },
  38139. setX: function(e) {
  38140. return this.x = e,
  38141. this
  38142. },
  38143. setY: function(e) {
  38144. return this.y = e,
  38145. this
  38146. },
  38147. setComponent: function(e, t) {
  38148. switch (e) {
  38149. case 0:
  38150. this.x = t;
  38151. break;
  38152. case 1:
  38153. this.y = t;
  38154. break;
  38155. default:
  38156. throw new Error("index is out of range: " + e)
  38157. }
  38158. },
  38159. getComponent: function(e) {
  38160. switch (e) {
  38161. case 0:
  38162. return this.x;
  38163. case 1:
  38164. return this.y;
  38165. default:
  38166. throw new Error("index is out of range: " + e)
  38167. }
  38168. },
  38169. clone: function() {
  38170. return new this.constructor(this.x,this.y)
  38171. },
  38172. copy: function(e) {
  38173. return this.x = e.x,
  38174. this.y = e.y,
  38175. this
  38176. },
  38177. add: function(e, t) {
  38178. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38179. this.addVectors(e, t)) : (this.x += e.x,
  38180. this.y += e.y,
  38181. this)
  38182. },
  38183. addScalar: function(e) {
  38184. return this.x += e,
  38185. this.y += e,
  38186. this
  38187. },
  38188. addVectors: function(e, t) {
  38189. return this.x = e.x + t.x,
  38190. this.y = e.y + t.y,
  38191. this
  38192. },
  38193. addScaledVector: function(e, t) {
  38194. return this.x += e.x * t,
  38195. this.y += e.y * t,
  38196. this
  38197. },
  38198. sub: function(e, t) {
  38199. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38200. this.subVectors(e, t)) : (this.x -= e.x,
  38201. this.y -= e.y,
  38202. this)
  38203. },
  38204. subScalar: function(e) {
  38205. return this.x -= e,
  38206. this.y -= e,
  38207. this
  38208. },
  38209. subVectors: function(e, t) {
  38210. return this.x = e.x - t.x,
  38211. this.y = e.y - t.y,
  38212. this
  38213. },
  38214. multiply: function(e) {
  38215. return this.x *= e.x,
  38216. this.y *= e.y,
  38217. this
  38218. },
  38219. multiplyScalar: function(e) {
  38220. return isFinite(e) ? (this.x *= e,
  38221. this.y *= e) : (this.x = 0,
  38222. this.y = 0),
  38223. this
  38224. },
  38225. divide: function(e) {
  38226. return this.x /= e.x,
  38227. this.y /= e.y,
  38228. this
  38229. },
  38230. divideScalar: function(e) {
  38231. return this.multiplyScalar(1 / e)
  38232. },
  38233. min: function(e) {
  38234. return this.x = Math.min(this.x, e.x),
  38235. this.y = Math.min(this.y, e.y),
  38236. this
  38237. },
  38238. max: function(e) {
  38239. return this.x = Math.max(this.x, e.x),
  38240. this.y = Math.max(this.y, e.y),
  38241. this
  38242. },
  38243. clamp: function(e, t) {
  38244. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38245. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38246. this
  38247. },
  38248. clampScalar: function(e, t) {
  38249. return void 0 === Ne && (Ne = new Ci.Vector2,
  38250. Fe = new Ci.Vector2),
  38251. Ne.set(e, e),
  38252. Fe.set(t, t),
  38253. this.clamp(Ne, Fe)
  38254. },
  38255. clampLength: function(e, t) {
  38256. var i = this.length();
  38257. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38258. this
  38259. },
  38260. floor: function() {
  38261. return this.x = Math.floor(this.x),
  38262. this.y = Math.floor(this.y),
  38263. this
  38264. },
  38265. ceil: function() {
  38266. return this.x = Math.ceil(this.x),
  38267. this.y = Math.ceil(this.y),
  38268. this
  38269. },
  38270. round: function() {
  38271. return this.x = Math.round(this.x),
  38272. this.y = Math.round(this.y),
  38273. this
  38274. },
  38275. roundToZero: function() {
  38276. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38277. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38278. this
  38279. },
  38280. negate: function() {
  38281. return this.x = -this.x,
  38282. this.y = -this.y,
  38283. this
  38284. },
  38285. dot: function(e) {
  38286. return this.x * e.x + this.y * e.y
  38287. },
  38288. lengthSq: function() {
  38289. return this.x * this.x + this.y * this.y
  38290. },
  38291. length: function() {
  38292. return Math.sqrt(this.x * this.x + this.y * this.y)
  38293. },
  38294. lengthManhattan: function() {
  38295. return Math.abs(this.x) + Math.abs(this.y)
  38296. },
  38297. normalize: function() {
  38298. return this.divideScalar(this.length())
  38299. },
  38300. angle: function() {
  38301. var e = Math.atan2(this.y, this.x);
  38302. return e < 0 && (e += 2 * Math.PI),
  38303. e
  38304. },
  38305. distanceTo: function(e) {
  38306. return Math.sqrt(this.distanceToSquared(e))
  38307. },
  38308. distanceToSquared: function(e) {
  38309. var t = this.x - e.x
  38310. , i = this.y - e.y;
  38311. return t * t + i * i
  38312. },
  38313. setLength: function(e) {
  38314. return this.multiplyScalar(e / this.length())
  38315. },
  38316. lerp: function(e, t) {
  38317. return this.x += (e.x - this.x) * t,
  38318. this.y += (e.y - this.y) * t,
  38319. this
  38320. },
  38321. lerpVectors: function(e, t, i) {
  38322. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38323. this
  38324. },
  38325. equals: function(e) {
  38326. return e.x === this.x && e.y === this.y
  38327. },
  38328. fromArray: function(e, t) {
  38329. return void 0 === t && (t = 0),
  38330. this.x = e[t],
  38331. this.y = e[t + 1],
  38332. this
  38333. },
  38334. toArray: function(e, t) {
  38335. return void 0 === e && (e = []),
  38336. void 0 === t && (t = 0),
  38337. e[t] = this.x,
  38338. e[t + 1] = this.y,
  38339. e
  38340. },
  38341. fromAttribute: function(e, t, i) {
  38342. return void 0 === i && (i = 0),
  38343. t = t * e.itemSize + i,
  38344. this.x = e.array[t],
  38345. this.y = e.array[t + 1],
  38346. this
  38347. },
  38348. rotateAround: function(e, t) {
  38349. var i = Math.cos(t)
  38350. , n = Math.sin(t)
  38351. , r = this.x - e.x
  38352. , o = this.y - e.y;
  38353. return this.x = r * i - o * n + e.x,
  38354. this.y = r * n + o * i + e.y,
  38355. this
  38356. }
  38357. },
  38358. Ci.Vector3 = function(e, t, i) {
  38359. this.x = e || 0,
  38360. this.y = t || 0,
  38361. this.z = i || 0
  38362. }
  38363. ,
  38364. Ci.Vector3.prototype = {
  38365. constructor: Ci.Vector3,
  38366. set: function(e, t, i) {
  38367. return this.x = e,
  38368. this.y = t,
  38369. this.z = i,
  38370. this
  38371. },
  38372. setScalar: function(e) {
  38373. return this.x = e,
  38374. this.y = e,
  38375. this.z = e,
  38376. this
  38377. },
  38378. setX: function(e) {
  38379. return this.x = e,
  38380. this
  38381. },
  38382. setY: function(e) {
  38383. return this.y = e,
  38384. this
  38385. },
  38386. setZ: function(e) {
  38387. return this.z = e,
  38388. this
  38389. },
  38390. setComponent: function(e, t) {
  38391. switch (e) {
  38392. case 0:
  38393. this.x = t;
  38394. break;
  38395. case 1:
  38396. this.y = t;
  38397. break;
  38398. case 2:
  38399. this.z = t;
  38400. break;
  38401. default:
  38402. throw new Error("index is out of range: " + e)
  38403. }
  38404. },
  38405. getComponent: function(e) {
  38406. switch (e) {
  38407. case 0:
  38408. return this.x;
  38409. case 1:
  38410. return this.y;
  38411. case 2:
  38412. return this.z;
  38413. default:
  38414. throw new Error("index is out of range: " + e)
  38415. }
  38416. },
  38417. clone: function() {
  38418. return new this.constructor(this.x,this.y,this.z)
  38419. },
  38420. copy: function(e) {
  38421. return this.x = e.x,
  38422. this.y = e.y,
  38423. this.z = e.z,
  38424. this
  38425. },
  38426. add: function(e, t) {
  38427. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38428. this.addVectors(e, t)) : (this.x += e.x,
  38429. this.y += e.y,
  38430. this.z += e.z,
  38431. this)
  38432. },
  38433. addScalar: function(e) {
  38434. return this.x += e,
  38435. this.y += e,
  38436. this.z += e,
  38437. this
  38438. },
  38439. addVectors: function(e, t) {
  38440. return this.x = e.x + t.x,
  38441. this.y = e.y + t.y,
  38442. this.z = e.z + t.z,
  38443. this
  38444. },
  38445. addScaledVector: function(e, t) {
  38446. return this.x += e.x * t,
  38447. this.y += e.y * t,
  38448. this.z += e.z * t,
  38449. this
  38450. },
  38451. sub: function(e, t) {
  38452. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38453. this.subVectors(e, t)) : (this.x -= e.x,
  38454. this.y -= e.y,
  38455. this.z -= e.z,
  38456. this)
  38457. },
  38458. subScalar: function(e) {
  38459. return this.x -= e,
  38460. this.y -= e,
  38461. this.z -= e,
  38462. this
  38463. },
  38464. subVectors: function(e, t) {
  38465. return this.x = e.x - t.x,
  38466. this.y = e.y - t.y,
  38467. this.z = e.z - t.z,
  38468. this
  38469. },
  38470. multiply: function(e, t) {
  38471. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38472. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38473. this.y *= e.y,
  38474. this.z *= e.z,
  38475. this)
  38476. },
  38477. multiplyScalar: function(e) {
  38478. return isFinite(e) ? (this.x *= e,
  38479. this.y *= e,
  38480. this.z *= e) : (this.x = 0,
  38481. this.y = 0,
  38482. this.z = 0),
  38483. this
  38484. },
  38485. multiplyVectors: function(e, t) {
  38486. return this.x = e.x * t.x,
  38487. this.y = e.y * t.y,
  38488. this.z = e.z * t.z,
  38489. this
  38490. },
  38491. applyEuler: function(e) {
  38492. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38493. void 0 === De && (De = new Ci.Quaternion),
  38494. this.applyQuaternion(De.setFromEuler(e)),
  38495. this
  38496. },
  38497. applyAxisAngle: function(e, t) {
  38498. return void 0 === Le && (Le = new Ci.Quaternion),
  38499. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38500. this
  38501. },
  38502. applyMatrix3: function(e) {
  38503. var t = this.x
  38504. , i = this.y
  38505. , n = this.z
  38506. , r = e.elements;
  38507. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38508. this.y = r[1] * t + r[4] * i + r[7] * n,
  38509. this.z = r[2] * t + r[5] * i + r[8] * n,
  38510. this
  38511. },
  38512. applyMatrix4: function(e) {
  38513. var t = this.x
  38514. , i = this.y
  38515. , n = this.z
  38516. , r = e.elements;
  38517. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38518. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38519. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38520. this
  38521. },
  38522. applyProjection: function(e) {
  38523. var t = this.x
  38524. , i = this.y
  38525. , n = this.z
  38526. , r = e.elements
  38527. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38528. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38529. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38530. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38531. this
  38532. },
  38533. applyQuaternion: function(e) {
  38534. var t = this.x
  38535. , i = this.y
  38536. , n = this.z
  38537. , r = e.x
  38538. , o = e.y
  38539. , a = e.z
  38540. , s = e.w
  38541. , l = s * t + o * n - a * i
  38542. , c = s * i + a * t - r * n
  38543. , h = s * n + r * i - o * t
  38544. , u = -r * t - o * i - a * n;
  38545. return this.x = l * s + u * -r + c * -a - h * -o,
  38546. this.y = c * s + u * -o + h * -r - l * -a,
  38547. this.z = h * s + u * -a + l * -o - c * -r,
  38548. this
  38549. },
  38550. project: function(e) {
  38551. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38552. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38553. this.applyProjection(Oe)
  38554. },
  38555. unproject: function(e) {
  38556. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38557. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38558. this.applyProjection(Pe)
  38559. },
  38560. transformDirection: function(e) {
  38561. var t = this.x
  38562. , i = this.y
  38563. , n = this.z
  38564. , r = e.elements;
  38565. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38566. this.y = r[1] * t + r[5] * i + r[9] * n,
  38567. this.z = r[2] * t + r[6] * i + r[10] * n,
  38568. this.normalize(),
  38569. this
  38570. },
  38571. divide: function(e) {
  38572. return this.x /= e.x,
  38573. this.y /= e.y,
  38574. this.z /= e.z,
  38575. this
  38576. },
  38577. divideScalar: function(e) {
  38578. return this.multiplyScalar(1 / e)
  38579. },
  38580. min: function(e) {
  38581. return this.x = Math.min(this.x, e.x),
  38582. this.y = Math.min(this.y, e.y),
  38583. this.z = Math.min(this.z, e.z),
  38584. this
  38585. },
  38586. max: function(e) {
  38587. return this.x = Math.max(this.x, e.x),
  38588. this.y = Math.max(this.y, e.y),
  38589. this.z = Math.max(this.z, e.z),
  38590. this
  38591. },
  38592. clamp: function(e, t) {
  38593. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38594. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38595. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38596. this
  38597. },
  38598. clampScalar: function(e, t) {
  38599. return void 0 === Me && (Me = new Ci.Vector3,
  38600. Re = new Ci.Vector3),
  38601. Me.set(e, e, e),
  38602. Re.set(t, t, t),
  38603. this.clamp(Me, Re)
  38604. },
  38605. clampLength: function(e, t) {
  38606. var i = this.length();
  38607. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38608. this
  38609. },
  38610. floor: function() {
  38611. return this.x = Math.floor(this.x),
  38612. this.y = Math.floor(this.y),
  38613. this.z = Math.floor(this.z),
  38614. this
  38615. },
  38616. ceil: function() {
  38617. return this.x = Math.ceil(this.x),
  38618. this.y = Math.ceil(this.y),
  38619. this.z = Math.ceil(this.z),
  38620. this
  38621. },
  38622. round: function() {
  38623. return this.x = Math.round(this.x),
  38624. this.y = Math.round(this.y),
  38625. this.z = Math.round(this.z),
  38626. this
  38627. },
  38628. roundToZero: function() {
  38629. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38630. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38631. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38632. this
  38633. },
  38634. negate: function() {
  38635. return this.x = -this.x,
  38636. this.y = -this.y,
  38637. this.z = -this.z,
  38638. this
  38639. },
  38640. dot: function(e) {
  38641. return this.x * e.x + this.y * e.y + this.z * e.z
  38642. },
  38643. lengthSq: function() {
  38644. return this.x * this.x + this.y * this.y + this.z * this.z
  38645. },
  38646. length: function() {
  38647. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38648. },
  38649. lengthManhattan: function() {
  38650. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38651. },
  38652. normalize: function() {
  38653. return this.divideScalar(this.length())
  38654. },
  38655. setLength: function(e) {
  38656. return this.multiplyScalar(e / this.length())
  38657. },
  38658. lerp: function(e, t) {
  38659. return this.x += (e.x - this.x) * t,
  38660. this.y += (e.y - this.y) * t,
  38661. this.z += (e.z - this.z) * t,
  38662. this
  38663. },
  38664. lerpVectors: function(e, t, i) {
  38665. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38666. this
  38667. },
  38668. cross: function(e, t) {
  38669. if (void 0 !== t)
  38670. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38671. this.crossVectors(e, t);
  38672. var i = this.x
  38673. , n = this.y
  38674. , r = this.z;
  38675. return this.x = n * e.z - r * e.y,
  38676. this.y = r * e.x - i * e.z,
  38677. this.z = i * e.y - n * e.x,
  38678. this
  38679. },
  38680. crossVectors: function(e, t) {
  38681. var i = e.x
  38682. , n = e.y
  38683. , r = e.z
  38684. , o = t.x
  38685. , a = t.y
  38686. , s = t.z;
  38687. return this.x = n * s - r * a,
  38688. this.y = r * o - i * s,
  38689. this.z = i * a - n * o,
  38690. this
  38691. },
  38692. projectOnVector: function(e) {
  38693. return void 0 === xe && (xe = new Ci.Vector3),
  38694. xe.copy(e).normalize(),
  38695. Se = this.dot(xe),
  38696. this.copy(xe).multiplyScalar(Se)
  38697. },
  38698. projectOnPlane: function(e) {
  38699. return void 0 === Te && (Te = new Ci.Vector3),
  38700. Te.copy(this).projectOnVector(e),
  38701. this.sub(Te)
  38702. },
  38703. reflect: function(e) {
  38704. return void 0 === we && (we = new Ci.Vector3),
  38705. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38706. },
  38707. angleTo: function(e) {
  38708. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38709. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38710. },
  38711. distanceTo: function(e) {
  38712. return Math.sqrt(this.distanceToSquared(e))
  38713. },
  38714. distanceToSquared: function(e) {
  38715. var t = this.x - e.x
  38716. , i = this.y - e.y
  38717. , n = this.z - e.z;
  38718. return t * t + i * i + n * n
  38719. },
  38720. setFromSpherical: function(e) {
  38721. var t = Math.sin(e.phi) * e.radius;
  38722. return this.x = t * Math.sin(e.theta),
  38723. this.y = Math.cos(e.phi) * e.radius,
  38724. this.z = t * Math.cos(e.theta),
  38725. this
  38726. },
  38727. setFromMatrixPosition: function(e) {
  38728. return this.setFromMatrixColumn(e, 3)
  38729. },
  38730. setFromMatrixScale: function(e) {
  38731. var t = this.setFromMatrixColumn(e, 0).length()
  38732. , i = this.setFromMatrixColumn(e, 1).length()
  38733. , n = this.setFromMatrixColumn(e, 2).length();
  38734. return this.x = t,
  38735. this.y = i,
  38736. this.z = n,
  38737. this
  38738. },
  38739. setFromMatrixColumn: function(e, t) {
  38740. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38741. t = e = t),
  38742. this.fromArray(e.elements, 4 * t)
  38743. },
  38744. equals: function(e) {
  38745. return e.x === this.x && e.y === this.y && e.z === this.z
  38746. },
  38747. fromArray: function(e, t) {
  38748. return void 0 === t && (t = 0),
  38749. this.x = e[t],
  38750. this.y = e[t + 1],
  38751. this.z = e[t + 2],
  38752. this
  38753. },
  38754. toArray: function(e, t) {
  38755. return void 0 === e && (e = []),
  38756. void 0 === t && (t = 0),
  38757. e[t] = this.x,
  38758. e[t + 1] = this.y,
  38759. e[t + 2] = this.z,
  38760. e
  38761. },
  38762. fromAttribute: function(e, t, i) {
  38763. return void 0 === i && (i = 0),
  38764. t = t * e.itemSize + i,
  38765. this.x = e.array[t],
  38766. this.y = e.array[t + 1],
  38767. this.z = e.array[t + 2],
  38768. this
  38769. }
  38770. },
  38771. Ci.Vector4 = function(e, t, i, n) {
  38772. this.x = e || 0,
  38773. this.y = t || 0,
  38774. this.z = i || 0,
  38775. this.w = void 0 !== n ? n : 1
  38776. }
  38777. ,
  38778. Ci.Vector4.prototype = {
  38779. constructor: Ci.Vector4,
  38780. set: function(e, t, i, n) {
  38781. return this.x = e,
  38782. this.y = t,
  38783. this.z = i,
  38784. this.w = n,
  38785. this
  38786. },
  38787. setScalar: function(e) {
  38788. return this.x = e,
  38789. this.y = e,
  38790. this.z = e,
  38791. this.w = e,
  38792. this
  38793. },
  38794. setX: function(e) {
  38795. return this.x = e,
  38796. this
  38797. },
  38798. setY: function(e) {
  38799. return this.y = e,
  38800. this
  38801. },
  38802. setZ: function(e) {
  38803. return this.z = e,
  38804. this
  38805. },
  38806. setW: function(e) {
  38807. return this.w = e,
  38808. this
  38809. },
  38810. setComponent: function(e, t) {
  38811. switch (e) {
  38812. case 0:
  38813. this.x = t;
  38814. break;
  38815. case 1:
  38816. this.y = t;
  38817. break;
  38818. case 2:
  38819. this.z = t;
  38820. break;
  38821. case 3:
  38822. this.w = t;
  38823. break;
  38824. default:
  38825. throw new Error("index is out of range: " + e)
  38826. }
  38827. },
  38828. getComponent: function(e) {
  38829. switch (e) {
  38830. case 0:
  38831. return this.x;
  38832. case 1:
  38833. return this.y;
  38834. case 2:
  38835. return this.z;
  38836. case 3:
  38837. return this.w;
  38838. default:
  38839. throw new Error("index is out of range: " + e)
  38840. }
  38841. },
  38842. clone: function() {
  38843. return new this.constructor(this.x,this.y,this.z,this.w)
  38844. },
  38845. copy: function(e) {
  38846. return this.x = e.x,
  38847. this.y = e.y,
  38848. this.z = e.z,
  38849. this.w = void 0 !== e.w ? e.w : 1,
  38850. this
  38851. },
  38852. add: function(e, t) {
  38853. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38854. this.addVectors(e, t)) : (this.x += e.x,
  38855. this.y += e.y,
  38856. this.z += e.z,
  38857. this.w += e.w,
  38858. this)
  38859. },
  38860. addScalar: function(e) {
  38861. return this.x += e,
  38862. this.y += e,
  38863. this.z += e,
  38864. this.w += e,
  38865. this
  38866. },
  38867. addVectors: function(e, t) {
  38868. return this.x = e.x + t.x,
  38869. this.y = e.y + t.y,
  38870. this.z = e.z + t.z,
  38871. this.w = e.w + t.w,
  38872. this
  38873. },
  38874. addScaledVector: function(e, t) {
  38875. return this.x += e.x * t,
  38876. this.y += e.y * t,
  38877. this.z += e.z * t,
  38878. this.w += e.w * t,
  38879. this
  38880. },
  38881. sub: function(e, t) {
  38882. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38883. this.subVectors(e, t)) : (this.x -= e.x,
  38884. this.y -= e.y,
  38885. this.z -= e.z,
  38886. this.w -= e.w,
  38887. this)
  38888. },
  38889. subScalar: function(e) {
  38890. return this.x -= e,
  38891. this.y -= e,
  38892. this.z -= e,
  38893. this.w -= e,
  38894. this
  38895. },
  38896. subVectors: function(e, t) {
  38897. return this.x = e.x - t.x,
  38898. this.y = e.y - t.y,
  38899. this.z = e.z - t.z,
  38900. this.w = e.w - t.w,
  38901. this
  38902. },
  38903. multiplyScalar: function(e) {
  38904. return isFinite(e) ? (this.x *= e,
  38905. this.y *= e,
  38906. this.z *= e,
  38907. this.w *= e) : (this.x = 0,
  38908. this.y = 0,
  38909. this.z = 0,
  38910. this.w = 0),
  38911. this
  38912. },
  38913. applyMatrix4: function(e) {
  38914. var t = this.x
  38915. , i = this.y
  38916. , n = this.z
  38917. , r = this.w
  38918. , o = e.elements;
  38919. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38920. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38921. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38922. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38923. this
  38924. },
  38925. divideScalar: function(e) {
  38926. return this.multiplyScalar(1 / e)
  38927. },
  38928. setAxisAngleFromQuaternion: function(e) {
  38929. this.w = 2 * Math.acos(e.w);
  38930. var t = Math.sqrt(1 - e.w * e.w);
  38931. return t < 1e-4 ? (this.x = 1,
  38932. this.y = 0,
  38933. this.z = 0) : (this.x = e.x / t,
  38934. this.y = e.y / t,
  38935. this.z = e.z / t),
  38936. this
  38937. },
  38938. setAxisAngleFromRotationMatrix: function(e) {
  38939. 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];
  38940. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38941. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38942. return this.set(1, 0, 0, 0),
  38943. this;
  38944. t = Math.PI;
  38945. var g = (a + 1) / 2
  38946. , m = (h + 1) / 2
  38947. , v = (f + 1) / 2
  38948. , y = (s + c) / 4
  38949. , A = (l + d) / 4
  38950. , C = (u + p) / 4;
  38951. return m < g && v < g ? r = g < .01 ? (i = 0,
  38952. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38953. A / i) : v < m ? r = m < .01 ? (n = 0,
  38954. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38955. C / n) : v < .01 ? (n = i = .707106781,
  38956. r = 0) : (i = A / (r = Math.sqrt(v)),
  38957. n = C / r),
  38958. this.set(i, n, r, t),
  38959. this
  38960. }
  38961. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38962. return Math.abs(I) < .001 && (I = 1),
  38963. this.x = (p - u) / I,
  38964. this.y = (l - d) / I,
  38965. this.z = (c - s) / I,
  38966. this.w = Math.acos((a + h + f - 1) / 2),
  38967. this
  38968. },
  38969. min: function(e) {
  38970. return this.x = Math.min(this.x, e.x),
  38971. this.y = Math.min(this.y, e.y),
  38972. this.z = Math.min(this.z, e.z),
  38973. this.w = Math.min(this.w, e.w),
  38974. this
  38975. },
  38976. max: function(e) {
  38977. return this.x = Math.max(this.x, e.x),
  38978. this.y = Math.max(this.y, e.y),
  38979. this.z = Math.max(this.z, e.z),
  38980. this.w = Math.max(this.w, e.w),
  38981. this
  38982. },
  38983. clamp: function(e, t) {
  38984. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38985. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38986. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38987. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38988. this
  38989. },
  38990. clampScalar: function(e, t) {
  38991. return void 0 === _e && (_e = new Ci.Vector4,
  38992. be = new Ci.Vector4),
  38993. _e.set(e, e, e, e),
  38994. be.set(t, t, t, t),
  38995. this.clamp(_e, be)
  38996. },
  38997. floor: function() {
  38998. return this.x = Math.floor(this.x),
  38999. this.y = Math.floor(this.y),
  39000. this.z = Math.floor(this.z),
  39001. this.w = Math.floor(this.w),
  39002. this
  39003. },
  39004. ceil: function() {
  39005. return this.x = Math.ceil(this.x),
  39006. this.y = Math.ceil(this.y),
  39007. this.z = Math.ceil(this.z),
  39008. this.w = Math.ceil(this.w),
  39009. this
  39010. },
  39011. round: function() {
  39012. return this.x = Math.round(this.x),
  39013. this.y = Math.round(this.y),
  39014. this.z = Math.round(this.z),
  39015. this.w = Math.round(this.w),
  39016. this
  39017. },
  39018. roundToZero: function() {
  39019. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39020. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39021. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39022. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  39023. this
  39024. },
  39025. negate: function() {
  39026. return this.x = -this.x,
  39027. this.y = -this.y,
  39028. this.z = -this.z,
  39029. this.w = -this.w,
  39030. this
  39031. },
  39032. dot: function(e) {
  39033. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  39034. },
  39035. lengthSq: function() {
  39036. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  39037. },
  39038. length: function() {
  39039. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  39040. },
  39041. lengthManhattan: function() {
  39042. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  39043. },
  39044. normalize: function() {
  39045. return this.divideScalar(this.length())
  39046. },
  39047. setLength: function(e) {
  39048. return this.multiplyScalar(e / this.length())
  39049. },
  39050. lerp: function(e, t) {
  39051. return this.x += (e.x - this.x) * t,
  39052. this.y += (e.y - this.y) * t,
  39053. this.z += (e.z - this.z) * t,
  39054. this.w += (e.w - this.w) * t,
  39055. this
  39056. },
  39057. lerpVectors: function(e, t, i) {
  39058. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39059. this
  39060. },
  39061. equals: function(e) {
  39062. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  39063. },
  39064. fromArray: function(e, t) {
  39065. return void 0 === t && (t = 0),
  39066. this.x = e[t],
  39067. this.y = e[t + 1],
  39068. this.z = e[t + 2],
  39069. this.w = e[t + 3],
  39070. this
  39071. },
  39072. toArray: function(e, t) {
  39073. return void 0 === e && (e = []),
  39074. void 0 === t && (t = 0),
  39075. e[t] = this.x,
  39076. e[t + 1] = this.y,
  39077. e[t + 2] = this.z,
  39078. e[t + 3] = this.w,
  39079. e
  39080. },
  39081. fromAttribute: function(e, t, i) {
  39082. return void 0 === i && (i = 0),
  39083. t = t * e.itemSize + i,
  39084. this.x = e.array[t],
  39085. this.y = e.array[t + 1],
  39086. this.z = e.array[t + 2],
  39087. this.w = e.array[t + 3],
  39088. this
  39089. }
  39090. },
  39091. Ci.Euler = function(e, t, i, n) {
  39092. this._x = e || 0,
  39093. this._y = t || 0,
  39094. this._z = i || 0,
  39095. this._order = n || Ci.Euler.DefaultOrder
  39096. }
  39097. ,
  39098. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  39099. Ci.Euler.DefaultOrder = "XYZ",
  39100. Ci.Euler.prototype = {
  39101. constructor: Ci.Euler,
  39102. get x() {
  39103. return this._x
  39104. },
  39105. set x(e) {
  39106. this._x = e,
  39107. this.onChangeCallback()
  39108. },
  39109. get y() {
  39110. return this._y
  39111. },
  39112. set y(e) {
  39113. this._y = e,
  39114. this.onChangeCallback()
  39115. },
  39116. get z() {
  39117. return this._z
  39118. },
  39119. set z(e) {
  39120. this._z = e,
  39121. this.onChangeCallback()
  39122. },
  39123. get order() {
  39124. return this._order
  39125. },
  39126. set order(e) {
  39127. this._order = e,
  39128. this.onChangeCallback()
  39129. },
  39130. set: function(e, t, i, n) {
  39131. return this._x = e,
  39132. this._y = t,
  39133. this._z = i,
  39134. this._order = n || this._order,
  39135. this.onChangeCallback(),
  39136. this
  39137. },
  39138. clone: function() {
  39139. return new this.constructor(this._x,this._y,this._z,this._order)
  39140. },
  39141. copy: function(e) {
  39142. return this._x = e._x,
  39143. this._y = e._y,
  39144. this._z = e._z,
  39145. this._order = e._order,
  39146. this.onChangeCallback(),
  39147. this
  39148. },
  39149. toObject: function() {//xzw
  39150. return {x:this.x,y:this.y,z:this.z}
  39151. },
  39152. setFromRotationMatrix: function(e, t, i) {
  39153. var n = Ci.Math.clamp
  39154. , r = e.elements
  39155. , o = r[0]
  39156. , a = r[4]
  39157. , s = r[8]
  39158. , l = r[1]
  39159. , c = r[5]
  39160. , h = r[9]
  39161. , u = r[2]
  39162. , d = r[6]
  39163. , p = r[10];
  39164. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  39165. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  39166. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  39167. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  39168. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  39169. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  39170. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  39171. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  39172. this._z = Math.atan2(-a, c)) : (this._y = 0,
  39173. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  39174. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  39175. this._z = Math.atan2(l, o)) : (this._x = 0,
  39176. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  39177. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  39178. this._y = Math.atan2(-u, o)) : (this._x = 0,
  39179. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  39180. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  39181. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  39182. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39183. this._order = t,
  39184. !1 !== i && this.onChangeCallback(),
  39185. this
  39186. },
  39187. setFromQuaternion: function(e, t, i) {
  39188. return void 0 === Ee && (Ee = new Ci.Matrix4),
  39189. Ee.makeRotationFromQuaternion(e),
  39190. this.setFromRotationMatrix(Ee, t, i),
  39191. this
  39192. },
  39193. setFromVector3: function(e, t) {
  39194. return this.set(e.x, e.y, e.z, t || this._order)
  39195. },
  39196. reorder: (Ie = new Ci.Quaternion,
  39197. function(e) {
  39198. Ie.setFromEuler(this),
  39199. this.setFromQuaternion(Ie, e)
  39200. }
  39201. ),
  39202. equals: function(e) {
  39203. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39204. },
  39205. fromArray: function(e) {
  39206. return this._x = e[0],
  39207. this._y = e[1],
  39208. this._z = e[2],
  39209. void 0 !== e[3] && (this._order = e[3]),
  39210. this.onChangeCallback(),
  39211. this
  39212. },
  39213. toArray: function(e, t) {
  39214. return void 0 === e && (e = []),
  39215. void 0 === t && (t = 0),
  39216. e[t] = this._x,
  39217. e[t + 1] = this._y,
  39218. e[t + 2] = this._z,
  39219. e[t + 3] = this._order,
  39220. e
  39221. },
  39222. toVector3: function(e) {
  39223. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39224. },
  39225. onChange: function(e) {
  39226. return this.onChangeCallback = e,
  39227. this
  39228. },
  39229. onChangeCallback: function() {}
  39230. },
  39231. Ci.Line3 = function(e, t) {
  39232. this.start = void 0 !== e ? e : new Ci.Vector3,
  39233. this.end = void 0 !== t ? t : new Ci.Vector3
  39234. }
  39235. ,
  39236. Ci.Line3.prototype = {
  39237. constructor: Ci.Line3,
  39238. set: function(e, t) {
  39239. return this.start.copy(e),
  39240. this.end.copy(t),
  39241. this
  39242. },
  39243. clone: function() {
  39244. return (new this.constructor).copy(this)
  39245. },
  39246. copy: function(e) {
  39247. return this.start.copy(e.start),
  39248. this.end.copy(e.end),
  39249. this
  39250. },
  39251. center: function(e) {
  39252. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39253. },
  39254. delta: function(e) {
  39255. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39256. },
  39257. distanceSq: function() {
  39258. return this.start.distanceToSquared(this.end)
  39259. },
  39260. distance: function() {
  39261. return this.start.distanceTo(this.end)
  39262. },
  39263. at: function(e, t) {
  39264. var i = t || new Ci.Vector3;
  39265. return this.delta(i).multiplyScalar(e).add(this.start)
  39266. },
  39267. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39268. Ce = new Ci.Vector3,
  39269. function(e, t) {
  39270. Ae.subVectors(e, this.start),
  39271. Ce.subVectors(this.end, this.start);
  39272. var i = Ce.dot(Ce)
  39273. , n = Ce.dot(Ae) / i;
  39274. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39275. n
  39276. }
  39277. ),
  39278. closestPointToPoint: function(e, t, i) {
  39279. var n = this.closestPointToPointParameter(e, t)
  39280. , r = i || new Ci.Vector3;
  39281. return this.delta(r).multiplyScalar(n).add(this.start)
  39282. },
  39283. applyMatrix4: function(e) {
  39284. return this.start.applyMatrix4(e),
  39285. this.end.applyMatrix4(e),
  39286. this
  39287. },
  39288. equals: function(e) {
  39289. return e.start.equals(this.start) && e.end.equals(this.end)
  39290. }
  39291. },
  39292. Ci.Box2 = function(e, t) {
  39293. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39294. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39295. }
  39296. ,
  39297. Ci.Box2.prototype = {
  39298. constructor: Ci.Box2,
  39299. set: function(e, t) {
  39300. return this.min.copy(e),
  39301. this.max.copy(t),
  39302. this
  39303. },
  39304. setFromPoints: function(e) {
  39305. this.makeEmpty();
  39306. for (var t = 0, i = e.length; t < i; t++)
  39307. this.expandByPoint(e[t]);
  39308. return this
  39309. },
  39310. setFromCenterAndSize: (ye = new Ci.Vector2,
  39311. function(e, t) {
  39312. var i = ye.copy(t).multiplyScalar(.5);
  39313. return this.min.copy(e).sub(i),
  39314. this.max.copy(e).add(i),
  39315. this
  39316. }
  39317. ),
  39318. clone: function() {
  39319. return (new this.constructor).copy(this)
  39320. },
  39321. copy: function(e) {
  39322. return this.min.copy(e.min),
  39323. this.max.copy(e.max),
  39324. this
  39325. },
  39326. makeEmpty: function() {
  39327. return this.min.x = this.min.y = 1 / 0,
  39328. this.max.x = this.max.y = -1 / 0,
  39329. this
  39330. },
  39331. isEmpty: function() {
  39332. return this.max.x < this.min.x || this.max.y < this.min.y
  39333. },
  39334. center: function(e) {
  39335. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39336. },
  39337. size: function(e) {
  39338. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39339. },
  39340. expandByPoint: function(e) {
  39341. return this.min.min(e),
  39342. this.max.max(e),
  39343. this
  39344. },
  39345. expandByVector: function(e) {
  39346. return this.min.sub(e),
  39347. this.max.add(e),
  39348. this
  39349. },
  39350. expandByScalar: function(e) {
  39351. return this.min.addScalar(-e),
  39352. this.max.addScalar(e),
  39353. this
  39354. },
  39355. containsPoint: function(e) {
  39356. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39357. },
  39358. containsBox: function(e) {
  39359. 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
  39360. },
  39361. getParameter: function(e, t) {
  39362. 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))
  39363. },
  39364. intersectsBox: function(e) {
  39365. 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)
  39366. },
  39367. clampPoint: function(e, t) {
  39368. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39369. },
  39370. distanceToPoint: (ve = new Ci.Vector2,
  39371. function(e) {
  39372. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39373. }
  39374. ),
  39375. intersect: function(e) {
  39376. return this.min.max(e.min),
  39377. this.max.min(e.max),
  39378. this
  39379. },
  39380. union: function(e) {
  39381. return this.min.min(e.min),
  39382. this.max.max(e.max),
  39383. this
  39384. },
  39385. translate: function(e) {
  39386. return this.min.add(e),
  39387. this.max.add(e),
  39388. this
  39389. },
  39390. equals: function(e) {
  39391. return e.min.equals(this.min) && e.max.equals(this.max)
  39392. }
  39393. },
  39394. Ci.Box3 = function(e, t) {
  39395. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39396. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39397. }
  39398. ,
  39399. Ci.Box3.prototype = {
  39400. constructor: Ci.Box3,
  39401. set: function(e, t) {
  39402. return this.min.copy(e),
  39403. this.max.copy(t),
  39404. this
  39405. },
  39406. setFromArray: function(e) {
  39407. this.makeEmpty();
  39408. 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) {
  39409. var c = e[s]
  39410. , h = e[s + 1]
  39411. , u = e[s + 2];
  39412. c < t && (t = c),
  39413. h < i && (i = h),
  39414. u < n && (n = u),
  39415. r < c && (r = c),
  39416. o < h && (o = h),
  39417. a < u && (a = u)
  39418. }
  39419. this.min.set(t, i, n),
  39420. this.max.set(r, o, a)
  39421. },
  39422. setFromPoints: function(e) {
  39423. this.makeEmpty();
  39424. for (var t = 0, i = e.length; t < i; t++)
  39425. this.expandByPoint(e[t]);
  39426. return this
  39427. },
  39428. setFromCenterAndSize: (me = new Ci.Vector3,
  39429. function(e, t) {
  39430. var i = me.copy(t).multiplyScalar(.5);
  39431. return this.min.copy(e).sub(i),
  39432. this.max.copy(e).add(i),
  39433. this
  39434. }
  39435. ),
  39436. setFromObject: function(e) {
  39437. void 0 === ge && (ge = new Ci.Box3);
  39438. var i = this;
  39439. return this.makeEmpty(),
  39440. e.updateMatrixWorld(!0),
  39441. e.traverse(function(e) {
  39442. var t = e.geometry;
  39443. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39444. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39445. ge.applyMatrix4(e.matrixWorld),
  39446. i.union(ge)))
  39447. }),
  39448. this
  39449. },
  39450. clone: function() {
  39451. return (new this.constructor).copy(this)
  39452. },
  39453. copy: function(e) {
  39454. return this.min.copy(e.min),
  39455. this.max.copy(e.max),
  39456. this
  39457. },
  39458. makeEmpty: function() {
  39459. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39460. this.max.x = this.max.y = this.max.z = -1 / 0,
  39461. this
  39462. },
  39463. isEmpty: function() {
  39464. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39465. },
  39466. center: function(e) {
  39467. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39468. },
  39469. size: function(e) {
  39470. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39471. },
  39472. expandByPoint: function(e) {
  39473. return this.min.min(e),
  39474. this.max.max(e),
  39475. this
  39476. },
  39477. expandByVector: function(e) {
  39478. return this.min.sub(e),
  39479. this.max.add(e),
  39480. this
  39481. },
  39482. expandByScalar: function(e) {
  39483. return this.min.addScalar(-e),
  39484. this.max.addScalar(e),
  39485. this
  39486. },
  39487. containsPoint: function(e) {
  39488. 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)
  39489. },
  39490. containsBox: function(e) {
  39491. 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
  39492. },
  39493. getParameter: function(e, t) {
  39494. 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))
  39495. },
  39496. intersectsBox: function(e) {
  39497. 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)
  39498. },
  39499. intersectsSphere: function(e) {
  39500. return void 0 === fe && (fe = new Ci.Vector3),
  39501. this.clampPoint(e.center, fe),
  39502. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39503. },
  39504. intersectsPlane: function(e) {
  39505. var t, i;
  39506. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39507. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39508. e.normal.x * this.min.x),
  39509. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39510. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39511. i += e.normal.y * this.min.y),
  39512. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39513. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39514. i += e.normal.z * this.min.z),
  39515. t <= e.constant && i >= e.constant
  39516. },
  39517. clampPoint: function(e, t) {
  39518. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39519. },
  39520. distanceToPoint: (pe = new Ci.Vector3,
  39521. function(e) {
  39522. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39523. }
  39524. ),
  39525. getBoundingSphere: (de = new Ci.Vector3,
  39526. function(e) {
  39527. var t = e || new Ci.Sphere;
  39528. return t.center = this.center(),
  39529. t.radius = .5 * this.size(de).length(),
  39530. t
  39531. }
  39532. ),
  39533. intersect: function(e) {
  39534. return this.min.max(e.min),
  39535. this.max.min(e.max),
  39536. this
  39537. },
  39538. union: function(e) {
  39539. return this.min.min(e.min),
  39540. this.max.max(e.max),
  39541. this
  39542. },
  39543. 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],
  39544. function(e) {
  39545. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39546. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39547. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39548. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39549. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39550. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39551. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39552. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39553. this.makeEmpty(),
  39554. this.setFromPoints(ue),
  39555. this
  39556. }
  39557. ),
  39558. translate: function(e) {
  39559. return this.min.add(e),
  39560. this.max.add(e),
  39561. this
  39562. },
  39563. equals: function(e) {
  39564. return e.min.equals(this.min) && e.max.equals(this.max)
  39565. }
  39566. },
  39567. Ci.Matrix3 = function() {
  39568. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39569. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39570. }
  39571. ,
  39572. Ci.Matrix3.prototype = {
  39573. constructor: Ci.Matrix3,
  39574. set: function(e, t, i, n, r, o, a, s, l) {
  39575. var c = this.elements;
  39576. return c[0] = e,
  39577. c[1] = n,
  39578. c[2] = a,
  39579. c[3] = t,
  39580. c[4] = r,
  39581. c[5] = s,
  39582. c[6] = i,
  39583. c[7] = o,
  39584. c[8] = l,
  39585. this
  39586. },
  39587. identity: function() {
  39588. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39589. this
  39590. },
  39591. clone: function() {
  39592. return (new this.constructor).fromArray(this.elements)
  39593. },
  39594. copy: function(e) {
  39595. var t = e.elements;
  39596. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39597. this
  39598. },
  39599. setFromMatrix4: function(e) {
  39600. var t = e.elements;
  39601. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39602. this
  39603. },
  39604. applyToVector3Array: function(e, t, i) {
  39605. void 0 === he && (he = new Ci.Vector3),
  39606. void 0 === t && (t = 0),
  39607. void 0 === i && (i = e.length);
  39608. for (var n = 0, r = t; n < i; n += 3,
  39609. r += 3)
  39610. he.fromArray(e, r),
  39611. he.applyMatrix3(this),
  39612. he.toArray(e, r);
  39613. return e
  39614. },
  39615. applyToBuffer: function(e, t, i) {
  39616. void 0 === ce && (ce = new Ci.Vector3),
  39617. void 0 === t && (t = 0),
  39618. void 0 === i && (i = e.length / e.itemSize);
  39619. for (var n = 0, r = t; n < i; n++,
  39620. r++)
  39621. ce.x = e.getX(r),
  39622. ce.y = e.getY(r),
  39623. ce.z = e.getZ(r),
  39624. ce.applyMatrix3(this),
  39625. e.setXYZ(ce.x, ce.y, ce.z);
  39626. return e
  39627. },
  39628. multiplyScalar: function(e) {
  39629. var t = this.elements;
  39630. return t[0] *= e,
  39631. t[3] *= e,
  39632. t[6] *= e,
  39633. t[1] *= e,
  39634. t[4] *= e,
  39635. t[7] *= e,
  39636. t[2] *= e,
  39637. t[5] *= e,
  39638. t[8] *= e,
  39639. this
  39640. },
  39641. determinant: function() {
  39642. var e = this.elements
  39643. , t = e[0]
  39644. , i = e[1]
  39645. , n = e[2]
  39646. , r = e[3]
  39647. , o = e[4]
  39648. , a = e[5]
  39649. , s = e[6]
  39650. , l = e[7]
  39651. , c = e[8];
  39652. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39653. },
  39654. getInverse: function(e, t) {
  39655. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39656. var i = e.elements
  39657. , n = this.elements
  39658. , r = i[0]
  39659. , o = i[1]
  39660. , a = i[2]
  39661. , s = i[3]
  39662. , l = i[4]
  39663. , c = i[5]
  39664. , h = i[6]
  39665. , u = i[7]
  39666. , d = i[8]
  39667. , p = d * l - c * u
  39668. , f = c * h - d * s
  39669. , g = u * s - l * h
  39670. , m = r * p + o * f + a * g;
  39671. if (0 != m)
  39672. return n[0] = p,
  39673. n[1] = a * u - d * o,
  39674. n[2] = c * o - a * l,
  39675. n[3] = f,
  39676. n[4] = d * r - a * h,
  39677. n[5] = a * s - c * r,
  39678. n[6] = g,
  39679. n[7] = o * h - u * r,
  39680. n[8] = l * r - o * s,
  39681. this.multiplyScalar(1 / m);
  39682. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39683. if (t)
  39684. throw new Error(v);
  39685. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39686. },
  39687. transpose: function() {
  39688. var e, t = this.elements;
  39689. return e = t[1],
  39690. t[1] = t[3],
  39691. t[3] = e,
  39692. e = t[2],
  39693. t[2] = t[6],
  39694. t[6] = e,
  39695. e = t[5],
  39696. t[5] = t[7],
  39697. t[7] = e,
  39698. this
  39699. },
  39700. flattenToArrayOffset: function(e, t) {
  39701. var i = this.elements;
  39702. return e[t] = i[0],
  39703. e[t + 1] = i[1],
  39704. e[t + 2] = i[2],
  39705. e[t + 3] = i[3],
  39706. e[t + 4] = i[4],
  39707. e[t + 5] = i[5],
  39708. e[t + 6] = i[6],
  39709. e[t + 7] = i[7],
  39710. e[t + 8] = i[8],
  39711. e
  39712. },
  39713. getNormalMatrix: function(e) {
  39714. return this.setFromMatrix4(e).getInverse(this).transpose()
  39715. },
  39716. transposeIntoArray: function(e) {
  39717. var t = this.elements;
  39718. return e[0] = t[0],
  39719. e[1] = t[3],
  39720. e[2] = t[6],
  39721. e[3] = t[1],
  39722. e[4] = t[4],
  39723. e[5] = t[7],
  39724. e[6] = t[2],
  39725. e[7] = t[5],
  39726. e[8] = t[8],
  39727. this
  39728. },
  39729. fromArray: function(e) {
  39730. return this.elements.set(e),
  39731. this
  39732. },
  39733. toArray: function() {
  39734. var e = this.elements;
  39735. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39736. }
  39737. },
  39738. Ci.Matrix4 = function() {
  39739. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39740. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39741. }
  39742. ,
  39743. Ci.Matrix4.prototype = {
  39744. constructor: Ci.Matrix4,
  39745. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39746. var m = this.elements;
  39747. return m[0] = e,
  39748. m[4] = t,
  39749. m[8] = i,
  39750. m[12] = n,
  39751. m[1] = r,
  39752. m[5] = o,
  39753. m[9] = a,
  39754. m[13] = s,
  39755. m[2] = l,
  39756. m[6] = c,
  39757. m[10] = h,
  39758. m[14] = u,
  39759. m[3] = d,
  39760. m[7] = p,
  39761. m[11] = f,
  39762. m[15] = g,
  39763. this
  39764. },
  39765. identity: function() {
  39766. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39767. this
  39768. },
  39769. clone: function() {
  39770. return (new Ci.Matrix4).fromArray(this.elements)
  39771. },
  39772. copy: function(e) {
  39773. return this.elements.set(e.elements),
  39774. this
  39775. },
  39776. copyPosition: function(e) {
  39777. var t = this.elements
  39778. , i = e.elements;
  39779. return t[12] = i[12],
  39780. t[13] = i[13],
  39781. t[14] = i[14],
  39782. this
  39783. },
  39784. extractBasis: function(e, t, i) {
  39785. return e.setFromMatrixColumn(this, 0),
  39786. t.setFromMatrixColumn(this, 1),
  39787. i.setFromMatrixColumn(this, 2),
  39788. this
  39789. },
  39790. makeBasis: function(e, t, i) {
  39791. 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),
  39792. this
  39793. },
  39794. extractRotation: function(e) {
  39795. void 0 === le && (le = new Ci.Vector3);
  39796. var t = this.elements
  39797. , i = e.elements
  39798. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39799. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39800. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39801. return t[0] = i[0] * n,
  39802. t[1] = i[1] * n,
  39803. t[2] = i[2] * n,
  39804. t[4] = i[4] * r,
  39805. t[5] = i[5] * r,
  39806. t[6] = i[6] * r,
  39807. t[8] = i[8] * o,
  39808. t[9] = i[9] * o,
  39809. t[10] = i[10] * o,
  39810. this
  39811. },
  39812. makeRotationFromEuler: function(e) {
  39813. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39814. var t = this.elements
  39815. , i = e.x
  39816. , n = e.y
  39817. , r = e.z
  39818. , o = Math.cos(i)
  39819. , a = Math.sin(i)
  39820. , s = Math.cos(n)
  39821. , l = Math.sin(n)
  39822. , c = Math.cos(r)
  39823. , h = Math.sin(r);
  39824. if ("XYZ" === e.order) {
  39825. var u = o * c
  39826. , d = o * h
  39827. , p = a * c
  39828. , f = a * h;
  39829. t[0] = s * c,
  39830. t[4] = -s * h,
  39831. t[8] = l,
  39832. t[1] = d + p * l,
  39833. t[5] = u - f * l,
  39834. t[9] = -a * s,
  39835. t[2] = f - u * l,
  39836. t[6] = p + d * l,
  39837. t[10] = o * s
  39838. } else if ("YXZ" === e.order) {
  39839. var g = s * c
  39840. , m = s * h
  39841. , v = l * c
  39842. , y = l * h;
  39843. t[0] = g + y * a,
  39844. t[4] = v * a - m,
  39845. t[8] = o * l,
  39846. t[1] = o * h,
  39847. t[5] = o * c,
  39848. t[9] = -a,
  39849. t[2] = m * a - v,
  39850. t[6] = y + g * a,
  39851. t[10] = o * s
  39852. } else if ("ZXY" === e.order) {
  39853. g = s * c,
  39854. m = s * h,
  39855. v = l * c,
  39856. y = l * h;
  39857. t[0] = g - y * a,
  39858. t[4] = -o * h,
  39859. t[8] = v + m * a,
  39860. t[1] = m + v * a,
  39861. t[5] = o * c,
  39862. t[9] = y - g * a,
  39863. t[2] = -o * l,
  39864. t[6] = a,
  39865. t[10] = o * s
  39866. } else if ("ZYX" === e.order) {
  39867. u = o * c,
  39868. d = o * h,
  39869. p = a * c,
  39870. f = a * h;
  39871. t[0] = s * c,
  39872. t[4] = p * l - d,
  39873. t[8] = u * l + f,
  39874. t[1] = s * h,
  39875. t[5] = f * l + u,
  39876. t[9] = d * l - p,
  39877. t[2] = -l,
  39878. t[6] = a * s,
  39879. t[10] = o * s
  39880. } else if ("YZX" === e.order) {
  39881. var A = o * s
  39882. , C = o * l
  39883. , I = a * s
  39884. , E = a * l;
  39885. t[0] = s * c,
  39886. t[4] = E - A * h,
  39887. t[8] = I * h + C,
  39888. t[1] = h,
  39889. t[5] = o * c,
  39890. t[9] = -a * c,
  39891. t[2] = -l * c,
  39892. t[6] = C * h + I,
  39893. t[10] = A - E * h
  39894. } else if ("XZY" === e.order) {
  39895. A = o * s,
  39896. C = o * l,
  39897. I = a * s,
  39898. E = a * l;
  39899. t[0] = s * c,
  39900. t[4] = -h,
  39901. t[8] = l * c,
  39902. t[1] = A * h + E,
  39903. t[5] = o * c,
  39904. t[9] = C * h - I,
  39905. t[2] = I * h - C,
  39906. t[6] = a * c,
  39907. t[10] = E * h + A
  39908. }
  39909. return t[3] = 0,
  39910. t[7] = 0,
  39911. t[11] = 0,
  39912. t[12] = 0,
  39913. t[13] = 0,
  39914. t[14] = 0,
  39915. t[15] = 1,
  39916. this
  39917. },
  39918. makeRotationFromQuaternion: function(e) {
  39919. var t = this.elements
  39920. , i = e.x
  39921. , n = e.y
  39922. , r = e.z
  39923. , o = e.w
  39924. , a = i + i
  39925. , s = n + n
  39926. , l = r + r
  39927. , c = i * a
  39928. , h = i * s
  39929. , u = i * l
  39930. , d = n * s
  39931. , p = n * l
  39932. , f = r * l
  39933. , g = o * a
  39934. , m = o * s
  39935. , v = o * l;
  39936. return t[0] = 1 - (d + f),
  39937. t[4] = h - v,
  39938. t[8] = u + m,
  39939. t[1] = h + v,
  39940. t[5] = 1 - (c + f),
  39941. t[9] = p - g,
  39942. t[2] = u - m,
  39943. t[6] = p + g,
  39944. t[10] = 1 - (c + d),
  39945. t[3] = 0,
  39946. t[7] = 0,
  39947. t[11] = 0,
  39948. t[12] = 0,
  39949. t[13] = 0,
  39950. t[14] = 0,
  39951. t[15] = 1,
  39952. this
  39953. },
  39954. lookAt: function(e, t, i) {
  39955. void 0 === oe && (oe = new Ci.Vector3),
  39956. void 0 === ae && (ae = new Ci.Vector3),
  39957. void 0 === se && (se = new Ci.Vector3);
  39958. var n = this.elements;
  39959. return se.subVectors(e, t).normalize(),
  39960. 0 === se.lengthSq() && (se.z = 1),
  39961. oe.crossVectors(i, se).normalize(),
  39962. 0 === oe.lengthSq() && (se.x += 1e-4,
  39963. oe.crossVectors(i, se).normalize()),
  39964. ae.crossVectors(se, oe),
  39965. n[0] = oe.x,
  39966. n[4] = ae.x,
  39967. n[8] = se.x,
  39968. n[1] = oe.y,
  39969. n[5] = ae.y,
  39970. n[9] = se.y,
  39971. n[2] = oe.z,
  39972. n[6] = ae.z,
  39973. n[10] = se.z,
  39974. this
  39975. },
  39976. multiply: function(e, t) {
  39977. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39978. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39979. },
  39980. multiplyMatrices: function(e, t) {
  39981. var i = e.elements
  39982. , n = t.elements
  39983. , r = this.elements
  39984. , o = i[0]
  39985. , a = i[4]
  39986. , s = i[8]
  39987. , l = i[12]
  39988. , c = i[1]
  39989. , h = i[5]
  39990. , u = i[9]
  39991. , d = i[13]
  39992. , p = i[2]
  39993. , f = i[6]
  39994. , g = i[10]
  39995. , m = i[14]
  39996. , v = i[3]
  39997. , y = i[7]
  39998. , A = i[11]
  39999. , C = i[15]
  40000. , I = n[0]
  40001. , E = n[4]
  40002. , _ = n[8]
  40003. , b = n[12]
  40004. , w = n[1]
  40005. , T = n[5]
  40006. , x = n[9]
  40007. , S = n[13]
  40008. , M = n[2]
  40009. , R = n[6]
  40010. , P = n[10]
  40011. , O = n[14]
  40012. , L = n[3]
  40013. , D = n[7]
  40014. , N = n[11]
  40015. , F = n[15];
  40016. return r[0] = o * I + a * w + s * M + l * L,
  40017. r[4] = o * E + a * T + s * R + l * D,
  40018. r[8] = o * _ + a * x + s * P + l * N,
  40019. r[12] = o * b + a * S + s * O + l * F,
  40020. r[1] = c * I + h * w + u * M + d * L,
  40021. r[5] = c * E + h * T + u * R + d * D,
  40022. r[9] = c * _ + h * x + u * P + d * N,
  40023. r[13] = c * b + h * S + u * O + d * F,
  40024. r[2] = p * I + f * w + g * M + m * L,
  40025. r[6] = p * E + f * T + g * R + m * D,
  40026. r[10] = p * _ + f * x + g * P + m * N,
  40027. r[14] = p * b + f * S + g * O + m * F,
  40028. r[3] = v * I + y * w + A * M + C * L,
  40029. r[7] = v * E + y * T + A * R + C * D,
  40030. r[11] = v * _ + y * x + A * P + C * N,
  40031. r[15] = v * b + y * S + A * O + C * F,
  40032. this
  40033. },
  40034. multiplyToArray: function(e, t, i) {
  40035. var n = this.elements;
  40036. return this.multiplyMatrices(e, t),
  40037. i[0] = n[0],
  40038. i[1] = n[1],
  40039. i[2] = n[2],
  40040. i[3] = n[3],
  40041. i[4] = n[4],
  40042. i[5] = n[5],
  40043. i[6] = n[6],
  40044. i[7] = n[7],
  40045. i[8] = n[8],
  40046. i[9] = n[9],
  40047. i[10] = n[10],
  40048. i[11] = n[11],
  40049. i[12] = n[12],
  40050. i[13] = n[13],
  40051. i[14] = n[14],
  40052. i[15] = n[15],
  40053. this
  40054. },
  40055. multiplyScalar: function(e) {
  40056. var t = this.elements;
  40057. return t[0] *= e,
  40058. t[4] *= e,
  40059. t[8] *= e,
  40060. t[12] *= e,
  40061. t[1] *= e,
  40062. t[5] *= e,
  40063. t[9] *= e,
  40064. t[13] *= e,
  40065. t[2] *= e,
  40066. t[6] *= e,
  40067. t[10] *= e,
  40068. t[14] *= e,
  40069. t[3] *= e,
  40070. t[7] *= e,
  40071. t[11] *= e,
  40072. t[15] *= e,
  40073. this
  40074. },
  40075. applyToVector3Array: function(e, t, i) {
  40076. void 0 === re && (re = new Ci.Vector3),
  40077. void 0 === t && (t = 0),
  40078. void 0 === i && (i = e.length);
  40079. for (var n = 0, r = t; n < i; n += 3,
  40080. r += 3)
  40081. re.fromArray(e, r),
  40082. re.applyMatrix4(this),
  40083. re.toArray(e, r);
  40084. return e
  40085. },
  40086. applyToBuffer: function(e, t, i) {
  40087. void 0 === ne && (ne = new Ci.Vector3),
  40088. void 0 === t && (t = 0),
  40089. void 0 === i && (i = e.length / e.itemSize);
  40090. for (var n = 0, r = t; n < i; n++,
  40091. r++)
  40092. ne.x = e.getX(r),
  40093. ne.y = e.getY(r),
  40094. ne.z = e.getZ(r),
  40095. ne.applyMatrix4(this),
  40096. e.setXYZ(ne.x, ne.y, ne.z);
  40097. return e
  40098. },
  40099. determinant: function() {
  40100. var e = this.elements
  40101. , t = e[0]
  40102. , i = e[4]
  40103. , n = e[8]
  40104. , r = e[12]
  40105. , o = e[1]
  40106. , a = e[5]
  40107. , s = e[9]
  40108. , l = e[13]
  40109. , c = e[2]
  40110. , h = e[6]
  40111. , u = e[10]
  40112. , d = e[14];
  40113. 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)
  40114. },
  40115. transpose: function() {
  40116. var e, t = this.elements;
  40117. return e = t[1],
  40118. t[1] = t[4],
  40119. t[4] = e,
  40120. e = t[2],
  40121. t[2] = t[8],
  40122. t[8] = e,
  40123. e = t[6],
  40124. t[6] = t[9],
  40125. t[9] = e,
  40126. e = t[3],
  40127. t[3] = t[12],
  40128. t[12] = e,
  40129. e = t[7],
  40130. t[7] = t[13],
  40131. t[13] = e,
  40132. e = t[11],
  40133. t[11] = t[14],
  40134. t[14] = e,
  40135. this
  40136. },
  40137. flattenToArrayOffset: function(e, t) {
  40138. var i = this.elements;
  40139. return e[t] = i[0],
  40140. e[t + 1] = i[1],
  40141. e[t + 2] = i[2],
  40142. e[t + 3] = i[3],
  40143. e[t + 4] = i[4],
  40144. e[t + 5] = i[5],
  40145. e[t + 6] = i[6],
  40146. e[t + 7] = i[7],
  40147. e[t + 8] = i[8],
  40148. e[t + 9] = i[9],
  40149. e[t + 10] = i[10],
  40150. e[t + 11] = i[11],
  40151. e[t + 12] = i[12],
  40152. e[t + 13] = i[13],
  40153. e[t + 14] = i[14],
  40154. e[t + 15] = i[15],
  40155. e
  40156. },
  40157. getPosition: function() {
  40158. return void 0 === ie && (ie = new Ci.Vector3),
  40159. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40160. ie.setFromMatrixColumn(this, 3)
  40161. },
  40162. setPosition: function(e) {
  40163. var t = this.elements;
  40164. return t[12] = e.x,
  40165. t[13] = e.y,
  40166. t[14] = e.z,
  40167. this
  40168. },
  40169. getInverse: function(e, t) {
  40170. var i = this.elements
  40171. , n = e.elements
  40172. , r = n[0]
  40173. , o = n[1]
  40174. , a = n[2]
  40175. , s = n[3]
  40176. , l = n[4]
  40177. , c = n[5]
  40178. , h = n[6]
  40179. , u = n[7]
  40180. , d = n[8]
  40181. , p = n[9]
  40182. , f = n[10]
  40183. , g = n[11]
  40184. , m = n[12]
  40185. , v = n[13]
  40186. , y = n[14]
  40187. , A = n[15]
  40188. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  40189. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  40190. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  40191. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  40192. , b = r * C + o * I + a * E + s * _;
  40193. if (0 != b)
  40194. return i[0] = C,
  40195. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  40196. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  40197. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40198. i[4] = I,
  40199. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  40200. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  40201. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40202. i[8] = E,
  40203. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  40204. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  40205. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40206. i[12] = _,
  40207. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40208. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40209. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40210. this.multiplyScalar(1 / b);
  40211. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40212. if (t)
  40213. throw new Error(w);
  40214. return console.warn(w),
  40215. this.identity()
  40216. },
  40217. scale: function(e) {
  40218. var t = this.elements
  40219. , i = e.x
  40220. , n = e.y
  40221. , r = e.z;
  40222. return t[0] *= i,
  40223. t[4] *= n,
  40224. t[8] *= r,
  40225. t[1] *= i,
  40226. t[5] *= n,
  40227. t[9] *= r,
  40228. t[2] *= i,
  40229. t[6] *= n,
  40230. t[10] *= r,
  40231. t[3] *= i,
  40232. t[7] *= n,
  40233. t[11] *= r,
  40234. this
  40235. },
  40236. getMaxScaleOnAxis: function() {
  40237. var e = this.elements
  40238. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40239. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40240. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40241. return Math.sqrt(Math.max(t, i, n))
  40242. },
  40243. makeTranslation: function(e, t, i) {
  40244. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40245. this
  40246. },
  40247. makeRotationX: function(e) {
  40248. var t = Math.cos(e)
  40249. , i = Math.sin(e);
  40250. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40251. this
  40252. },
  40253. makeRotationY: function(e) {
  40254. var t = Math.cos(e)
  40255. , i = Math.sin(e);
  40256. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40257. this
  40258. },
  40259. makeRotationZ: function(e) {
  40260. var t = Math.cos(e)
  40261. , i = Math.sin(e);
  40262. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40263. this
  40264. },
  40265. makeRotationAxis: function(e, t) {
  40266. var i = Math.cos(t)
  40267. , n = Math.sin(t)
  40268. , r = 1 - i
  40269. , o = e.x
  40270. , a = e.y
  40271. , s = e.z
  40272. , l = r * o
  40273. , c = r * a;
  40274. 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),
  40275. this
  40276. },
  40277. makeScale: function(e, t, i) {
  40278. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40279. this
  40280. },
  40281. compose: function(e, t, i) {
  40282. return this.makeRotationFromQuaternion(t),
  40283. this.scale(i),
  40284. this.setPosition(e),
  40285. this
  40286. },
  40287. decompose: function(e, t, i) {
  40288. void 0 === ee && (ee = new Ci.Vector3),
  40289. void 0 === te && (te = new Ci.Matrix4);
  40290. var n = this.elements
  40291. , r = ee.set(n[0], n[1], n[2]).length()
  40292. , o = ee.set(n[4], n[5], n[6]).length()
  40293. , a = ee.set(n[8], n[9], n[10]).length();
  40294. this.determinant() < 0 && (r = -r),
  40295. e.x = n[12],
  40296. e.y = n[13],
  40297. e.z = n[14],
  40298. te.elements.set(this.elements);
  40299. var s = 1 / r
  40300. , l = 1 / o
  40301. , c = 1 / a;
  40302. return te.elements[0] *= s,
  40303. te.elements[1] *= s,
  40304. te.elements[2] *= s,
  40305. te.elements[4] *= l,
  40306. te.elements[5] *= l,
  40307. te.elements[6] *= l,
  40308. te.elements[8] *= c,
  40309. te.elements[9] *= c,
  40310. te.elements[10] *= c,
  40311. t.setFromRotationMatrix(te),
  40312. i.x = r,
  40313. i.y = o,
  40314. i.z = a,
  40315. this
  40316. },
  40317. makeFrustum: function(e, t, i, n, r, o) {
  40318. var a = this.elements
  40319. , s = 2 * r / (t - e)
  40320. , l = 2 * r / (n - i)
  40321. , c = (t + e) / (t - e)
  40322. , h = (n + i) / (n - i)
  40323. , u = -(o + r) / (o - r)
  40324. , d = -2 * o * r / (o - r);
  40325. return a[0] = s,
  40326. a[4] = 0,
  40327. a[8] = c,
  40328. a[12] = 0,
  40329. a[1] = 0,
  40330. a[5] = l,
  40331. a[9] = h,
  40332. a[13] = 0,
  40333. a[2] = 0,
  40334. a[6] = 0,
  40335. a[10] = u,
  40336. a[14] = d,
  40337. a[3] = 0,
  40338. a[7] = 0,
  40339. a[11] = -1,
  40340. a[15] = 0,
  40341. this
  40342. },
  40343. makePerspective: function(e, t, i, n) {
  40344. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40345. , o = -r
  40346. , a = o * t
  40347. , s = r * t;
  40348. return this.makeFrustum(a, s, o, r, i, n)
  40349. },
  40350. makeOrthographic: function(e, t, i, n, r, o) {
  40351. var a = this.elements
  40352. , s = 1 / (t - e)
  40353. , l = 1 / (i - n)
  40354. , c = 1 / (o - r)
  40355. , h = (t + e) * s
  40356. , u = (i + n) * l
  40357. , d = (o + r) * c;
  40358. return a[0] = 2 * s,
  40359. a[4] = 0,
  40360. a[8] = 0,
  40361. a[12] = -h,
  40362. a[1] = 0,
  40363. a[5] = 2 * l,
  40364. a[9] = 0,
  40365. a[13] = -u,
  40366. a[2] = 0,
  40367. a[6] = 0,
  40368. a[10] = -2 * c,
  40369. a[14] = -d,
  40370. a[3] = 0,
  40371. a[7] = 0,
  40372. a[11] = 0,
  40373. a[15] = 1,
  40374. this
  40375. },
  40376. equals: function(e) {
  40377. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40378. if (t[n] !== i[n])
  40379. return !1;
  40380. return !0
  40381. },
  40382. fromArray: function(e) {
  40383. return this.elements.set(e),
  40384. this
  40385. },
  40386. toArray: function() {
  40387. var e = this.elements;
  40388. 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]]
  40389. }
  40390. },
  40391. Ci.Ray = function(e, t) {
  40392. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40393. this.direction = void 0 !== t ? t : new Ci.Vector3
  40394. }
  40395. ,
  40396. Ci.Ray.prototype = {
  40397. constructor: Ci.Ray,
  40398. set: function(e, t) {
  40399. return this.origin.copy(e),
  40400. this.direction.copy(t),
  40401. this
  40402. },
  40403. clone: function() {
  40404. return (new this.constructor).copy(this)
  40405. },
  40406. copy: function(e) {
  40407. return this.origin.copy(e.origin),
  40408. this.direction.copy(e.direction),
  40409. this
  40410. },
  40411. at: function(e, t) {
  40412. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40413. },
  40414. lookAt: function(e) {
  40415. this.direction.copy(e).sub(this.origin).normalize()
  40416. },
  40417. recast: ($ = new Ci.Vector3,
  40418. function(e) {
  40419. return this.origin.copy(this.at(e, $)),
  40420. this
  40421. }
  40422. ),
  40423. closestPointToPoint: function(e, t) {
  40424. var i = t || new Ci.Vector3;
  40425. i.subVectors(e, this.origin);
  40426. var n = i.dot(this.direction);
  40427. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40428. },
  40429. distanceToPoint: function(e) {
  40430. return Math.sqrt(this.distanceSqToPoint(e))
  40431. },
  40432. distanceSqToPoint: (J = new Ci.Vector3,
  40433. function(e) {
  40434. var t = J.subVectors(e, this.origin).dot(this.direction);
  40435. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40436. J.distanceToSquared(e))
  40437. }
  40438. ),
  40439. distanceSqToSegment: (Z = new Ci.Vector3,
  40440. K = new Ci.Vector3,
  40441. Q = new Ci.Vector3,
  40442. function(e, t, i, n) {
  40443. Z.copy(e).add(t).multiplyScalar(.5),
  40444. K.copy(t).sub(e).normalize(),
  40445. Q.copy(this.origin).sub(Z);
  40446. 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);
  40447. if (0 < p)
  40448. if (o = c * h - u,
  40449. s = l * p,
  40450. 0 <= (r = c * u - h))
  40451. if (-s <= o)
  40452. if (o <= s) {
  40453. var f = 1 / p;
  40454. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40455. } else
  40456. o = l,
  40457. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40458. else
  40459. o = -l,
  40460. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40461. else
  40462. 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,
  40463. (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;
  40464. else
  40465. o = 0 < c ? -l : l,
  40466. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40467. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40468. n && n.copy(K).multiplyScalar(o).add(Z),
  40469. a
  40470. }
  40471. ),
  40472. intersectSphere: (X = new Ci.Vector3,
  40473. function(e, t) {
  40474. X.subVectors(e.center, this.origin);
  40475. var i = X.dot(this.direction)
  40476. , n = X.dot(X) - i * i
  40477. , r = e.radius * e.radius;
  40478. if (r < n)
  40479. return null;
  40480. var o = Math.sqrt(r - n)
  40481. , a = i - o
  40482. , s = i + o;
  40483. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40484. }
  40485. ),
  40486. intersectsSphere: function(e) {
  40487. return this.distanceToPoint(e.center) <= e.radius
  40488. },
  40489. distanceToPlane: function(e) {
  40490. var t = e.normal.dot(this.direction);
  40491. if (0 === t)
  40492. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40493. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40494. return 0 <= i ? i : null
  40495. },
  40496. intersectPlane: function(e, t) {
  40497. var i = this.distanceToPlane(e);
  40498. return null === i ? null : this.at(i, t)
  40499. },
  40500. intersectsPlane: function(e) {
  40501. var t = e.distanceToPoint(this.origin);
  40502. return 0 === t || e.normal.dot(this.direction) * t < 0
  40503. },
  40504. intersectBox: function(e, t) {
  40505. 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;
  40506. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40507. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40508. (e.min.x - u.x) * l),
  40509. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40510. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40511. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40512. (o < n || n != n) && (n = o),
  40513. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40514. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40515. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40516. (s < n || n != n) && (n = s),
  40517. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40518. },
  40519. intersectsBox: (q = new Ci.Vector3,
  40520. function(e) {
  40521. return null !== this.intersectBox(e, q)
  40522. }
  40523. ),
  40524. intersectTriangle: (G = new Ci.Vector3,
  40525. W = new Ci.Vector3,
  40526. j = new Ci.Vector3,
  40527. Y = new Ci.Vector3,
  40528. function(e, t, i, n, r) {
  40529. W.subVectors(t, e),
  40530. j.subVectors(i, e),
  40531. Y.crossVectors(W, j);
  40532. var o, a = this.direction.dot(Y);
  40533. if (0 < a) {
  40534. if (n)
  40535. return null;
  40536. o = 1
  40537. } else {
  40538. if (!(a < 0))
  40539. return null;
  40540. o = -1,
  40541. a = -a
  40542. }
  40543. G.subVectors(this.origin, e);
  40544. var s = o * this.direction.dot(j.crossVectors(G, j));
  40545. if (s < 0)
  40546. return null;
  40547. var l = o * this.direction.dot(W.cross(G));
  40548. if (l < 0)
  40549. return null;
  40550. if (a < s + l)
  40551. return null;
  40552. var c = -o * G.dot(Y);
  40553. return c < 0 ? null : this.at(c / a, r)
  40554. }
  40555. ),
  40556. applyMatrix4: function(e) {
  40557. return this.direction.add(this.origin).applyMatrix4(e),
  40558. this.origin.applyMatrix4(e),
  40559. this.direction.sub(this.origin),
  40560. this.direction.normalize(),
  40561. this
  40562. },
  40563. equals: function(e) {
  40564. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40565. }
  40566. },
  40567. Ci.Sphere = function(e, t) {
  40568. this.center = void 0 !== e ? e : new Ci.Vector3,
  40569. this.radius = void 0 !== t ? t : 0
  40570. }
  40571. ,
  40572. Ci.Sphere.prototype = {
  40573. constructor: Ci.Sphere,
  40574. set: function(e, t) {
  40575. return this.center.copy(e),
  40576. this.radius = t,
  40577. this
  40578. },
  40579. setFromPoints: (z = new Ci.Box3,
  40580. function(e, t) {
  40581. var i = this.center;
  40582. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40583. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40584. n = Math.max(n, i.distanceToSquared(e[r]));
  40585. return this.radius = Math.sqrt(n),
  40586. this
  40587. }
  40588. ),
  40589. clone: function() {
  40590. return (new this.constructor).copy(this)
  40591. },
  40592. copy: function(e) {
  40593. return this.center.copy(e.center),
  40594. this.radius = e.radius,
  40595. this
  40596. },
  40597. empty: function() {
  40598. return this.radius <= 0
  40599. },
  40600. containsPoint: function(e) {
  40601. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40602. },
  40603. distanceToPoint: function(e) {
  40604. return e.distanceTo(this.center) - this.radius
  40605. },
  40606. intersectsSphere: function(e) {
  40607. var t = this.radius + e.radius;
  40608. return e.center.distanceToSquared(this.center) <= t * t
  40609. },
  40610. intersectsBox: function(e) {
  40611. return e.intersectsSphere(this)
  40612. },
  40613. intersectsPlane: function(e) {
  40614. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40615. },
  40616. clampPoint: function(e, t) {
  40617. var i = this.center.distanceToSquared(e)
  40618. , n = t || new Ci.Vector3;
  40619. return n.copy(e),
  40620. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40621. n.multiplyScalar(this.radius).add(this.center)),
  40622. n
  40623. },
  40624. getBoundingBox: function(e) {
  40625. var t = e || new Ci.Box3;
  40626. return t.set(this.center, this.center),
  40627. t.expandByScalar(this.radius),
  40628. t
  40629. },
  40630. applyMatrix4: function(e) {
  40631. return this.center.applyMatrix4(e),
  40632. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40633. this
  40634. },
  40635. translate: function(e) {
  40636. return this.center.add(e),
  40637. this
  40638. },
  40639. equals: function(e) {
  40640. return e.center.equals(this.center) && e.radius === this.radius
  40641. }
  40642. },
  40643. Ci.Frustum = function(e, t, i, n, r, o) {
  40644. 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]
  40645. }
  40646. ,
  40647. Ci.Frustum.prototype = {
  40648. constructor: Ci.Frustum,
  40649. set: function(e, t, i, n, r, o) {
  40650. var a = this.planes;
  40651. return a[0].copy(e),
  40652. a[1].copy(t),
  40653. a[2].copy(i),
  40654. a[3].copy(n),
  40655. a[4].copy(r),
  40656. a[5].copy(o),
  40657. this
  40658. },
  40659. clone: function() {
  40660. return (new this.constructor).copy(this)
  40661. },
  40662. copy: function(e) {
  40663. for (var t = this.planes, i = 0; i < 6; i++)
  40664. t[i].copy(e.planes[i]);
  40665. return this
  40666. },
  40667. setFromMatrix: function(e) {
  40668. var t = this.planes
  40669. , i = e.elements
  40670. , n = i[0]
  40671. , r = i[1]
  40672. , o = i[2]
  40673. , a = i[3]
  40674. , s = i[4]
  40675. , l = i[5]
  40676. , c = i[6]
  40677. , h = i[7]
  40678. , u = i[8]
  40679. , d = i[9]
  40680. , p = i[10]
  40681. , f = i[11]
  40682. , g = i[12]
  40683. , m = i[13]
  40684. , v = i[14]
  40685. , y = i[15];
  40686. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40687. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40688. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40689. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40690. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40691. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40692. this
  40693. },
  40694. intersectsObject: (H = new Ci.Sphere,
  40695. function(e) {
  40696. var t = e.geometry;
  40697. return null === t.boundingSphere && t.computeBoundingSphere(),
  40698. H.copy(t.boundingSphere),
  40699. H.applyMatrix4(e.matrixWorld),
  40700. this.intersectsSphere(H)
  40701. }
  40702. ),
  40703. intersectsSphere: function(e) {
  40704. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40705. if (t[r].distanceToPoint(i) < n)
  40706. return !1
  40707. }
  40708. return !0
  40709. },
  40710. intersectsBox: (k = new Ci.Vector3,
  40711. U = new Ci.Vector3,
  40712. function(e) {
  40713. for (var t = this.planes, i = 0; i < 6; i++) {
  40714. var n = t[i];
  40715. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40716. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40717. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40718. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40719. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40720. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40721. var r = n.distanceToPoint(k)
  40722. , o = n.distanceToPoint(U);
  40723. if (r < 0 && o < 0)
  40724. return !1
  40725. }
  40726. return !0
  40727. }
  40728. ),
  40729. containsPoint: function(e) {
  40730. for (var t = this.planes, i = 0; i < 6; i++)
  40731. if (t[i].distanceToPoint(e) < 0)
  40732. return !1;
  40733. return !0
  40734. }
  40735. },
  40736. Ci.Plane = function(e, t) {
  40737. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40738. this.constant = void 0 !== t ? t : 0
  40739. }
  40740. ,
  40741. Ci.Plane.prototype = {
  40742. constructor: Ci.Plane,
  40743. set: function(e, t) {
  40744. return this.normal.copy(e),
  40745. this.constant = t,
  40746. this
  40747. },
  40748. setComponents: function(e, t, i, n) {
  40749. return this.normal.set(e, t, i),
  40750. this.constant = n,
  40751. this
  40752. },
  40753. setFromNormalAndCoplanarPoint: function(e, t) {
  40754. return this.normal.copy(e),
  40755. this.constant = -t.dot(this.normal),
  40756. this
  40757. },
  40758. setFromCoplanarPoints: (B = new Ci.Vector3,
  40759. V = new Ci.Vector3,
  40760. function(e, t, i) {
  40761. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40762. return this.setFromNormalAndCoplanarPoint(n, e),
  40763. this
  40764. }
  40765. ),
  40766. clone: function() {
  40767. return (new this.constructor).copy(this)
  40768. },
  40769. copy: function(e) {
  40770. return this.normal.copy(e.normal),
  40771. this.constant = e.constant,
  40772. this
  40773. },
  40774. normalize: function() {
  40775. var e = 1 / this.normal.length();
  40776. return this.normal.multiplyScalar(e),
  40777. this.constant *= e,
  40778. this
  40779. },
  40780. negate: function() {
  40781. return this.constant *= -1,
  40782. this.normal.negate(),
  40783. this
  40784. },
  40785. distanceToPoint: function(e) {
  40786. return this.normal.dot(e) + this.constant
  40787. },
  40788. distanceToSphere: function(e) {
  40789. return this.distanceToPoint(e.center) - e.radius
  40790. },
  40791. projectPoint: function(e, t) {
  40792. return this.orthoPoint(e, t).sub(e).negate()
  40793. },
  40794. orthoPoint: function(e, t) {
  40795. var i = this.distanceToPoint(e);
  40796. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40797. },
  40798. intersectLine: (F = new Ci.Vector3,
  40799. function(e, t) {
  40800. var i = t || new Ci.Vector3
  40801. , n = e.delta(F)
  40802. , r = this.normal.dot(n);
  40803. if (0 !== r) {
  40804. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40805. if (!(o < 0 || 1 < o))
  40806. return i.copy(n).multiplyScalar(o).add(e.start)
  40807. } else if (0 === this.distanceToPoint(e.start))
  40808. return i.copy(e.start)
  40809. }
  40810. ),
  40811. intersectsLine: function(e) {
  40812. var t = this.distanceToPoint(e.start)
  40813. , i = this.distanceToPoint(e.end);
  40814. return t < 0 && 0 < i || i < 0 && 0 < t
  40815. },
  40816. intersectsBox: function(e) {
  40817. return e.intersectsPlane(this)
  40818. },
  40819. intersectsSphere: function(e) {
  40820. return e.intersectsPlane(this)
  40821. },
  40822. coplanarPoint: function(e) {
  40823. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40824. },
  40825. applyMatrix4: (L = new Ci.Vector3,
  40826. D = new Ci.Vector3,
  40827. N = new Ci.Matrix3,
  40828. function(e, t) {
  40829. var i = t || N.getNormalMatrix(e)
  40830. , n = L.copy(this.normal).applyMatrix3(i)
  40831. , r = this.coplanarPoint(D);
  40832. return r.applyMatrix4(e),
  40833. this.setFromNormalAndCoplanarPoint(n, r),
  40834. this
  40835. }
  40836. ),
  40837. translate: function(e) {
  40838. return this.constant = this.constant - e.dot(this.normal),
  40839. this
  40840. },
  40841. equals: function(e) {
  40842. return e.normal.equals(this.normal) && e.constant === this.constant
  40843. }
  40844. },
  40845. Ci.Spherical = function(e, t, i) {
  40846. return this.radius = void 0 !== e ? e : 1,
  40847. this.phi = void 0 !== t ? t : 0,
  40848. this.theta = void 0 !== i ? i : 0,
  40849. this
  40850. }
  40851. ,
  40852. Ci.Spherical.prototype = {
  40853. constructor: Ci.Spherical,
  40854. set: function(e, t, i) {
  40855. this.radius = e,
  40856. this.phi = t,
  40857. this.theta = i
  40858. },
  40859. clone: function() {
  40860. return (new this.constructor).copy(this)
  40861. },
  40862. copy: function(e) {
  40863. return this.radius.copy(e.radius),
  40864. this.phi.copy(e.phi),
  40865. this.theta.copy(e.theta),
  40866. this
  40867. },
  40868. makeSafe: function() {
  40869. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40870. },
  40871. setFromVector3: function(e) {
  40872. return this.radius = e.length(),
  40873. 0 === this.radius ? (this.theta = 0,
  40874. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40875. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40876. this
  40877. }
  40878. },
  40879. Ci.Math = {
  40880. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40881. P = new Array(36),
  40882. O = 0,
  40883. function() {
  40884. for (var e = 0; e < 36; e++)
  40885. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40886. M = 15 & O,
  40887. O >>= 4,
  40888. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40889. return P.join("")
  40890. }
  40891. ),
  40892. clamp: function(e, t, i) {
  40893. return Math.max(t, Math.min(i, e))
  40894. },
  40895. euclideanModulo: function(e, t) {
  40896. return (e % t + t) % t
  40897. },
  40898. mapLinear: function(e, t, i, n, r) {
  40899. return n + (e - t) * (r - n) / (i - t)
  40900. },
  40901. smoothstep: function(e, t, i) {
  40902. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40903. },
  40904. smootherstep: function(e, t, i) {
  40905. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40906. },
  40907. random16: function() {
  40908. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40909. Math.random()
  40910. },
  40911. randInt: function(e, t) {
  40912. return e + Math.floor(Math.random() * (t - e + 1))
  40913. },
  40914. randFloat: function(e, t) {
  40915. return e + Math.random() * (t - e)
  40916. },
  40917. randFloatSpread: function(e) {
  40918. return e * (.5 - Math.random())
  40919. },
  40920. degToRad: (S = Math.PI / 180,
  40921. function(e) {
  40922. return e * S
  40923. }
  40924. ),
  40925. radToDeg: (x = 180 / Math.PI,
  40926. function(e) {
  40927. return e * x
  40928. }
  40929. ),
  40930. isPowerOfTwo: function(e) {
  40931. return 0 == (e & e - 1) && 0 !== e
  40932. },
  40933. nearestPowerOfTwo: function(e) {
  40934. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40935. },
  40936. nextPowerOfTwo: function(e) {
  40937. return e--,
  40938. e |= e >> 1,
  40939. e |= e >> 2,
  40940. e |= e >> 4,
  40941. e |= e >> 8,
  40942. e |= e >> 16,
  40943. ++e
  40944. }
  40945. },
  40946. Ci.Spline = function(e) {
  40947. function t(e, t, i, n, r, o, a) {
  40948. var s = .5 * (i - e)
  40949. , l = .5 * (n - t);
  40950. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40951. }
  40952. this.points = e;
  40953. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40954. x: 0,
  40955. y: 0,
  40956. z: 0
  40957. };
  40958. this.initFromArray = function(e) {
  40959. this.points = [];
  40960. for (var t = 0; t < e.length; t++)
  40961. this.points[t] = {
  40962. x: e[t][0],
  40963. y: e[t][1],
  40964. z: e[t][2]
  40965. }
  40966. }
  40967. ,
  40968. this.getPoint = function(e) {
  40969. return i = (this.points.length - 1) * e,
  40970. n = Math.floor(i),
  40971. r = i - n,
  40972. u[0] = 0 === n ? n : n - 1,
  40973. u[1] = n,
  40974. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40975. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40976. s = this.points[u[0]],
  40977. l = this.points[u[1]],
  40978. c = this.points[u[2]],
  40979. h = this.points[u[3]],
  40980. a = r * (o = r * r),
  40981. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40982. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40983. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40984. d
  40985. }
  40986. ,
  40987. this.getControlPointsArray = function() {
  40988. var e, t, i = this.points.length, n = [];
  40989. for (e = 0; e < i; e++)
  40990. t = this.points[e],
  40991. n[e] = [t.x, t.y, t.z];
  40992. return n
  40993. }
  40994. ,
  40995. this.getLength = function(e) {
  40996. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40997. for (h[0] = 0,
  40998. e = e || 100,
  40999. n = this.points.length * e,
  41000. l.copy(this.points[0]),
  41001. t = 1; t < n; t++)
  41002. i = t / n,
  41003. r = this.getPoint(i),
  41004. c.copy(r),
  41005. u += c.distanceTo(l),
  41006. l.copy(r),
  41007. o = (this.points.length - 1) * i,
  41008. (a = Math.floor(o)) !== s && (h[a] = u,
  41009. s = a);
  41010. return h[h.length] = u,
  41011. {
  41012. chunks: h,
  41013. total: u
  41014. }
  41015. }
  41016. ,
  41017. this.reparametrizeByArcLength = function(e) {
  41018. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  41019. for (c.push(h.copy(this.points[0]).clone()),
  41020. t = 1; t < this.points.length; t++) {
  41021. for (a = u.chunks[t] - u.chunks[t - 1],
  41022. s = Math.ceil(e * a / u.total),
  41023. r = (t - 1) / (this.points.length - 1),
  41024. o = t / (this.points.length - 1),
  41025. i = 1; i < s - 1; i++)
  41026. n = r + i * (1 / s) * (o - r),
  41027. l = this.getPoint(n),
  41028. c.push(h.copy(l).clone());
  41029. c.push(h.copy(this.points[t]).clone())
  41030. }
  41031. this.points = c
  41032. }
  41033. }
  41034. ,
  41035. Ci.Triangle = function(e, t, i) {
  41036. this.a = void 0 !== e ? e : new Ci.Vector3,
  41037. this.b = void 0 !== t ? t : new Ci.Vector3,
  41038. this.c = void 0 !== i ? i : new Ci.Vector3
  41039. }
  41040. ,
  41041. Ci.Triangle.normal = (T = new Ci.Vector3,
  41042. function(e, t, i, n) {
  41043. var r = n || new Ci.Vector3;
  41044. r.subVectors(i, t),
  41045. T.subVectors(e, t),
  41046. r.cross(T);
  41047. var o = r.lengthSq();
  41048. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  41049. }
  41050. ),
  41051. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  41052. b = new Ci.Vector3,
  41053. w = new Ci.Vector3,
  41054. function(e, t, i, n, r) {
  41055. _.subVectors(n, t),
  41056. b.subVectors(i, t),
  41057. w.subVectors(e, t);
  41058. var o = _.dot(_)
  41059. , a = _.dot(b)
  41060. , s = _.dot(w)
  41061. , l = b.dot(b)
  41062. , c = b.dot(w)
  41063. , h = o * l - a * a
  41064. , u = r || new Ci.Vector3;
  41065. if (0 == h)
  41066. return u.set(-2, -1, -1);
  41067. var d = 1 / h
  41068. , p = (l * s - a * c) * d
  41069. , f = (o * c - a * s) * d;
  41070. return u.set(1 - p - f, f, p)
  41071. }
  41072. ),
  41073. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  41074. function(e, t, i, n) {
  41075. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  41076. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  41077. }
  41078. ),
  41079. Ci.Triangle.prototype = {
  41080. constructor: Ci.Triangle,
  41081. set: function(e, t, i) {
  41082. return this.a.copy(e),
  41083. this.b.copy(t),
  41084. this.c.copy(i),
  41085. this
  41086. },
  41087. setFromPointsAndIndices: function(e, t, i, n) {
  41088. return this.a.copy(e[t]),
  41089. this.b.copy(e[i]),
  41090. this.c.copy(e[n]),
  41091. this
  41092. },
  41093. clone: function() {
  41094. return (new this.constructor).copy(this)
  41095. },
  41096. copy: function(e) {
  41097. return this.a.copy(e.a),
  41098. this.b.copy(e.b),
  41099. this.c.copy(e.c),
  41100. this
  41101. },
  41102. area: (C = new Ci.Vector3,
  41103. I = new Ci.Vector3,
  41104. function() {
  41105. return C.subVectors(this.c, this.b),
  41106. I.subVectors(this.a, this.b),
  41107. .5 * C.cross(I).length()
  41108. }
  41109. ),
  41110. midpoint: function(e) {
  41111. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41112. },
  41113. normal: function(e) {
  41114. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  41115. },
  41116. plane: function(e) {
  41117. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  41118. },
  41119. barycoordFromPoint: function(e, t) {
  41120. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41121. },
  41122. containsPoint: function(e) {
  41123. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  41124. },
  41125. equals: function(e) {
  41126. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41127. }
  41128. },
  41129. Ci.Interpolant = function(e, t, i, n) {
  41130. this.parameterPositions = e,
  41131. this._cachedIndex = 0,
  41132. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41133. this.sampleValues = t,
  41134. this.valueSize = i
  41135. }
  41136. ,
  41137. Ci.Interpolant.prototype = {
  41138. constructor: Ci.Interpolant,
  41139. evaluate: function(e) {
  41140. var t = this.parameterPositions
  41141. , i = this._cachedIndex
  41142. , n = t[i]
  41143. , r = t[i - 1];
  41144. e: {
  41145. t: {
  41146. var o;
  41147. i: {
  41148. n: if (!(e < n)) {
  41149. for (var a = i + 2; ; ) {
  41150. if (void 0 === n) {
  41151. if (e < r)
  41152. break n;
  41153. return i = t.length,
  41154. this._cachedIndex = i,
  41155. this.afterEnd_(i - 1, e, r)
  41156. }
  41157. if (i === a)
  41158. break;
  41159. if (r = n,
  41160. e < (n = t[++i]))
  41161. break t
  41162. }
  41163. o = t.length;
  41164. break i
  41165. }
  41166. if (r <= e)
  41167. break e;
  41168. var s = t[1];
  41169. e < s && (i = 2,
  41170. r = s);
  41171. for (a = i - 2; ; ) {
  41172. if (void 0 === r)
  41173. return this._cachedIndex = 0,
  41174. this.beforeStart_(0, e, n);
  41175. if (i === a)
  41176. break;
  41177. if (n = r,
  41178. (r = t[--i - 1]) <= e)
  41179. break t
  41180. }
  41181. o = i,
  41182. i = 0
  41183. }
  41184. for (; i < o; ) {
  41185. var l = i + o >>> 1;
  41186. e < t[l] ? o = l : i = 1 + l
  41187. }
  41188. if (n = t[i],
  41189. void 0 === (r = t[i - 1]))
  41190. return this._cachedIndex = 0,
  41191. this.beforeStart_(0, e, n);
  41192. if (void 0 === n)
  41193. return i = t.length,
  41194. this._cachedIndex = i,
  41195. this.afterEnd_(i - 1, r, e)
  41196. }
  41197. this._cachedIndex = i,
  41198. this.intervalChanged_(i, r, n)
  41199. }
  41200. return this.interpolate_(i, r, e, n)
  41201. },
  41202. settings: null,
  41203. DefaultSettings_: {},
  41204. getSettings_: function() {
  41205. return this.settings || this.DefaultSettings_
  41206. },
  41207. copySampleValue_: function(e) {
  41208. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41209. t[o] = i[r + o];
  41210. return t
  41211. },
  41212. interpolate_: function(e, t, i, n) {
  41213. throw new Error("call to abstract method")
  41214. },
  41215. intervalChanged_: function(e, t, i) {}
  41216. },
  41217. Object.assign(Ci.Interpolant.prototype, {
  41218. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41219. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41220. }),
  41221. Ci.CubicInterpolant = function(e, t, i, n) {
  41222. Ci.Interpolant.call(this, e, t, i, n),
  41223. this._weightPrev = -0,
  41224. this._offsetPrev = -0,
  41225. this._weightNext = -0,
  41226. this._offsetNext = -0
  41227. }
  41228. ,
  41229. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41230. constructor: Ci.CubicInterpolant,
  41231. DefaultSettings_: {
  41232. endingStart: Ci.ZeroCurvatureEnding,
  41233. endingEnd: Ci.ZeroCurvatureEnding
  41234. },
  41235. intervalChanged_: function(e, t, i) {
  41236. var n = this.parameterPositions
  41237. , r = e - 2
  41238. , o = e + 1
  41239. , a = n[r]
  41240. , s = n[o];
  41241. if (void 0 === a)
  41242. switch (this.getSettings_().endingStart) {
  41243. case Ci.ZeroSlopeEnding:
  41244. r = e,
  41245. a = 2 * t - i;
  41246. break;
  41247. case Ci.WrapAroundEnding:
  41248. a = t + n[r = n.length - 2] - n[r + 1];
  41249. break;
  41250. default:
  41251. r = e,
  41252. a = i
  41253. }
  41254. if (void 0 === s)
  41255. switch (this.getSettings_().endingEnd) {
  41256. case Ci.ZeroSlopeEnding:
  41257. o = e,
  41258. s = 2 * i - t;
  41259. break;
  41260. case Ci.WrapAroundEnding:
  41261. s = i + n[o = 1] - n[0];
  41262. break;
  41263. default:
  41264. o = e - 1,
  41265. s = t
  41266. }
  41267. var l = .5 * (i - t)
  41268. , c = this.valueSize;
  41269. this._weightPrev = l / (t - a),
  41270. this._weightNext = l / (s - i),
  41271. this._offsetPrev = r * c,
  41272. this._offsetNext = o * c
  41273. },
  41274. interpolate_: function(e, t, i, n) {
  41275. 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)
  41276. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41277. return r
  41278. }
  41279. }),
  41280. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41281. Ci.Interpolant.call(this, e, t, i, n)
  41282. }
  41283. ,
  41284. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41285. constructor: Ci.DiscreteInterpolant,
  41286. interpolate_: function(e, t, i, n) {
  41287. return this.copySampleValue_(e - 1)
  41288. }
  41289. }),
  41290. Ci.LinearInterpolant = function(e, t, i, n) {
  41291. Ci.Interpolant.call(this, e, t, i, n)
  41292. }
  41293. ,
  41294. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41295. constructor: Ci.LinearInterpolant,
  41296. interpolate_: function(e, t, i, n) {
  41297. 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)
  41298. r[u] = o[l + u] * h + o[s + u] * c;
  41299. return r
  41300. }
  41301. }),
  41302. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41303. Ci.Interpolant.call(this, e, t, i, n)
  41304. }
  41305. ,
  41306. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41307. constructor: Ci.QuaternionLinearInterpolant,
  41308. interpolate_: function(e, t, i, n) {
  41309. 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)
  41310. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41311. return r
  41312. }
  41313. }),
  41314. Ci.Clock = function(e) {
  41315. this.autoStart = void 0 === e || e,
  41316. this.startTime = 0,
  41317. this.oldTime = 0,
  41318. this.elapsedTime = 0,
  41319. this.running = !1
  41320. }
  41321. ,
  41322. Ci.Clock.prototype = {
  41323. constructor: Ci.Clock,
  41324. start: function() {
  41325. this.startTime = performance.now(),
  41326. this.oldTime = this.startTime,
  41327. this.running = !0
  41328. },
  41329. stop: function() {
  41330. this.getElapsedTime(),
  41331. this.running = !1
  41332. },
  41333. getElapsedTime: function() {
  41334. return this.getDelta(),
  41335. this.elapsedTime
  41336. },
  41337. getDelta: function() {
  41338. var e = 0;
  41339. if (this.autoStart && !this.running && this.start(),
  41340. this.running) {
  41341. var t = performance.now();
  41342. e = .001 * (t - this.oldTime),
  41343. this.oldTime = t,
  41344. this.elapsedTime += e
  41345. }
  41346. return e
  41347. }
  41348. },
  41349. Ci.EventDispatcher = function() {}
  41350. ,
  41351. Ci.EventDispatcher.prototype = {
  41352. constructor: Ci.EventDispatcher,
  41353. apply: function(e) {
  41354. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41355. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41356. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41357. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41358. },
  41359. addEventListener: function(e, t) {
  41360. void 0 === this._listeners && (this._listeners = {});
  41361. var i = this._listeners;
  41362. void 0 === i[e] && (i[e] = []),
  41363. -1 === i[e].indexOf(t) && i[e].push(t)
  41364. },
  41365. hasEventListener: function(e, t) {
  41366. if (void 0 === this._listeners)
  41367. return !1;
  41368. var i = this._listeners;
  41369. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41370. },
  41371. removeEventListener: function(e, t) {
  41372. if (void 0 !== this._listeners) {
  41373. var i = this._listeners[e];
  41374. if (void 0 !== i) {
  41375. var n = i.indexOf(t);
  41376. -1 !== n && i.splice(n, 1)
  41377. }
  41378. }
  41379. },
  41380. dispatchEvent: function(e) {
  41381. if (void 0 !== this._listeners) {
  41382. var t = this._listeners[e.type];
  41383. if (void 0 !== t) {
  41384. e.target = this;
  41385. for (var i = [], n = t.length, r = 0; r < n; r++)
  41386. i[r] = t[r];
  41387. for (r = 0; r < n; r++)
  41388. i[r].call(this, e)
  41389. }
  41390. }
  41391. }
  41392. },
  41393. Ci.Layers = function() {
  41394. this.mask = 1
  41395. }
  41396. ,
  41397. Ci.Layers.prototype = {
  41398. constructor: Ci.Layers,
  41399. set: function(e) {
  41400. this.mask = 1 << e
  41401. },
  41402. enable: function(e) {
  41403. this.mask |= 1 << e
  41404. },
  41405. toggle: function(e) {
  41406. this.mask ^= 1 << e
  41407. },
  41408. disable: function(e) {
  41409. this.mask &= ~(1 << e)
  41410. },
  41411. test: function(e) {
  41412. return 0 != (this.mask & e.mask)
  41413. }
  41414. },
  41415. (A = Ci).Raycaster = function(e, t, i, n) {
  41416. this.ray = new A.Ray(e,t),
  41417. this.near = i || 0,
  41418. this.far = n || 1 / 0,
  41419. this.params = {
  41420. Mesh: {},
  41421. Line: {},
  41422. LOD: {},
  41423. Points: {
  41424. threshold: 1
  41425. },
  41426. Sprite: {}
  41427. },
  41428. Object.defineProperties(this.params, {
  41429. PointCloud: {
  41430. get: function() {
  41431. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41432. this.Points
  41433. }
  41434. }
  41435. })
  41436. }
  41437. ,
  41438. A.Raycaster.prototype = {
  41439. constructor: A.Raycaster,
  41440. linePrecision: 1,
  41441. set: function(e, t) {
  41442. this.ray.set(e, t)
  41443. },
  41444. setFromCamera: function(e, t) {
  41445. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41446. 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),
  41447. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41448. },
  41449. intersectObject: function(e, t) {
  41450. var i = [];
  41451. return Ei(e, this, i, t),
  41452. i.sort(Ii),
  41453. i
  41454. },
  41455. intersectObjects: function(e, t) {
  41456. var i = [];
  41457. if (!1 === Array.isArray(e))
  41458. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41459. i;
  41460. for (var n = 0, r = e.length; n < r; n++)
  41461. Ei(e[n], this, i, t);
  41462. return i.sort(Ii),
  41463. i
  41464. }
  41465. },
  41466. Ci.Object3D = function() {
  41467. Object.defineProperty(this, "id", {
  41468. value: Ci.Object3DIdCount++
  41469. }),
  41470. this.uuid = Ci.Math.generateUUID(),
  41471. this.name = "",
  41472. this.type = "Object3D",
  41473. this.parent = null,
  41474. this.children = [],
  41475. this.up = Ci.Object3D.DefaultUp.clone();
  41476. var e = new Ci.Vector3
  41477. , t = new Ci.Euler
  41478. , i = new Ci.Quaternion
  41479. , n = new Ci.Vector3(1,1,1);
  41480. t.onChange(function() {
  41481. i.setFromEuler(t, !1)
  41482. }),
  41483. i.onChange(function() {
  41484. t.setFromQuaternion(i, void 0, !1)
  41485. }),
  41486. Object.defineProperties(this, {
  41487. position: {
  41488. enumerable: !0,
  41489. value: e
  41490. },
  41491. rotation: {
  41492. enumerable: !0,
  41493. value: t
  41494. },
  41495. quaternion: {
  41496. enumerable: !0,
  41497. value: i
  41498. },
  41499. scale: {
  41500. enumerable: !0,
  41501. value: n
  41502. },
  41503. modelViewMatrix: {
  41504. value: new Ci.Matrix4
  41505. },
  41506. normalMatrix: {
  41507. value: new Ci.Matrix3
  41508. }
  41509. }),
  41510. this.rotationAutoUpdate = !0,
  41511. this.matrix = new Ci.Matrix4,
  41512. this.matrixWorld = new Ci.Matrix4,
  41513. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41514. this.matrixWorldNeedsUpdate = !1,
  41515. this.layers = new Ci.Layers,
  41516. this.visible = !0,
  41517. this.castShadow = !1,
  41518. this.receiveShadow = !1,
  41519. this.frustumCulled = !0,
  41520. this.renderOrder = 0,
  41521. this.userData = {}
  41522. }
  41523. ,
  41524. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41525. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41526. Ci.Object3D.prototype = {
  41527. constructor: Ci.Object3D,
  41528. applyMatrix: function(e) {
  41529. this.matrix.multiplyMatrices(e, this.matrix),
  41530. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41531. },
  41532. setRotationFromAxisAngle: function(e, t) {
  41533. this.quaternion.setFromAxisAngle(e, t)
  41534. },
  41535. setRotationFromEuler: function(e) {
  41536. this.quaternion.setFromEuler(e, !0)
  41537. },
  41538. setRotationFromMatrix: function(e) {
  41539. this.quaternion.setFromRotationMatrix(e)
  41540. },
  41541. setRotationFromQuaternion: function(e) {
  41542. this.quaternion.copy(e)
  41543. },
  41544. rotateOnAxis: (y = new Ci.Quaternion,
  41545. function(e, t) {
  41546. return y.setFromAxisAngle(e, t),
  41547. this.quaternion.multiply(y),
  41548. this
  41549. }
  41550. ),
  41551. rotateX: (v = new Ci.Vector3(1,0,0),
  41552. function(e) {
  41553. return this.rotateOnAxis(v, e)
  41554. }
  41555. ),
  41556. rotateY: (m = new Ci.Vector3(0,1,0),
  41557. function(e) {
  41558. return this.rotateOnAxis(m, e)
  41559. }
  41560. ),
  41561. rotateZ: (g = new Ci.Vector3(0,0,1),
  41562. function(e) {
  41563. return this.rotateOnAxis(g, e)
  41564. }
  41565. ),
  41566. translateOnAxis: (f = new Ci.Vector3,
  41567. function(e, t) {
  41568. return f.copy(e).applyQuaternion(this.quaternion),
  41569. this.position.add(f.multiplyScalar(t)),
  41570. this
  41571. }
  41572. ),
  41573. translateX: (p = new Ci.Vector3(1,0,0),
  41574. function(e) {
  41575. return this.translateOnAxis(p, e)
  41576. }
  41577. ),
  41578. translateY: (d = new Ci.Vector3(0,1,0),
  41579. function(e) {
  41580. return this.translateOnAxis(d, e)
  41581. }
  41582. ),
  41583. translateZ: (u = new Ci.Vector3(0,0,1),
  41584. function(e) {
  41585. return this.translateOnAxis(u, e)
  41586. }
  41587. ),
  41588. localToWorld: function(e) {
  41589. return e.applyMatrix4(this.matrixWorld)
  41590. },
  41591. worldToLocal: (h = new Ci.Matrix4,
  41592. function(e) {
  41593. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41594. }
  41595. ),
  41596. lookAt: (c = new Ci.Matrix4,
  41597. function(e) {
  41598. c.lookAt(e, this.position, this.up),
  41599. this.quaternion.setFromRotationMatrix(c)
  41600. }
  41601. ),
  41602. add: function(e) {
  41603. if (1 < arguments.length) {
  41604. for (var t = 0; t < arguments.length; t++)
  41605. this.add(arguments[t]);
  41606. return this
  41607. }
  41608. 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),
  41609. e.parent = this,
  41610. e.dispatchEvent({
  41611. type: "added"
  41612. }),
  41613. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41614. this
  41615. },
  41616. remove: function(e) {
  41617. if (1 < arguments.length)
  41618. for (var t = 0; t < arguments.length; t++)
  41619. this.remove(arguments[t]);
  41620. var i = this.children.indexOf(e);
  41621. -1 !== i && (e.parent = null,
  41622. e.dispatchEvent({
  41623. type: "removed"
  41624. }),
  41625. this.children.splice(i, 1))
  41626. },
  41627. getObjectById: function(e) {
  41628. return this.getObjectByProperty("id", e)
  41629. },
  41630. getObjectByName: function(e) {
  41631. return this.getObjectByProperty("name", e)
  41632. },
  41633. getObjectByProperty: function(e, t) {
  41634. if (this[e] === t)
  41635. return this;
  41636. for (var i = 0, n = this.children.length; i < n; i++) {
  41637. var r = this.children[i].getObjectByProperty(e, t);
  41638. if (void 0 !== r)
  41639. return r
  41640. }
  41641. },
  41642. getWorldPosition: function(e) {
  41643. var t = e || new Ci.Vector3;
  41644. return this.updateMatrixWorld(!0),
  41645. t.setFromMatrixPosition(this.matrixWorld)
  41646. },
  41647. getWorldQuaternion: (s = new Ci.Vector3,
  41648. l = new Ci.Vector3,
  41649. function(e) {
  41650. var t = e || new Ci.Quaternion;
  41651. return this.updateMatrixWorld(!0),
  41652. this.matrixWorld.decompose(s, t, l),
  41653. t
  41654. }
  41655. ),
  41656. getWorldRotation: (a = new Ci.Quaternion,
  41657. function(e) {
  41658. var t = e || new Ci.Euler;
  41659. return this.getWorldQuaternion(a),
  41660. t.setFromQuaternion(a, this.rotation.order, !1)
  41661. }
  41662. ),
  41663. getWorldScale: (r = new Ci.Vector3,
  41664. o = new Ci.Quaternion,
  41665. function(e) {
  41666. var t = e || new Ci.Vector3;
  41667. return this.updateMatrixWorld(!0),
  41668. this.matrixWorld.decompose(r, o, t),
  41669. t
  41670. }
  41671. ),
  41672. getWorldDirection: (n = new Ci.Quaternion,
  41673. function(e) {
  41674. var t = e || new Ci.Vector3;
  41675. return this.getWorldQuaternion(n),
  41676. t.set(0, 0, 1).applyQuaternion(n)
  41677. }
  41678. ),
  41679. raycast: function() {},
  41680. traverse: function(e) {
  41681. e(this);
  41682. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41683. t[i].traverse(e)
  41684. },
  41685. traverseVisible: function(e) {
  41686. if (!1 !== this.visible) {
  41687. e(this);
  41688. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41689. t[i].traverseVisible(e)
  41690. }
  41691. },
  41692. traverseAncestors: function(e) {
  41693. var t = this.parent;
  41694. null !== t && (e(t),
  41695. t.traverseAncestors(e))
  41696. },
  41697. updateMatrix: function() {
  41698. this.matrix.compose(this.position, this.quaternion, this.scale),
  41699. this.matrixWorldNeedsUpdate = !0
  41700. },
  41701. updateMatrixWorld: function(e) {
  41702. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41703. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41704. e = !(this.matrixWorldNeedsUpdate = !1));
  41705. for (var t = 0, i = this.children.length; t < i; t++)
  41706. this.children[t].updateMatrixWorld(e)
  41707. },
  41708. toJSON: function(e) {
  41709. function t(e) {
  41710. var t = [];
  41711. for (var i in e) {
  41712. var n = e[i];
  41713. delete n.metadata,
  41714. t.push(n)
  41715. }
  41716. return t
  41717. }
  41718. var i = void 0 === e
  41719. , n = {};
  41720. i && (e = {
  41721. geometries: {},
  41722. materials: {},
  41723. textures: {},
  41724. images: {}
  41725. },
  41726. n.metadata = {
  41727. version: 4.4,
  41728. type: "Object",
  41729. generator: "Object3D.toJSON"
  41730. });
  41731. var r = {};
  41732. if (r.uuid = this.uuid,
  41733. r.type = this.type,
  41734. "" !== this.name && (r.name = this.name),
  41735. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41736. !0 === this.castShadow && (r.castShadow = !0),
  41737. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41738. !1 === this.visible && (r.visible = !1),
  41739. r.matrix = this.matrix.toArray(),
  41740. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41741. r.geometry = this.geometry.uuid),
  41742. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41743. r.material = this.material.uuid),
  41744. 0 < this.children.length) {
  41745. r.children = [];
  41746. for (var o = 0; o < this.children.length; o++)
  41747. r.children.push(this.children[o].toJSON(e).object)
  41748. }
  41749. if (i) {
  41750. var a = t(e.geometries)
  41751. , s = t(e.materials)
  41752. , l = t(e.textures)
  41753. , c = t(e.images);
  41754. 0 < a.length && (n.geometries = a),
  41755. 0 < s.length && (n.materials = s),
  41756. 0 < l.length && (n.textures = l),
  41757. 0 < c.length && (n.images = c)
  41758. }
  41759. return n.object = r,
  41760. n
  41761. },
  41762. clone: function(e) {
  41763. return (new this.constructor).copy(this, e)
  41764. },
  41765. copy: function(e, t) {
  41766. if (void 0 === t && (t = !0),
  41767. this.name = e.name,
  41768. this.up.copy(e.up),
  41769. this.position.copy(e.position),
  41770. this.quaternion.copy(e.quaternion),
  41771. this.scale.copy(e.scale),
  41772. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41773. this.matrix.copy(e.matrix),
  41774. this.matrixWorld.copy(e.matrixWorld),
  41775. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41776. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41777. this.visible = e.visible,
  41778. this.castShadow = e.castShadow,
  41779. this.receiveShadow = e.receiveShadow,
  41780. this.frustumCulled = e.frustumCulled,
  41781. this.renderOrder = e.renderOrder,
  41782. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41783. !0 === t)
  41784. for (var i = 0; i < e.children.length; i++) {
  41785. var n = e.children[i];
  41786. this.add(n.clone())
  41787. }
  41788. return this
  41789. }
  41790. },
  41791. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41792. Ci.Object3DIdCount = 0,
  41793. Ci.Face3 = function(e, t, i, n, r, o) {
  41794. this.a = e,
  41795. this.b = t,
  41796. this.c = i,
  41797. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41798. this.vertexNormals = Array.isArray(n) ? n : [],
  41799. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41800. this.vertexColors = Array.isArray(r) ? r : [],
  41801. this.materialIndex = void 0 !== o ? o : 0
  41802. }
  41803. ,
  41804. Ci.Face3.prototype = {
  41805. constructor: Ci.Face3,
  41806. clone: function() {
  41807. return (new this.constructor).copy(this)
  41808. },
  41809. copy: function(e) {
  41810. this.a = e.a,
  41811. this.b = e.b,
  41812. this.c = e.c,
  41813. this.normal.copy(e.normal),
  41814. this.color.copy(e.color),
  41815. this.materialIndex = e.materialIndex;
  41816. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41817. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41818. for (t = 0,
  41819. i = e.vertexColors.length; t < i; t++)
  41820. this.vertexColors[t] = e.vertexColors[t].clone();
  41821. return this
  41822. }
  41823. },
  41824. Ci.BufferAttribute = function(e, t) {
  41825. this.uuid = Ci.Math.generateUUID(),
  41826. this.array = e,
  41827. this.itemSize = t,
  41828. this.dynamic = !1,
  41829. this.updateRange = {
  41830. offset: 0,
  41831. count: -1
  41832. },
  41833. this.version = 0
  41834. }
  41835. ,
  41836. Ci.BufferAttribute.prototype = {
  41837. constructor: Ci.BufferAttribute,
  41838. get count() {
  41839. return this.array.length / this.itemSize
  41840. },
  41841. set needsUpdate(e) {
  41842. !0 === e && this.version++
  41843. },
  41844. setDynamic: function(e) {
  41845. return this.dynamic = e,
  41846. this
  41847. },
  41848. copy: function(e) {
  41849. return this.array = new e.array.constructor(e.array),
  41850. this.itemSize = e.itemSize,
  41851. this.dynamic = e.dynamic,
  41852. this
  41853. },
  41854. copyAt: function(e, t, i) {
  41855. e *= this.itemSize,
  41856. i *= t.itemSize;
  41857. for (var n = 0, r = this.itemSize; n < r; n++)
  41858. this.array[e + n] = t.array[i + n];
  41859. return this
  41860. },
  41861. copyArray: function(e) {
  41862. return this.array.set(e),
  41863. this
  41864. },
  41865. copyColorsArray: function(e) {
  41866. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41867. var o = e[n];
  41868. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41869. o = new Ci.Color),
  41870. t[i++] = o.r,
  41871. t[i++] = o.g,
  41872. t[i++] = o.b
  41873. }
  41874. return this
  41875. },
  41876. copyIndicesArray: function(e) {
  41877. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41878. var o = e[n];
  41879. t[i++] = o.a,
  41880. t[i++] = o.b,
  41881. t[i++] = o.c
  41882. }
  41883. return this
  41884. },
  41885. copyVector2sArray: function(e) {
  41886. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41887. var o = e[n];
  41888. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41889. o = new Ci.Vector2),
  41890. t[i++] = o.x,
  41891. t[i++] = o.y
  41892. }
  41893. return this
  41894. },
  41895. copyVector3sArray: function(e) {
  41896. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41897. var o = e[n];
  41898. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41899. o = new Ci.Vector3),
  41900. t[i++] = o.x,
  41901. t[i++] = o.y,
  41902. t[i++] = o.z
  41903. }
  41904. return this
  41905. },
  41906. copyVector4sArray: function(e) {
  41907. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41908. var o = e[n];
  41909. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41910. o = new Ci.Vector4),
  41911. t[i++] = o.x,
  41912. t[i++] = o.y,
  41913. t[i++] = o.z,
  41914. t[i++] = o.w
  41915. }
  41916. return this
  41917. },
  41918. set: function(e, t) {
  41919. return void 0 === t && (t = 0),
  41920. this.array.set(e, t),
  41921. this
  41922. },
  41923. getX: function(e) {
  41924. return this.array[e * this.itemSize]
  41925. },
  41926. setX: function(e, t) {
  41927. return this.array[e * this.itemSize] = t,
  41928. this
  41929. },
  41930. getY: function(e) {
  41931. return this.array[e * this.itemSize + 1]
  41932. },
  41933. setY: function(e, t) {
  41934. return this.array[e * this.itemSize + 1] = t,
  41935. this
  41936. },
  41937. getZ: function(e) {
  41938. return this.array[e * this.itemSize + 2]
  41939. },
  41940. setZ: function(e, t) {
  41941. return this.array[e * this.itemSize + 2] = t,
  41942. this
  41943. },
  41944. getW: function(e) {
  41945. return this.array[e * this.itemSize + 3]
  41946. },
  41947. setW: function(e, t) {
  41948. return this.array[e * this.itemSize + 3] = t,
  41949. this
  41950. },
  41951. setXY: function(e, t, i) {
  41952. return e *= this.itemSize,
  41953. this.array[e + 0] = t,
  41954. this.array[e + 1] = i,
  41955. this
  41956. },
  41957. setXYZ: function(e, t, i, n) {
  41958. return e *= this.itemSize,
  41959. this.array[e + 0] = t,
  41960. this.array[e + 1] = i,
  41961. this.array[e + 2] = n,
  41962. this
  41963. },
  41964. setXYZW: function(e, t, i, n, r) {
  41965. return e *= this.itemSize,
  41966. this.array[e + 0] = t,
  41967. this.array[e + 1] = i,
  41968. this.array[e + 2] = n,
  41969. this.array[e + 3] = r,
  41970. this
  41971. },
  41972. clone: function() {
  41973. return (new this.constructor).copy(this)
  41974. }
  41975. },
  41976. Ci.Int8Attribute = function(e, t) {
  41977. return new Ci.BufferAttribute(new Int8Array(e),t)
  41978. }
  41979. ,
  41980. Ci.Uint8Attribute = function(e, t) {
  41981. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41982. }
  41983. ,
  41984. Ci.Uint8ClampedAttribute = function(e, t) {
  41985. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41986. }
  41987. ,
  41988. Ci.Int16Attribute = function(e, t) {
  41989. return new Ci.BufferAttribute(new Int16Array(e),t)
  41990. }
  41991. ,
  41992. Ci.Uint16Attribute = function(e, t) {
  41993. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41994. }
  41995. ,
  41996. Ci.Int32Attribute = function(e, t) {
  41997. return new Ci.BufferAttribute(new Int32Array(e),t)
  41998. }
  41999. ,
  42000. Ci.Uint32Attribute = function(e, t) {
  42001. return new Ci.BufferAttribute(new Uint32Array(e),t)
  42002. }
  42003. ,
  42004. Ci.Float32Attribute = function(e, t) {
  42005. return new Ci.BufferAttribute(new Float32Array(e),t)
  42006. }
  42007. ,
  42008. Ci.Float64Attribute = function(e, t) {
  42009. return new Ci.BufferAttribute(new Float64Array(e),t)
  42010. }
  42011. ,
  42012. Ci.DynamicBufferAttribute = function(e, t) {
  42013. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  42014. new Ci.BufferAttribute(e,t).setDynamic(!0)
  42015. }
  42016. ,
  42017. Ci.InstancedBufferAttribute = function(e, t, i) {
  42018. Ci.BufferAttribute.call(this, e, t),
  42019. this.meshPerAttribute = i || 1
  42020. }
  42021. ,
  42022. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  42023. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  42024. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  42025. return Ci.BufferAttribute.prototype.copy.call(this, e),
  42026. this.meshPerAttribute = e.meshPerAttribute,
  42027. this
  42028. }
  42029. ,
  42030. Ci.InterleavedBuffer = function(e, t) {
  42031. this.uuid = Ci.Math.generateUUID(),
  42032. this.array = e,
  42033. this.stride = t,
  42034. this.dynamic = !1,
  42035. this.updateRange = {
  42036. offset: 0,
  42037. count: -1
  42038. },
  42039. this.version = 0
  42040. }
  42041. ,
  42042. Ci.InterleavedBuffer.prototype = {
  42043. constructor: Ci.InterleavedBuffer,
  42044. get length() {
  42045. return this.array.length
  42046. },
  42047. get count() {
  42048. return this.array.length / this.stride
  42049. },
  42050. set needsUpdate(e) {
  42051. !0 === e && this.version++
  42052. },
  42053. setDynamic: function(e) {
  42054. return this.dynamic = e,
  42055. this
  42056. },
  42057. copy: function(e) {
  42058. return this.array = new e.array.constructor(e.array),
  42059. this.stride = e.stride,
  42060. this.dynamic = e.dynamic,
  42061. this
  42062. },
  42063. copyAt: function(e, t, i) {
  42064. e *= this.stride,
  42065. i *= t.stride;
  42066. for (var n = 0, r = this.stride; n < r; n++)
  42067. this.array[e + n] = t.array[i + n];
  42068. return this
  42069. },
  42070. set: function(e, t) {
  42071. return void 0 === t && (t = 0),
  42072. this.array.set(e, t),
  42073. this
  42074. },
  42075. clone: function() {
  42076. return (new this.constructor).copy(this)
  42077. }
  42078. },
  42079. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  42080. Ci.InterleavedBuffer.call(this, e, t),
  42081. this.meshPerAttribute = i || 1
  42082. }
  42083. ,
  42084. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  42085. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  42086. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42087. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  42088. this.meshPerAttribute = e.meshPerAttribute,
  42089. this
  42090. }
  42091. ,
  42092. Ci.InterleavedBufferAttribute = function(e, t, i) {
  42093. this.uuid = Ci.Math.generateUUID(),
  42094. this.data = e,
  42095. this.itemSize = t,
  42096. this.offset = i
  42097. }
  42098. ,
  42099. Ci.InterleavedBufferAttribute.prototype = {
  42100. constructor: Ci.InterleavedBufferAttribute,
  42101. get length() {
  42102. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42103. this.array.length
  42104. },
  42105. get count() {
  42106. return this.data.count
  42107. },
  42108. setX: function(e, t) {
  42109. return this.data.array[e * this.data.stride + this.offset] = t,
  42110. this
  42111. },
  42112. setY: function(e, t) {
  42113. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42114. this
  42115. },
  42116. setZ: function(e, t) {
  42117. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42118. this
  42119. },
  42120. setW: function(e, t) {
  42121. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42122. this
  42123. },
  42124. getX: function(e) {
  42125. return this.data.array[e * this.data.stride + this.offset]
  42126. },
  42127. getY: function(e) {
  42128. return this.data.array[e * this.data.stride + this.offset + 1]
  42129. },
  42130. getZ: function(e) {
  42131. return this.data.array[e * this.data.stride + this.offset + 2]
  42132. },
  42133. getW: function(e) {
  42134. return this.data.array[e * this.data.stride + this.offset + 3]
  42135. },
  42136. setXY: function(e, t, i) {
  42137. return e = e * this.data.stride + this.offset,
  42138. this.data.array[e + 0] = t,
  42139. this.data.array[e + 1] = i,
  42140. this
  42141. },
  42142. setXYZ: function(e, t, i, n) {
  42143. return e = e * this.data.stride + this.offset,
  42144. this.data.array[e + 0] = t,
  42145. this.data.array[e + 1] = i,
  42146. this.data.array[e + 2] = n,
  42147. this
  42148. },
  42149. setXYZW: function(e, t, i, n, r) {
  42150. return e = e * this.data.stride + this.offset,
  42151. this.data.array[e + 0] = t,
  42152. this.data.array[e + 1] = i,
  42153. this.data.array[e + 2] = n,
  42154. this.data.array[e + 3] = r,
  42155. this
  42156. }
  42157. },
  42158. Ci.Geometry = function() {
  42159. Object.defineProperty(this, "id", {
  42160. value: Ci.GeometryIdCount++
  42161. }),
  42162. this.uuid = Ci.Math.generateUUID(),
  42163. this.name = "",
  42164. this.type = "Geometry",
  42165. this.vertices = [],
  42166. this.colors = [],
  42167. this.faces = [],
  42168. this.faceVertexUvs = [[]],
  42169. this.morphTargets = [],
  42170. this.morphNormals = [],
  42171. this.skinWeights = [],
  42172. this.skinIndices = [],
  42173. this.lineDistances = [],
  42174. this.boundingBox = null,
  42175. this.boundingSphere = null,
  42176. this.verticesNeedUpdate = !1,
  42177. this.elementsNeedUpdate = !1,
  42178. this.uvsNeedUpdate = !1,
  42179. this.normalsNeedUpdate = !1,
  42180. this.colorsNeedUpdate = !1,
  42181. this.lineDistancesNeedUpdate = !1,
  42182. this.groupsNeedUpdate = !1
  42183. }
  42184. ,
  42185. Ci.Geometry.prototype = {
  42186. constructor: Ci.Geometry,
  42187. applyMatrix: function(e) {
  42188. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  42189. this.vertices[i].applyMatrix4(e)
  42190. }
  42191. for (i = 0,
  42192. n = this.faces.length; i < n; i++) {
  42193. var r = this.faces[i];
  42194. r.normal.applyMatrix3(t).normalize();
  42195. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  42196. r.vertexNormals[o].applyMatrix3(t).normalize()
  42197. }
  42198. return null !== this.boundingBox && this.computeBoundingBox(),
  42199. null !== this.boundingSphere && this.computeBoundingSphere(),
  42200. this.verticesNeedUpdate = !0,
  42201. this.normalsNeedUpdate = !0,
  42202. this
  42203. },
  42204. rotateX: function(e) {
  42205. return void 0 === mt && (mt = new Ci.Matrix4),
  42206. mt.makeRotationX(e),
  42207. this.applyMatrix(mt),
  42208. this
  42209. },
  42210. rotateY: function(e) {
  42211. return void 0 === gt && (gt = new Ci.Matrix4),
  42212. gt.makeRotationY(e),
  42213. this.applyMatrix(gt),
  42214. this
  42215. },
  42216. rotateZ: function(e) {
  42217. return void 0 === ft && (ft = new Ci.Matrix4),
  42218. ft.makeRotationZ(e),
  42219. this.applyMatrix(ft),
  42220. this
  42221. },
  42222. translate: function(e, t, i) {
  42223. return void 0 === pt && (pt = new Ci.Matrix4),
  42224. pt.makeTranslation(e, t, i),
  42225. this.applyMatrix(pt),
  42226. this
  42227. },
  42228. scale: function(e, t, i) {
  42229. return void 0 === dt && (dt = new Ci.Matrix4),
  42230. dt.makeScale(e, t, i),
  42231. this.applyMatrix(dt),
  42232. this
  42233. },
  42234. lookAt: function(e) {
  42235. void 0 === ut && (ut = new Ci.Object3D),
  42236. ut.lookAt(e),
  42237. ut.updateMatrix(),
  42238. this.applyMatrix(ut.matrix)
  42239. },
  42240. fromBufferGeometry: function(e) {
  42241. function t(e, t, i, n) {
  42242. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42243. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42244. , a = new Ci.Face3(e,t,i,r,o,n);
  42245. s.faces.push(a),
  42246. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42247. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42248. }
  42249. var s = this
  42250. , i = null !== e.index ? e.index.array : void 0
  42251. , n = e.attributes
  42252. , r = n.position.array
  42253. , l = void 0 !== n.normal ? n.normal.array : void 0
  42254. , c = void 0 !== n.color ? n.color.array : void 0
  42255. , h = void 0 !== n.uv ? n.uv.array : void 0
  42256. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42257. void 0 !== u && (this.faceVertexUvs[1] = []);
  42258. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42259. a += 2)
  42260. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42261. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42262. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42263. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42264. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42265. if (void 0 !== i) {
  42266. var g = e.groups;
  42267. if (0 < g.length)
  42268. for (o = 0; o < g.length; o++)
  42269. for (var m = g[o], v = m.start, y = (a = v,
  42270. v + m.count); a < y; a += 3)
  42271. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42272. else
  42273. for (o = 0; o < i.length; o += 3)
  42274. t(i[o], i[o + 1], i[o + 2])
  42275. } else
  42276. for (o = 0; o < r.length / 3; o += 3)
  42277. t(o, o + 1, o + 2);
  42278. return this.computeFaceNormals(),
  42279. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42280. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42281. this
  42282. },
  42283. center: function() {
  42284. this.computeBoundingBox();
  42285. var e = this.boundingBox.center().negate();
  42286. return this.translate(e.x, e.y, e.z),
  42287. e
  42288. },
  42289. normalize: function() {
  42290. this.computeBoundingSphere();
  42291. var e = this.boundingSphere.center
  42292. , t = this.boundingSphere.radius
  42293. , i = 0 === t ? 1 : 1 / t
  42294. , n = new Ci.Matrix4;
  42295. 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),
  42296. this.applyMatrix(n),
  42297. this
  42298. },
  42299. computeFaceNormals: function() {
  42300. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42301. var r = this.faces[i]
  42302. , o = this.vertices[r.a]
  42303. , a = this.vertices[r.b]
  42304. , s = this.vertices[r.c];
  42305. e.subVectors(s, a),
  42306. t.subVectors(o, a),
  42307. e.cross(t),
  42308. e.normalize(),
  42309. r.normal.copy(e)
  42310. }
  42311. },
  42312. computeVertexNormals: function(e) {
  42313. var t, i, n, r, o, a;
  42314. for (void 0 === e && (e = !0),
  42315. a = new Array(this.vertices.length),
  42316. t = 0,
  42317. i = this.vertices.length; t < i; t++)
  42318. a[t] = new Ci.Vector3;
  42319. if (e) {
  42320. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42321. for (n = 0,
  42322. r = this.faces.length; n < r; n++)
  42323. o = this.faces[n],
  42324. s = this.vertices[o.a],
  42325. l = this.vertices[o.b],
  42326. c = this.vertices[o.c],
  42327. h.subVectors(c, l),
  42328. u.subVectors(s, l),
  42329. h.cross(u),
  42330. a[o.a].add(h),
  42331. a[o.b].add(h),
  42332. a[o.c].add(h)
  42333. } else
  42334. for (n = 0,
  42335. r = this.faces.length; n < r; n++)
  42336. a[(o = this.faces[n]).a].add(o.normal),
  42337. a[o.b].add(o.normal),
  42338. a[o.c].add(o.normal);
  42339. for (t = 0,
  42340. i = this.vertices.length; t < i; t++)
  42341. a[t].normalize();
  42342. for (n = 0,
  42343. r = this.faces.length; n < r; n++) {
  42344. var d = (o = this.faces[n]).vertexNormals;
  42345. 3 === d.length ? (d[0].copy(a[o.a]),
  42346. d[1].copy(a[o.b]),
  42347. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42348. d[1] = a[o.b].clone(),
  42349. d[2] = a[o.c].clone())
  42350. }
  42351. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42352. },
  42353. computeMorphNormals: function() {
  42354. var e, t, i, n, r;
  42355. for (i = 0,
  42356. n = this.faces.length; i < n; i++)
  42357. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42358. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42359. e = 0,
  42360. t = r.vertexNormals.length; e < t; e++)
  42361. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42362. var o = new Ci.Geometry;
  42363. for (o.faces = this.faces,
  42364. e = 0,
  42365. t = this.morphTargets.length; e < t; e++) {
  42366. if (!this.morphNormals[e]) {
  42367. this.morphNormals[e] = {},
  42368. this.morphNormals[e].faceNormals = [],
  42369. this.morphNormals[e].vertexNormals = [];
  42370. var a = this.morphNormals[e].faceNormals
  42371. , s = this.morphNormals[e].vertexNormals;
  42372. for (i = 0,
  42373. n = this.faces.length; i < n; i++)
  42374. l = new Ci.Vector3,
  42375. c = {
  42376. a: new Ci.Vector3,
  42377. b: new Ci.Vector3,
  42378. c: new Ci.Vector3
  42379. },
  42380. a.push(l),
  42381. s.push(c)
  42382. }
  42383. var l, c, h = this.morphNormals[e];
  42384. for (o.vertices = this.morphTargets[e].vertices,
  42385. o.computeFaceNormals(),
  42386. o.computeVertexNormals(),
  42387. i = 0,
  42388. n = this.faces.length; i < n; i++)
  42389. r = this.faces[i],
  42390. l = h.faceNormals[i],
  42391. c = h.vertexNormals[i],
  42392. l.copy(r.normal),
  42393. c.a.copy(r.vertexNormals[0]),
  42394. c.b.copy(r.vertexNormals[1]),
  42395. c.c.copy(r.vertexNormals[2])
  42396. }
  42397. for (i = 0,
  42398. n = this.faces.length; i < n; i++)
  42399. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42400. r.vertexNormals = r.__originalVertexNormals
  42401. },
  42402. computeTangents: function() {
  42403. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42404. },
  42405. computeLineDistances: function() {
  42406. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42407. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42408. this.lineDistances[i] = e
  42409. },
  42410. computeBoundingBox: function() {
  42411. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42412. this.boundingBox.setFromPoints(this.vertices)
  42413. },
  42414. computeBoundingSphere: function() {
  42415. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42416. this.boundingSphere.setFromPoints(this.vertices)
  42417. },
  42418. merge: function(e, t, i) {
  42419. if (e instanceof Ci.Geometry != 0) {
  42420. 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];
  42421. void 0 === i && (i = 0),
  42422. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42423. for (var u = 0, d = a.length; u < d; u++) {
  42424. var p = a[u].clone();
  42425. void 0 !== t && p.applyMatrix4(t),
  42426. o.push(p)
  42427. }
  42428. for (u = 0,
  42429. d = l.length; u < d; u++) {
  42430. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42431. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42432. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42433. for (var C = 0, I = y.length; C < I; C++)
  42434. g = y[C].clone(),
  42435. void 0 !== n && g.applyMatrix3(n).normalize(),
  42436. f.vertexNormals.push(g);
  42437. f.color.copy(v.color);
  42438. for (C = 0,
  42439. I = A.length; C < I; C++)
  42440. m = A[C],
  42441. f.vertexColors.push(m.clone());
  42442. f.materialIndex = v.materialIndex + i,
  42443. s.push(f)
  42444. }
  42445. for (u = 0,
  42446. d = h.length; u < d; u++) {
  42447. var E = h[u]
  42448. , _ = [];
  42449. if (void 0 !== E) {
  42450. for (C = 0,
  42451. I = E.length; C < I; C++)
  42452. _.push(E[C].clone());
  42453. c.push(_)
  42454. }
  42455. }
  42456. } else
  42457. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42458. },
  42459. mergeMesh: function(e) {
  42460. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42461. void this.merge(e.geometry, e.matrix))
  42462. },
  42463. mergeVertices: function() {
  42464. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42465. for (i = 0,
  42466. n = this.vertices.length; i < n; i++)
  42467. e = this.vertices[i],
  42468. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42469. c.push(this.vertices[i]),
  42470. h[i] = c.length - 1) : h[i] = h[l[t]];
  42471. var d = [];
  42472. for (i = 0,
  42473. n = this.faces.length; i < n; i++) {
  42474. (r = this.faces[i]).a = h[r.a],
  42475. r.b = h[r.b],
  42476. r.c = h[r.c],
  42477. o = [r.a, r.b, r.c];
  42478. for (var p = 0; p < 3; p++)
  42479. if (o[p] === o[(p + 1) % 3]) {
  42480. p,
  42481. d.push(i);
  42482. break
  42483. }
  42484. }
  42485. for (i = d.length - 1; 0 <= i; i--) {
  42486. var f = d[i];
  42487. for (this.faces.splice(f, 1),
  42488. a = 0,
  42489. s = this.faceVertexUvs.length; a < s; a++)
  42490. this.faceVertexUvs[a].splice(f, 1)
  42491. }
  42492. var g = this.vertices.length - c.length;
  42493. return this.vertices = c,
  42494. g
  42495. },
  42496. sortFacesByMaterialIndex: function() {
  42497. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42498. e[i]._id = i;
  42499. e.sort(function(e, t) {
  42500. return e.materialIndex - t.materialIndex
  42501. });
  42502. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42503. o && o.length === t && (n = []),
  42504. a && a.length === t && (r = []);
  42505. for (i = 0; i < t; i++) {
  42506. var s = e[i]._id;
  42507. n && n.push(o[s]),
  42508. r && r.push(a[s])
  42509. }
  42510. n && (this.faceVertexUvs[0] = n),
  42511. r && (this.faceVertexUvs[1] = r)
  42512. },
  42513. toJSON: function() {
  42514. function e(e, t, i) {
  42515. return i ? e | 1 << t : e & ~(1 << t)
  42516. }
  42517. function t(e) {
  42518. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42519. return void 0 !== d[t] || (d[t] = u.length / 3,
  42520. u.push(e.x, e.y, e.z)),
  42521. d[t]
  42522. }
  42523. function i(e) {
  42524. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42525. return void 0 !== f[t] || (f[t] = p.length,
  42526. p.push(e.getHex())),
  42527. f[t]
  42528. }
  42529. function n(e) {
  42530. var t = e.x.toString() + e.y.toString();
  42531. return void 0 !== m[t] || (m[t] = g.length / 2,
  42532. g.push(e.x, e.y)),
  42533. m[t]
  42534. }
  42535. var r = {
  42536. metadata: {
  42537. version: 4.4,
  42538. type: "Geometry",
  42539. generator: "Geometry.toJSON"
  42540. }
  42541. };
  42542. if (r.uuid = this.uuid,
  42543. r.type = this.type,
  42544. "" !== this.name && (r.name = this.name),
  42545. void 0 !== this.parameters) {
  42546. var o = this.parameters;
  42547. for (var a in o)
  42548. void 0 !== o[a] && (r[a] = o[a]);
  42549. return r
  42550. }
  42551. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42552. var c = this.vertices[l];
  42553. s.push(c.x, c.y, c.z)
  42554. }
  42555. var h = []
  42556. , u = []
  42557. , d = {}
  42558. , p = []
  42559. , f = {}
  42560. , g = []
  42561. , m = {};
  42562. for (l = 0; l < this.faces.length; l++) {
  42563. var v = this.faces[l]
  42564. , y = void 0 !== this.faceVertexUvs[0][l]
  42565. , A = 0 < v.normal.length()
  42566. , C = 0 < v.vertexNormals.length
  42567. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42568. , E = 0 < v.vertexColors.length
  42569. , _ = 0;
  42570. 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),
  42571. h.push(_),
  42572. h.push(v.a, v.b, v.c),
  42573. h.push(v.materialIndex),
  42574. y) {
  42575. var b = this.faceVertexUvs[0][l];
  42576. h.push(n(b[0]), n(b[1]), n(b[2]))
  42577. }
  42578. if (A && h.push(t(v.normal)),
  42579. C) {
  42580. var w = v.vertexNormals;
  42581. h.push(t(w[0]), t(w[1]), t(w[2]))
  42582. }
  42583. if (I && h.push(i(v.color)),
  42584. E) {
  42585. var T = v.vertexColors;
  42586. h.push(i(T[0]), i(T[1]), i(T[2]))
  42587. }
  42588. }
  42589. return r.data = {},
  42590. r.data.vertices = s,
  42591. r.data.normals = u,
  42592. 0 < p.length && (r.data.colors = p),
  42593. 0 < g.length && (r.data.uvs = [g]),
  42594. r.data.faces = h,
  42595. r
  42596. },
  42597. clone: function() {
  42598. return (new Ci.Geometry).copy(this)
  42599. },
  42600. copy: function(e) {
  42601. this.vertices = [],
  42602. this.faces = [],
  42603. this.faceVertexUvs = [[]];
  42604. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42605. this.vertices.push(t[i].clone());
  42606. var r = e.faces;
  42607. for (i = 0,
  42608. n = r.length; i < n; i++)
  42609. this.faces.push(r[i].clone());
  42610. for (i = 0,
  42611. n = e.faceVertexUvs.length; i < n; i++) {
  42612. var o = e.faceVertexUvs[i];
  42613. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42614. for (var a = 0, s = o.length; a < s; a++) {
  42615. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42616. var d = l[h];
  42617. c.push(d.clone())
  42618. }
  42619. this.faceVertexUvs[i].push(c)
  42620. }
  42621. }
  42622. return this
  42623. },
  42624. dispose: function() {
  42625. this.dispatchEvent({
  42626. type: "dispose"
  42627. })
  42628. }
  42629. },
  42630. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42631. Ci.GeometryIdCount = 0,
  42632. Ci.DirectGeometry = function() {
  42633. Object.defineProperty(this, "id", {
  42634. value: Ci.GeometryIdCount++
  42635. }),
  42636. this.uuid = Ci.Math.generateUUID(),
  42637. this.name = "",
  42638. this.type = "DirectGeometry",
  42639. this.indices = [],
  42640. this.vertices = [],
  42641. this.normals = [],
  42642. this.colors = [],
  42643. this.uvs = [],
  42644. this.uvs2 = [],
  42645. this.groups = [],
  42646. this.morphTargets = {},
  42647. this.skinWeights = [],
  42648. this.skinIndices = [],
  42649. this.boundingBox = null,
  42650. this.boundingSphere = null,
  42651. this.verticesNeedUpdate = !1,
  42652. this.normalsNeedUpdate = !1,
  42653. this.colorsNeedUpdate = !1,
  42654. this.uvsNeedUpdate = !1,
  42655. this.groupsNeedUpdate = !1
  42656. }
  42657. ,
  42658. Ci.DirectGeometry.prototype = {
  42659. constructor: Ci.DirectGeometry,
  42660. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42661. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42662. computeFaceNormals: function() {
  42663. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42664. },
  42665. computeVertexNormals: function() {
  42666. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42667. },
  42668. computeGroups: function(e) {
  42669. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42670. var a = r[o];
  42671. a.materialIndex !== i && (i = a.materialIndex,
  42672. void 0 !== t && (t.count = 3 * o - t.start,
  42673. n.push(t)),
  42674. t = {
  42675. start: 3 * o,
  42676. materialIndex: i
  42677. })
  42678. }
  42679. void 0 !== t && (t.count = 3 * o - t.start,
  42680. n.push(t)),
  42681. this.groups = n
  42682. },
  42683. fromGeometry: function(e) {
  42684. 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;
  42685. if (0 < l) {
  42686. t = [];
  42687. for (var c = 0; c < l; c++)
  42688. t[c] = [];
  42689. this.morphTargets.position = t
  42690. }
  42691. var h, u = e.morphNormals, d = u.length;
  42692. if (0 < d) {
  42693. h = [];
  42694. for (c = 0; c < d; c++)
  42695. h[c] = [];
  42696. this.morphTargets.normal = h
  42697. }
  42698. var p = e.skinIndices
  42699. , f = e.skinWeights
  42700. , g = p.length === n.length
  42701. , m = f.length === n.length;
  42702. for (c = 0; c < i.length; c++) {
  42703. var v = i[c];
  42704. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42705. var y = v.vertexNormals;
  42706. if (3 === y.length)
  42707. this.normals.push(y[0], y[1], y[2]);
  42708. else {
  42709. var A = v.normal;
  42710. this.normals.push(A, A, A)
  42711. }
  42712. var C, I = v.vertexColors;
  42713. if (3 === I.length)
  42714. this.colors.push(I[0], I[1], I[2]);
  42715. else {
  42716. var E = v.color;
  42717. this.colors.push(E, E, E)
  42718. }
  42719. if (!0 === o)
  42720. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42721. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42722. if (!0 === a)
  42723. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42724. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42725. for (var _ = 0; _ < l; _++) {
  42726. var b = s[_].vertices;
  42727. t[_].push(b[v.a], b[v.b], b[v.c])
  42728. }
  42729. for (_ = 0; _ < d; _++) {
  42730. var w = u[_].vertexNormals[c];
  42731. h[_].push(w.a, w.b, w.c)
  42732. }
  42733. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42734. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42735. }
  42736. return this.computeGroups(e),
  42737. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42738. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42739. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42740. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42741. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42742. this
  42743. },
  42744. dispose: function() {
  42745. this.dispatchEvent({
  42746. type: "dispose"
  42747. })
  42748. }
  42749. },
  42750. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42751. Ci.BufferGeometry = function() {
  42752. Object.defineProperty(this, "id", {
  42753. value: Ci.GeometryIdCount++
  42754. }),
  42755. this.uuid = Ci.Math.generateUUID(),
  42756. this.name = "",
  42757. this.type = "BufferGeometry",
  42758. this.index = null,
  42759. this.attributes = {},
  42760. this.morphAttributes = {},
  42761. this.groups = [],
  42762. this.boundingBox = null,
  42763. this.boundingSphere = null,
  42764. this.drawRange = {
  42765. start: 0,
  42766. count: 1 / 0
  42767. }
  42768. }
  42769. ,
  42770. Ci.BufferGeometry.prototype = {
  42771. constructor: Ci.BufferGeometry,
  42772. getIndex: function() {
  42773. return this.index
  42774. },
  42775. setIndex: function(e) {
  42776. this.index = e
  42777. },
  42778. addAttribute: function(e, t) {
  42779. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42780. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42781. void this.setIndex(t)) : (this.attributes[e] = t,
  42782. this)
  42783. },
  42784. getAttribute: function(e) {
  42785. return this.attributes[e]
  42786. },
  42787. removeAttribute: function(e) {
  42788. return delete this.attributes[e],
  42789. this
  42790. },
  42791. addGroup: function(e, t, i) {
  42792. this.groups.push({
  42793. start: e,
  42794. count: t,
  42795. materialIndex: void 0 !== i ? i : 0
  42796. })
  42797. },
  42798. clearGroups: function() {
  42799. this.groups = []
  42800. },
  42801. setDrawRange: function(e, t) {
  42802. this.drawRange.start = e,
  42803. this.drawRange.count = t
  42804. },
  42805. applyMatrix: function(e) {
  42806. var t = this.attributes.position;
  42807. void 0 !== t && (e.applyToVector3Array(t.array),
  42808. t.needsUpdate = !0);
  42809. var i = this.attributes.normal;
  42810. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42811. i.needsUpdate = !0);
  42812. return null !== this.boundingBox && this.computeBoundingBox(),
  42813. null !== this.boundingSphere && this.computeBoundingSphere(),
  42814. this
  42815. },
  42816. rotateX: function(e) {
  42817. return void 0 === ht && (ht = new Ci.Matrix4),
  42818. ht.makeRotationX(e),
  42819. this.applyMatrix(ht),
  42820. this
  42821. },
  42822. rotateY: function(e) {
  42823. return void 0 === ct && (ct = new Ci.Matrix4),
  42824. ct.makeRotationY(e),
  42825. this.applyMatrix(ct),
  42826. this
  42827. },
  42828. rotateZ: function(e) {
  42829. return void 0 === lt && (lt = new Ci.Matrix4),
  42830. lt.makeRotationZ(e),
  42831. this.applyMatrix(lt),
  42832. this
  42833. },
  42834. translate: function(e, t, i) {
  42835. return void 0 === st && (st = new Ci.Matrix4),
  42836. st.makeTranslation(e, t, i),
  42837. this.applyMatrix(st),
  42838. this
  42839. },
  42840. scale: function(e, t, i) {
  42841. return void 0 === at && (at = new Ci.Matrix4),
  42842. at.makeScale(e, t, i),
  42843. this.applyMatrix(at),
  42844. this
  42845. },
  42846. lookAt: function(e) {
  42847. void 0 === ot && (ot = new Ci.Object3D),
  42848. ot.lookAt(e),
  42849. ot.updateMatrix(),
  42850. this.applyMatrix(ot.matrix)
  42851. },
  42852. center: function() {
  42853. this.computeBoundingBox();
  42854. var e = this.boundingBox.center().negate();
  42855. return this.translate(e.x, e.y, e.z),
  42856. e
  42857. },
  42858. setFromObject: function(e) {
  42859. var t = e.geometry;
  42860. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42861. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42862. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42863. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42864. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42865. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42866. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42867. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42868. }
  42869. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42870. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42871. } else
  42872. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42873. return this
  42874. },
  42875. updateFromObject: function(e) {
  42876. var t, i = e.geometry;
  42877. if (e instanceof Ci.Mesh) {
  42878. var n = i.__directGeometry;
  42879. if (void 0 === n)
  42880. return this.fromGeometry(i);
  42881. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42882. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42883. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42884. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42885. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42886. i.verticesNeedUpdate = !1,
  42887. i.normalsNeedUpdate = !1,
  42888. i.colorsNeedUpdate = !1,
  42889. i.uvsNeedUpdate = !1,
  42890. i.groupsNeedUpdate = !1,
  42891. i = n
  42892. }
  42893. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42894. t.needsUpdate = !0),
  42895. i.verticesNeedUpdate = !1);
  42896. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42897. t.needsUpdate = !0),
  42898. i.normalsNeedUpdate = !1);
  42899. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42900. t.needsUpdate = !0),
  42901. i.colorsNeedUpdate = !1);
  42902. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42903. t.needsUpdate = !0),
  42904. i.uvsNeedUpdate = !1);
  42905. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42906. t.needsUpdate = !0),
  42907. i.lineDistancesNeedUpdate = !1);
  42908. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42909. this.groups = i.groups,
  42910. i.groupsNeedUpdate = !1),
  42911. this
  42912. },
  42913. fromGeometry: function(e) {
  42914. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42915. this.fromDirectGeometry(e.__directGeometry)
  42916. },
  42917. fromDirectGeometry: function(e) {
  42918. var t = new Float32Array(3 * e.vertices.length);
  42919. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42920. 0 < e.normals.length) {
  42921. var i = new Float32Array(3 * e.normals.length);
  42922. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42923. }
  42924. if (0 < e.colors.length) {
  42925. var n = new Float32Array(3 * e.colors.length);
  42926. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42927. }
  42928. if (0 < e.uvs.length) {
  42929. var r = new Float32Array(2 * e.uvs.length);
  42930. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42931. }
  42932. if (0 < e.uvs2.length) {
  42933. var o = new Float32Array(2 * e.uvs2.length);
  42934. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42935. }
  42936. if (0 < e.indices.length) {
  42937. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42938. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42939. }
  42940. for (var s in this.groups = e.groups,
  42941. e.morphTargets) {
  42942. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42943. var d = c[h]
  42944. , p = new Ci.Float32Attribute(3 * d.length,3);
  42945. l.push(p.copyVector3sArray(d))
  42946. }
  42947. this.morphAttributes[s] = l
  42948. }
  42949. if (0 < e.skinIndices.length) {
  42950. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42951. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42952. }
  42953. if (0 < e.skinWeights.length) {
  42954. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42955. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42956. }
  42957. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42958. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42959. this
  42960. },
  42961. computeBoundingBox: (new Ci.Vector3,
  42962. function() {
  42963. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42964. var e = this.attributes.position.array;
  42965. e && this.boundingBox.setFromArray(e),
  42966. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42967. this.boundingBox.max.set(0, 0, 0)),
  42968. (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)
  42969. }
  42970. ),
  42971. computeBoundingSphere: (nt = new Ci.Box3,
  42972. rt = new Ci.Vector3,
  42973. function() {
  42974. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42975. var e = this.attributes.position.array;
  42976. if (e) {
  42977. var t = this.boundingSphere.center;
  42978. nt.setFromArray(e),
  42979. nt.center(t);
  42980. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42981. rt.fromArray(e, n),
  42982. i = Math.max(i, t.distanceToSquared(rt));
  42983. this.boundingSphere.radius = Math.sqrt(i),
  42984. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42985. }
  42986. }
  42987. ),
  42988. computeFaceNormals: function() {},
  42989. computeVertexNormals: function() {
  42990. var e = this.index
  42991. , t = this.attributes
  42992. , i = this.groups;
  42993. if (t.position) {
  42994. var n = t.position.array;
  42995. if (void 0 === t.normal)
  42996. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42997. else
  42998. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42999. r[o] = 0;
  43000. 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;
  43001. if (e) {
  43002. var m = e.array;
  43003. 0 === i.length && this.addGroup(0, m.length);
  43004. for (var v = 0, y = i.length; v < y; ++v) {
  43005. var A = i[v]
  43006. , C = A.start;
  43007. for (o = C,
  43008. a = C + A.count; o < a; o += 3)
  43009. s = 3 * m[o + 0],
  43010. l = 3 * m[o + 1],
  43011. c = 3 * m[o + 2],
  43012. u.fromArray(n, s),
  43013. d.fromArray(n, l),
  43014. p.fromArray(n, c),
  43015. f.subVectors(p, d),
  43016. g.subVectors(u, d),
  43017. f.cross(g),
  43018. h[s] += f.x,
  43019. h[1 + s] += f.y,
  43020. h[2 + s] += f.z,
  43021. h[l] += f.x,
  43022. h[1 + l] += f.y,
  43023. h[2 + l] += f.z,
  43024. h[c] += f.x,
  43025. h[1 + c] += f.y,
  43026. h[2 + c] += f.z
  43027. }
  43028. } else
  43029. for (o = 0,
  43030. a = n.length; o < a; o += 9)
  43031. u.fromArray(n, o),
  43032. d.fromArray(n, o + 3),
  43033. p.fromArray(n, o + 6),
  43034. f.subVectors(p, d),
  43035. g.subVectors(u, d),
  43036. f.cross(g),
  43037. h[o] = f.x,
  43038. h[o + 1] = f.y,
  43039. h[o + 2] = f.z,
  43040. h[o + 3] = f.x,
  43041. h[o + 4] = f.y,
  43042. h[o + 5] = f.z,
  43043. h[o + 6] = f.x,
  43044. h[o + 7] = f.y,
  43045. h[o + 8] = f.z;
  43046. this.normalizeNormals(),
  43047. t.normal.needsUpdate = !0
  43048. }
  43049. },
  43050. merge: function(e, t) {
  43051. if (e instanceof Ci.BufferGeometry != 0) {
  43052. void 0 === t && (t = 0);
  43053. var i = this.attributes;
  43054. for (var n in i)
  43055. if (void 0 !== e.attributes[n])
  43056. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  43057. l++)
  43058. r[l] = a[s];
  43059. return this
  43060. }
  43061. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  43062. },
  43063. normalizeNormals: function() {
  43064. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43065. e = r[o],
  43066. t = r[o + 1],
  43067. i = r[o + 2],
  43068. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43069. r[o] *= n,
  43070. r[o + 1] *= n,
  43071. r[o + 2] *= n
  43072. },
  43073. toNonIndexed: function() {
  43074. if (null === this.index)
  43075. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43076. this;
  43077. var e = new Ci.BufferGeometry
  43078. , t = this.index.array
  43079. , i = this.attributes;
  43080. for (var n in i) {
  43081. 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++) {
  43082. l = t[h] * a;
  43083. for (var d = 0; d < a; d++)
  43084. s[c++] = o[l++]
  43085. }
  43086. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  43087. }
  43088. return e
  43089. },
  43090. toJSON: function() {
  43091. var e = {
  43092. metadata: {
  43093. version: 4.4,
  43094. type: "BufferGeometry",
  43095. generator: "BufferGeometry.toJSON"
  43096. }
  43097. };
  43098. if (e.uuid = this.uuid,
  43099. e.type = this.type,
  43100. "" !== this.name && (e.name = this.name),
  43101. void 0 !== this.parameters) {
  43102. var t = this.parameters;
  43103. for (var i in t)
  43104. void 0 !== t[i] && (e[i] = t[i]);
  43105. return e
  43106. }
  43107. e.data = {
  43108. attributes: {}
  43109. };
  43110. var n = this.index;
  43111. if (null !== n) {
  43112. var r = Array.prototype.slice.call(n.array);
  43113. e.data.index = {
  43114. type: n.array.constructor.name,
  43115. array: r
  43116. }
  43117. }
  43118. var o = this.attributes;
  43119. for (var i in o) {
  43120. var a = o[i];
  43121. r = Array.prototype.slice.call(a.array);
  43122. e.data.attributes[i] = {
  43123. itemSize: a.itemSize,
  43124. type: a.array.constructor.name,
  43125. array: r
  43126. }
  43127. }
  43128. var s = this.groups;
  43129. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43130. var l = this.boundingSphere;
  43131. return null !== l && (e.data.boundingSphere = {
  43132. center: l.center.toArray(),
  43133. radius: l.radius
  43134. }),
  43135. e
  43136. },
  43137. clone: function() {
  43138. return (new Ci.BufferGeometry).copy(this)
  43139. },
  43140. copy: function(e) {
  43141. var t = e.index;
  43142. null !== t && this.setIndex(t.clone());
  43143. var i = e.attributes;
  43144. for (var n in i) {
  43145. var r = i[n];
  43146. this.addAttribute(n, r.clone())
  43147. }
  43148. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43149. var l = o[a];
  43150. this.addGroup(l.start, l.count)
  43151. }
  43152. return this
  43153. },
  43154. dispose: function() {
  43155. this.dispatchEvent({
  43156. type: "dispose"
  43157. })
  43158. }
  43159. },
  43160. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  43161. Ci.BufferGeometry.MaxIndex = 65535,
  43162. Ci.InstancedBufferGeometry = function() {
  43163. Ci.BufferGeometry.call(this),
  43164. this.type = "InstancedBufferGeometry",
  43165. this.maxInstancedCount = void 0
  43166. }
  43167. ,
  43168. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  43169. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  43170. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43171. this.groups.push({
  43172. start: e,
  43173. count: t,
  43174. instances: i
  43175. })
  43176. }
  43177. ,
  43178. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  43179. var t = e.index;
  43180. null !== t && this.setIndex(t.clone());
  43181. var i = e.attributes;
  43182. for (var n in i) {
  43183. var r = i[n];
  43184. this.addAttribute(n, r.clone())
  43185. }
  43186. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43187. var l = o[a];
  43188. this.addGroup(l.start, l.count, l.instances)
  43189. }
  43190. return this
  43191. }
  43192. ,
  43193. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  43194. Ci.Uniform = function(e, t) {
  43195. this.type = e,
  43196. this.value = t,
  43197. this.dynamic = !1
  43198. }
  43199. ,
  43200. Ci.Uniform.prototype = {
  43201. constructor: Ci.Uniform,
  43202. onUpdate: function(e) {
  43203. return this.dynamic = !0,
  43204. this.onUpdateCallback = e,
  43205. this
  43206. }
  43207. },
  43208. Ci.AnimationClip = function(e, t, i) {
  43209. this.name = e || Ci.Math.generateUUID(),
  43210. this.tracks = i,
  43211. this.duration = void 0 !== t ? t : -1,
  43212. this.duration < 0 && this.resetDuration(),
  43213. this.trim(),
  43214. this.optimize()
  43215. }
  43216. ,
  43217. Ci.AnimationClip.prototype = {
  43218. constructor: Ci.AnimationClip,
  43219. resetDuration: function() {
  43220. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43221. var n = this.tracks[t];
  43222. e = Math.max(e, n.times[n.times.length - 1])
  43223. }
  43224. this.duration = e
  43225. },
  43226. trim: function() {
  43227. for (var e = 0; e < this.tracks.length; e++)
  43228. this.tracks[e].trim(0, this.duration);
  43229. return this
  43230. },
  43231. optimize: function() {
  43232. for (var e = 0; e < this.tracks.length; e++)
  43233. this.tracks[e].optimize();
  43234. return this
  43235. }
  43236. },
  43237. Object.assign(Ci.AnimationClip, {
  43238. parse: function(e) {
  43239. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43240. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43241. return new Ci.AnimationClip(e.name,e.duration,t)
  43242. },
  43243. toJSON: function(e) {
  43244. for (var t = [], i = e.tracks, n = {
  43245. name: e.name,
  43246. duration: e.duration,
  43247. tracks: t
  43248. }, r = 0, o = i.length; r !== o; ++r)
  43249. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43250. return n
  43251. },
  43252. CreateFromMorphTargetSequence: function(e, t, i) {
  43253. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43254. var a = []
  43255. , s = [];
  43256. a.push((o + n - 1) % n, o, (o + 1) % n),
  43257. s.push(0, 1, 0);
  43258. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43259. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43260. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43261. 0 === a[0] && (a.push(n),
  43262. s.push(s[0])),
  43263. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43264. }
  43265. return new Ci.AnimationClip(e,-1,r)
  43266. },
  43267. findByName: function(e, t) {
  43268. for (var i = 0; i < e.length; i++)
  43269. if (e[i].name === t)
  43270. return e[i];
  43271. return null
  43272. },
  43273. CreateClipsFromMorphTargetSequences: function(e, t) {
  43274. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43275. var a = e[r]
  43276. , s = a.name.match(n);
  43277. if (s && 1 < s.length) {
  43278. var l = i[h = s[1]];
  43279. l || (i[h] = l = []),
  43280. l.push(a)
  43281. }
  43282. }
  43283. var c = [];
  43284. for (var h in i)
  43285. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43286. return c
  43287. },
  43288. parseAnimation: function(e, t, i) {
  43289. if (!e)
  43290. return console.error(" no animation in JSONLoader data"),
  43291. null;
  43292. function n(e, t, i, n, r) {
  43293. if (0 !== i.length) {
  43294. var o = []
  43295. , a = [];
  43296. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43297. 0 !== o.length && r.push(new e(t,o,a))
  43298. }
  43299. }
  43300. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43301. var h = l[c].keys;
  43302. if (h && 0 != h.length)
  43303. if (h[0].morphTargets) {
  43304. for (var u = {}, d = 0; d < h.length; d++)
  43305. if (h[d].morphTargets)
  43306. for (var p = 0; p < h[d].morphTargets.length; p++)
  43307. u[h[d].morphTargets[p]] = -1;
  43308. for (var f in u) {
  43309. var g = []
  43310. , m = [];
  43311. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43312. var v = h[d];
  43313. g.push(v.time),
  43314. m.push(v.morphTarget === f ? 1 : 0)
  43315. }
  43316. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43317. }
  43318. a = u.length * (s || 1)
  43319. } else {
  43320. var y = ".bones[" + t[c].name + "]";
  43321. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43322. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43323. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43324. }
  43325. }
  43326. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43327. }
  43328. }),
  43329. Ci.AnimationMixer = function(e) {
  43330. this._root = e,
  43331. this._initMemoryManager(),
  43332. this._accuIndex = 0,
  43333. this.time = 0,
  43334. this.timeScale = 1
  43335. }
  43336. ,
  43337. Ci.AnimationMixer.prototype = {
  43338. constructor: Ci.AnimationMixer,
  43339. clipAction: function(e, t) {
  43340. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43341. if (void 0 !== a) {
  43342. var s = a.actionByRoot[n];
  43343. if (void 0 !== s)
  43344. return s;
  43345. if (o = (i = a.knownActions[0])._clip,
  43346. e !== r && e !== o)
  43347. throw new Error("Different clips with the same name detected!")
  43348. }
  43349. if (null === o)
  43350. return null;
  43351. var l = new Ci.AnimationMixer._Action(this,o,t);
  43352. return this._bindAction(l, i),
  43353. this._addInactiveAction(l, r, n),
  43354. l
  43355. },
  43356. existingAction: function(e, t) {
  43357. var i = (t || this._root).uuid
  43358. , n = "string" == typeof e ? e : e.name
  43359. , r = this._actionsByClip[n];
  43360. return void 0 !== r && r.actionByRoot[i] || null
  43361. },
  43362. stopAllAction: function() {
  43363. var e = this._actions
  43364. , t = this._nActiveActions
  43365. , i = this._bindings
  43366. , n = this._nActiveBindings;
  43367. this._nActiveActions = 0;
  43368. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43369. e[r].reset();
  43370. for (r = 0; r !== n; ++r)
  43371. i[r].useCount = 0;
  43372. return this
  43373. },
  43374. update: function(e) {
  43375. e *= this.timeScale;
  43376. 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) {
  43377. var s = t[a];
  43378. s.enabled && s._update(n, e, r, o)
  43379. }
  43380. var l = this._bindings
  43381. , c = this._nActiveBindings;
  43382. for (a = 0; a !== c; ++a)
  43383. l[a].apply(o);
  43384. return this
  43385. },
  43386. getRoot: function() {
  43387. return this._root
  43388. },
  43389. uncacheClip: function(e) {
  43390. var t = this._actions
  43391. , i = e.name
  43392. , n = this._actionsByClip
  43393. , r = n[i];
  43394. if (void 0 !== r) {
  43395. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43396. var l = o[a];
  43397. this._deactivateAction(l);
  43398. var c = l._cacheIndex
  43399. , h = t[t.length - 1];
  43400. l._cacheIndex = null,
  43401. l._byClipCacheIndex = null,
  43402. t[h._cacheIndex = c] = h,
  43403. t.pop(),
  43404. this._removeInactiveBindingsForAction(l)
  43405. }
  43406. delete n[i]
  43407. }
  43408. },
  43409. uncacheRoot: function(e) {
  43410. var t = e.uuid
  43411. , i = this._actionsByClip;
  43412. for (var n in i) {
  43413. var r = i[n].actionByRoot[t];
  43414. void 0 !== r && (this._deactivateAction(r),
  43415. this._removeInactiveAction(r))
  43416. }
  43417. var o = this._bindingsByRootAndName[t];
  43418. if (void 0 !== o)
  43419. for (var a in o) {
  43420. var s = o[a];
  43421. s.restoreOriginalState(),
  43422. this._removeInactiveBinding(s)
  43423. }
  43424. },
  43425. uncacheAction: function(e, t) {
  43426. var i = this.existingAction(e, t);
  43427. null !== i && (this._deactivateAction(i),
  43428. this._removeInactiveAction(i))
  43429. }
  43430. },
  43431. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43432. Ci.AnimationMixer._Action = function(e, t, i) {
  43433. this._mixer = e,
  43434. this._clip = t,
  43435. this._localRoot = i || null;
  43436. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43437. endingStart: Ci.ZeroCurvatureEnding,
  43438. endingEnd: Ci.ZeroCurvatureEnding
  43439. }, s = 0; s !== r; ++s) {
  43440. var l = n[s].createInterpolant(null);
  43441. (o[s] = l).settings = a
  43442. }
  43443. this._interpolantSettings = a,
  43444. this._interpolants = o,
  43445. this._propertyBindings = new Array(r),
  43446. this._cacheIndex = null,
  43447. this._byClipCacheIndex = null,
  43448. this._timeScaleInterpolant = null,
  43449. this._weightInterpolant = null,
  43450. this.loop = Ci.LoopRepeat,
  43451. this._loopCount = -1,
  43452. this._startTime = null,
  43453. this.time = 0,
  43454. this.timeScale = 1,
  43455. this._effectiveTimeScale = 1,
  43456. this.weight = 1,
  43457. this._effectiveWeight = 1,
  43458. this.repetitions = 1 / 0,
  43459. this.paused = !1,
  43460. this.enabled = !0,
  43461. this.clampWhenFinished = !1,
  43462. this.zeroSlopeAtStart = !0,
  43463. this.zeroSlopeAtEnd = !0
  43464. }
  43465. ,
  43466. Ci.AnimationMixer._Action.prototype = {
  43467. constructor: Ci.AnimationMixer._Action,
  43468. play: function() {
  43469. return this._mixer._activateAction(this),
  43470. this
  43471. },
  43472. stop: function() {
  43473. return this._mixer._deactivateAction(this),
  43474. this.reset()
  43475. },
  43476. reset: function() {
  43477. return this.paused = !1,
  43478. this.enabled = !0,
  43479. this.time = 0,
  43480. this._loopCount = -1,
  43481. this._startTime = null,
  43482. this.stopFading().stopWarping()
  43483. },
  43484. isRunning: function() {
  43485. return this._startTime,
  43486. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43487. },
  43488. isScheduled: function() {
  43489. return this._mixer._isActiveAction(this)
  43490. },
  43491. startAt: function(e) {
  43492. return this._startTime = e,
  43493. this
  43494. },
  43495. setLoop: function(e, t) {
  43496. return this.loop = e,
  43497. this.repetitions = t,
  43498. this
  43499. },
  43500. setEffectiveWeight: function(e) {
  43501. return this.weight = e,
  43502. this._effectiveWeight = this.enabled ? e : 0,
  43503. this.stopFading()
  43504. },
  43505. getEffectiveWeight: function() {
  43506. return this._effectiveWeight
  43507. },
  43508. fadeIn: function(e) {
  43509. return this._scheduleFading(e, 0, 1)
  43510. },
  43511. fadeOut: function(e) {
  43512. return this._scheduleFading(e, 1, 0)
  43513. },
  43514. crossFadeFrom: function(e, t, i) {
  43515. if (this._mixer,
  43516. e.fadeOut(t),
  43517. this.fadeIn(t),
  43518. i) {
  43519. var n = this._clip.duration
  43520. , r = e._clip.duration
  43521. , o = r / n
  43522. , a = n / r;
  43523. e.warp(1, o, t),
  43524. this.warp(a, 1, t)
  43525. }
  43526. return this
  43527. },
  43528. crossFadeTo: function(e, t, i) {
  43529. return e.crossFadeFrom(this, t, i)
  43530. },
  43531. stopFading: function() {
  43532. var e = this._weightInterpolant;
  43533. return null !== e && (this._weightInterpolant = null,
  43534. this._mixer._takeBackControlInterpolant(e)),
  43535. this
  43536. },
  43537. setEffectiveTimeScale: function(e) {
  43538. return this.timeScale = e,
  43539. this._effectiveTimeScale = this.paused ? 0 : e,
  43540. this.stopWarping()
  43541. },
  43542. getEffectiveTimeScale: function() {
  43543. return this._effectiveTimeScale
  43544. },
  43545. setDuration: function(e) {
  43546. return this.timeScale = this._clip.duration / e,
  43547. this.stopWarping()
  43548. },
  43549. syncWith: function(e) {
  43550. return this.time = e.time,
  43551. this.timeScale = e.timeScale,
  43552. this.stopWarping()
  43553. },
  43554. halt: function(e) {
  43555. return this.warp(this._currentTimeScale, 0, e)
  43556. },
  43557. warp: function(e, t, i) {
  43558. var n = this._mixer
  43559. , r = n.time
  43560. , o = this._timeScaleInterpolant
  43561. , a = this.timeScale;
  43562. null === o && (o = n._lendControlInterpolant(),
  43563. this._timeScaleInterpolant = o);
  43564. var s = o.parameterPositions
  43565. , l = o.sampleValues;
  43566. return s[0] = r,
  43567. s[1] = r + i,
  43568. l[0] = e / a,
  43569. l[1] = t / a,
  43570. this
  43571. },
  43572. stopWarping: function() {
  43573. var e = this._timeScaleInterpolant;
  43574. return null !== e && (this._timeScaleInterpolant = null,
  43575. this._mixer._takeBackControlInterpolant(e)),
  43576. this
  43577. },
  43578. getMixer: function() {
  43579. return this._mixer
  43580. },
  43581. getClip: function() {
  43582. return this._clip
  43583. },
  43584. getRoot: function() {
  43585. return this._localRoot || this._mixer._root
  43586. },
  43587. _update: function(e, t, i, n) {
  43588. var r = this._startTime;
  43589. if (null !== r) {
  43590. var o = (e - r) * i;
  43591. if (o < 0 || 0 === i)
  43592. return;
  43593. this._startTime = null,
  43594. t = i * o
  43595. }
  43596. t *= this._updateTimeScale(e);
  43597. var a = this._updateTime(t)
  43598. , s = this._updateWeight(e);
  43599. if (0 < s)
  43600. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43601. l[h].evaluate(a),
  43602. c[h].accumulate(n, s)
  43603. },
  43604. _updateWeight: function(e) {
  43605. var t = 0;
  43606. if (this.enabled) {
  43607. t = this.weight;
  43608. var i = this._weightInterpolant;
  43609. if (null !== i) {
  43610. var n = i.evaluate(e)[0];
  43611. t *= n,
  43612. e > i.parameterPositions[1] && (this.stopFading(),
  43613. 0 === n && (this.enabled = !1))
  43614. }
  43615. }
  43616. return this._effectiveWeight = t
  43617. },
  43618. _updateTimeScale: function(e) {
  43619. var t = 0;
  43620. if (!this.paused) {
  43621. t = this.timeScale;
  43622. var i = this._timeScaleInterpolant;
  43623. if (null !== i)
  43624. t *= i.evaluate(e)[0],
  43625. e > i.parameterPositions[1] && (this.stopWarping(),
  43626. 0 === t ? this.pause = !0 : this.timeScale = t)
  43627. }
  43628. return this._effectiveTimeScale = t
  43629. },
  43630. _updateTime: function(e) {
  43631. var t = this.time + e;
  43632. if (0 === e)
  43633. return t;
  43634. var i = this._clip.duration
  43635. , n = this.loop
  43636. , r = this._loopCount
  43637. , o = !1;
  43638. switch (n) {
  43639. case Ci.LoopOnce:
  43640. if (-1 === r && (this.loopCount = 0,
  43641. this._setEndings(!0, !0, !1)),
  43642. i <= t)
  43643. t = i;
  43644. else {
  43645. if (!(t < 0))
  43646. break;
  43647. t = 0
  43648. }
  43649. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43650. this._mixer.dispatchEvent({
  43651. type: "finished",
  43652. action: this,
  43653. direction: e < 0 ? -1 : 1
  43654. });
  43655. break;
  43656. case Ci.LoopPingPong:
  43657. o = !0;
  43658. case Ci.LoopRepeat:
  43659. if (-1 === r && (0 < e ? (r = 0,
  43660. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43661. i <= t || t < 0) {
  43662. var a = Math.floor(t / i);
  43663. t -= i * a,
  43664. r += Math.abs(a);
  43665. var s = this.repetitions - r;
  43666. if (s < 0) {
  43667. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43668. t = 0 < e ? i : 0,
  43669. this._mixer.dispatchEvent({
  43670. type: "finished",
  43671. action: this,
  43672. direction: 0 < e ? 1 : -1
  43673. });
  43674. break
  43675. }
  43676. if (0 == s) {
  43677. var l = e < 0;
  43678. this._setEndings(l, !l, o)
  43679. } else
  43680. this._setEndings(!1, !1, o);
  43681. this._loopCount = r,
  43682. this._mixer.dispatchEvent({
  43683. type: "loop",
  43684. action: this,
  43685. loopDelta: a
  43686. })
  43687. }
  43688. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43689. return i - (this.time = t)
  43690. }
  43691. return this.time = t
  43692. },
  43693. _setEndings: function(e, t, i) {
  43694. var n = this._interpolantSettings;
  43695. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43696. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43697. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43698. },
  43699. _scheduleFading: function(e, t, i) {
  43700. var n = this._mixer
  43701. , r = n.time
  43702. , o = this._weightInterpolant;
  43703. null === o && (o = n._lendControlInterpolant(),
  43704. this._weightInterpolant = o);
  43705. var a = o.parameterPositions
  43706. , s = o.sampleValues;
  43707. return a[0] = r,
  43708. s[0] = t,
  43709. a[1] = r + e,
  43710. s[1] = i,
  43711. this
  43712. }
  43713. },
  43714. Object.assign(Ci.AnimationMixer.prototype, {
  43715. _bindAction: function(e, t) {
  43716. var i = e._localRoot || this._root
  43717. , n = e._clip.tracks
  43718. , r = n.length
  43719. , o = e._propertyBindings
  43720. , a = e._interpolants
  43721. , s = i.uuid
  43722. , l = this._bindingsByRootAndName
  43723. , c = l[s];
  43724. void 0 === c && (c = {},
  43725. l[s] = c);
  43726. for (var h = 0; h !== r; ++h) {
  43727. var u = n[h]
  43728. , d = u.name
  43729. , p = c[d];
  43730. if (void 0 !== p)
  43731. o[h] = p;
  43732. else {
  43733. if (void 0 !== (p = o[h])) {
  43734. null === p._cacheIndex && (++p.referenceCount,
  43735. this._addInactiveBinding(p, s, d));
  43736. continue
  43737. }
  43738. var f = t && t._propertyBindings[h].binding.parsedPath;
  43739. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43740. this._addInactiveBinding(p, s, d),
  43741. o[h] = p
  43742. }
  43743. a[h].resultBuffer = p.buffer
  43744. }
  43745. },
  43746. _activateAction: function(e) {
  43747. if (!this._isActiveAction(e)) {
  43748. if (null === e._cacheIndex) {
  43749. var t = (e._localRoot || this._root).uuid
  43750. , i = e._clip.name
  43751. , n = this._actionsByClip[i];
  43752. this._bindAction(e, n && n.knownActions[0]),
  43753. this._addInactiveAction(e, i, t)
  43754. }
  43755. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43756. var s = r[o];
  43757. 0 == s.useCount++ && (this._lendBinding(s),
  43758. s.saveOriginalState())
  43759. }
  43760. this._lendAction(e)
  43761. }
  43762. },
  43763. _deactivateAction: function(e) {
  43764. if (this._isActiveAction(e)) {
  43765. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43766. var r = t[i];
  43767. 0 == --r.useCount && (r.restoreOriginalState(),
  43768. this._takeBackBinding(r))
  43769. }
  43770. this._takeBackAction(e)
  43771. }
  43772. },
  43773. _initMemoryManager: function() {
  43774. this._actions = [],
  43775. this._nActiveActions = 0,
  43776. this._actionsByClip = {},
  43777. this._bindings = [],
  43778. this._nActiveBindings = 0,
  43779. this._bindingsByRootAndName = {},
  43780. this._controlInterpolants = [],
  43781. this._nActiveControlInterpolants = 0;
  43782. var e = this;
  43783. this.stats = {
  43784. actions: {
  43785. get total() {
  43786. return e._actions.length
  43787. },
  43788. get inUse() {
  43789. return e._nActiveActions
  43790. }
  43791. },
  43792. bindings: {
  43793. get total() {
  43794. return e._bindings.length
  43795. },
  43796. get inUse() {
  43797. return e._nActiveBindings
  43798. }
  43799. },
  43800. controlInterpolants: {
  43801. get total() {
  43802. return e._controlInterpolants.length
  43803. },
  43804. get inUse() {
  43805. return e._nActiveControlInterpolants
  43806. }
  43807. }
  43808. }
  43809. },
  43810. _isActiveAction: function(e) {
  43811. var t = e._cacheIndex;
  43812. return null !== t && t < this._nActiveActions
  43813. },
  43814. _addInactiveAction: function(e, t, i) {
  43815. var n = this._actions
  43816. , r = this._actionsByClip
  43817. , o = r[t];
  43818. if (void 0 === o)
  43819. o = {
  43820. knownActions: [e],
  43821. actionByRoot: {}
  43822. },
  43823. e._byClipCacheIndex = 0,
  43824. r[t] = o;
  43825. else {
  43826. var a = o.knownActions;
  43827. e._byClipCacheIndex = a.length,
  43828. a.push(e)
  43829. }
  43830. e._cacheIndex = n.length,
  43831. n.push(e),
  43832. o.actionByRoot[i] = e
  43833. },
  43834. _removeInactiveAction: function(e) {
  43835. var t = this._actions
  43836. , i = t[t.length - 1]
  43837. , n = e._cacheIndex;
  43838. t[i._cacheIndex = n] = i,
  43839. t.pop(),
  43840. e._cacheIndex = null;
  43841. var r = e._clip.name
  43842. , o = this._actionsByClip
  43843. , a = o[r]
  43844. , s = a.knownActions
  43845. , l = s[s.length - 1]
  43846. , c = e._byClipCacheIndex;
  43847. s[l._byClipCacheIndex = c] = l,
  43848. s.pop(),
  43849. e._byClipCacheIndex = null,
  43850. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43851. 0 === s.length && delete o[r],
  43852. this._removeInactiveBindingsForAction(e)
  43853. },
  43854. _removeInactiveBindingsForAction: function(e) {
  43855. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43856. var r = t[i];
  43857. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43858. }
  43859. },
  43860. _lendAction: function(e) {
  43861. var t = this._actions
  43862. , i = e._cacheIndex
  43863. , n = this._nActiveActions++
  43864. , r = t[n];
  43865. t[e._cacheIndex = n] = e,
  43866. t[r._cacheIndex = i] = r
  43867. },
  43868. _takeBackAction: function(e) {
  43869. var t = this._actions
  43870. , i = e._cacheIndex
  43871. , n = --this._nActiveActions
  43872. , r = t[n];
  43873. t[e._cacheIndex = n] = e,
  43874. t[r._cacheIndex = i] = r
  43875. },
  43876. _addInactiveBinding: function(e, t, i) {
  43877. var n = this._bindingsByRootAndName
  43878. , r = n[t]
  43879. , o = this._bindings;
  43880. void 0 === r && (r = {},
  43881. n[t] = r),
  43882. (r[i] = e)._cacheIndex = o.length,
  43883. o.push(e)
  43884. },
  43885. _removeInactiveBinding: function(e) {
  43886. var t = this._bindings
  43887. , i = e.binding
  43888. , n = i.rootNode.uuid
  43889. , r = i.path
  43890. , o = this._bindingsByRootAndName
  43891. , a = o[n]
  43892. , s = t[t.length - 1]
  43893. , l = e._cacheIndex;
  43894. t[s._cacheIndex = l] = s,
  43895. t.pop(),
  43896. delete a[r];
  43897. e: {
  43898. for (var c in a)
  43899. break e;
  43900. delete o[n]
  43901. }
  43902. },
  43903. _lendBinding: function(e) {
  43904. var t = this._bindings
  43905. , i = e._cacheIndex
  43906. , n = this._nActiveBindings++
  43907. , r = t[n];
  43908. t[e._cacheIndex = n] = e,
  43909. t[r._cacheIndex = i] = r
  43910. },
  43911. _takeBackBinding: function(e) {
  43912. var t = this._bindings
  43913. , i = e._cacheIndex
  43914. , n = --this._nActiveBindings
  43915. , r = t[n];
  43916. t[e._cacheIndex = n] = e,
  43917. t[r._cacheIndex = i] = r
  43918. },
  43919. _lendControlInterpolant: function() {
  43920. var e = this._controlInterpolants
  43921. , t = this._nActiveControlInterpolants++
  43922. , i = e[t];
  43923. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43924. i
  43925. },
  43926. _takeBackControlInterpolant: function(e) {
  43927. var t = this._controlInterpolants
  43928. , i = e.__cacheIndex
  43929. , n = --this._nActiveControlInterpolants
  43930. , r = t[n];
  43931. t[e.__cacheIndex = n] = e,
  43932. t[r.__cacheIndex = i] = r
  43933. },
  43934. _controlInterpolantsResultBuffer: new Float32Array(1)
  43935. }),
  43936. Ci.AnimationObjectGroup = function(e) {
  43937. this.uuid = Ci.Math.generateUUID(),
  43938. this._objects = Array.prototype.slice.call(arguments),
  43939. this.nCachedObjects_ = 0;
  43940. var t = {};
  43941. this._indicesByUUID = t;
  43942. for (var i = 0, n = arguments.length; i !== n; ++i)
  43943. t[arguments[i].uuid] = i;
  43944. this._paths = [],
  43945. this._parsedPaths = [],
  43946. this._bindings = [],
  43947. this._bindingsIndicesByPath = {};
  43948. var r = this;
  43949. this.stats = {
  43950. objects: {
  43951. get total() {
  43952. return r._objects.length
  43953. },
  43954. get inUse() {
  43955. return this.total - r.nCachedObjects_
  43956. }
  43957. },
  43958. get bindingsPerObject() {
  43959. return r._bindings.length
  43960. }
  43961. }
  43962. }
  43963. ,
  43964. Ci.AnimationObjectGroup.prototype = {
  43965. constructor: Ci.AnimationObjectGroup,
  43966. add: function(e) {
  43967. 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) {
  43968. var u = arguments[c]
  43969. , d = u.uuid
  43970. , p = r[d];
  43971. if (void 0 === p) {
  43972. p = i++,
  43973. r[d] = p,
  43974. t.push(u);
  43975. for (var f = 0, g = l; f !== g; ++f)
  43976. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43977. } else if (p < n) {
  43978. var m = t[p]
  43979. , v = --n
  43980. , y = t[v];
  43981. t[r[y.uuid] = p] = y,
  43982. t[r[d] = v] = u;
  43983. for (f = 0,
  43984. g = l; f !== g; ++f) {
  43985. var A = s[f]
  43986. , C = A[v]
  43987. , I = A[p];
  43988. A[p] = C,
  43989. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43990. A[v] = I
  43991. }
  43992. } else
  43993. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43994. }
  43995. this.nCachedObjects_ = n
  43996. },
  43997. remove: function(e) {
  43998. for (var t = this._objects, i = (t.length,
  43999. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  44000. var l = arguments[a]
  44001. , c = l.uuid
  44002. , h = n[c];
  44003. if (void 0 !== h && i <= h) {
  44004. var u = i++
  44005. , d = t[u];
  44006. t[n[d.uuid] = h] = d,
  44007. t[n[c] = u] = l;
  44008. for (var p = 0, f = o; p !== f; ++p) {
  44009. var g = r[p]
  44010. , m = g[u]
  44011. , v = g[h];
  44012. g[h] = m,
  44013. g[u] = v
  44014. }
  44015. }
  44016. }
  44017. this.nCachedObjects_ = i
  44018. },
  44019. uncache: function(e) {
  44020. 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) {
  44021. var c = arguments[s].uuid
  44022. , h = r[c];
  44023. if (void 0 !== h)
  44024. if (delete r[c],
  44025. h < n) {
  44026. var u = --n
  44027. , d = t[u]
  44028. , p = t[y = --i];
  44029. t[r[d.uuid] = h] = d,
  44030. t[r[p.uuid] = u] = p,
  44031. t.pop();
  44032. for (var f = 0, g = a; f !== g; ++f) {
  44033. var m = (A = o[f])[u]
  44034. , v = A[y];
  44035. A[h] = m,
  44036. A[u] = v,
  44037. A.pop()
  44038. }
  44039. } else {
  44040. var y;
  44041. t[r[(p = t[y = --i]).uuid] = h] = p,
  44042. t.pop();
  44043. for (f = 0,
  44044. g = a; f !== g; ++f) {
  44045. var A;
  44046. (A = o[f])[h] = A[y],
  44047. A.pop()
  44048. }
  44049. }
  44050. }
  44051. this.nCachedObjects_ = n
  44052. },
  44053. subscribe_: function(e, t) {
  44054. var i = this._bindingsIndicesByPath
  44055. , n = i[e]
  44056. , r = this._bindings;
  44057. if (void 0 !== n)
  44058. return r[n];
  44059. var o = this._paths
  44060. , a = this._parsedPaths
  44061. , s = this._objects
  44062. , l = s.length
  44063. , c = this.nCachedObjects_
  44064. , h = new Array(l);
  44065. n = r.length,
  44066. i[e] = n,
  44067. o.push(e),
  44068. a.push(t),
  44069. r.push(h);
  44070. for (var u = c, d = s.length; u !== d; ++u) {
  44071. var p = s[u];
  44072. h[u] = new Ci.PropertyBinding(p,e,t)
  44073. }
  44074. return h
  44075. },
  44076. unsubscribe_: function(e) {
  44077. var t = this._bindingsIndicesByPath
  44078. , i = t[e];
  44079. if (void 0 !== i) {
  44080. var n = this._paths
  44081. , r = this._parsedPaths
  44082. , o = this._bindings
  44083. , a = o.length - 1
  44084. , s = o[a];
  44085. o[t[e[a]] = i] = s,
  44086. o.pop(),
  44087. r[i] = r[a],
  44088. r.pop(),
  44089. n[i] = n[a],
  44090. n.pop()
  44091. }
  44092. }
  44093. },
  44094. Ci.AnimationUtils = {
  44095. arraySlice: function(e, t, i) {
  44096. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44097. },
  44098. convertArray: function(e, t, i) {
  44099. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44100. },
  44101. isTypedArray: function(e) {
  44102. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44103. },
  44104. getKeyframeOrder: function(i) {
  44105. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  44106. t[n] = n;
  44107. return t.sort(function(e, t) {
  44108. return i[e] - i[t]
  44109. }),
  44110. t
  44111. },
  44112. sortedArray: function(e, t, i) {
  44113. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44114. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44115. r[a++] = e[s + l];
  44116. return r
  44117. },
  44118. flattenJSON: function(e, t, i, n) {
  44119. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44120. o = e[r++];
  44121. if (void 0 !== o) {
  44122. var a = o[n];
  44123. if (void 0 !== a)
  44124. if (Array.isArray(a))
  44125. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44126. i.push.apply(i, a)),
  44127. void 0 !== (o = e[r++]); )
  44128. ;
  44129. else if (void 0 !== a.toArray)
  44130. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44131. a.toArray(i, i.length)),
  44132. void 0 !== (o = e[r++]); )
  44133. ;
  44134. else
  44135. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44136. i.push(a)),
  44137. void 0 !== (o = e[r++]); )
  44138. ;
  44139. }
  44140. }
  44141. },
  44142. Ci.KeyframeTrack = function(e, t, i, n) {
  44143. if (void 0 === e)
  44144. throw new Error("track name is undefined");
  44145. if (void 0 === t || 0 === t.length)
  44146. throw new Error("no keyframes in track named " + e);
  44147. this.name = e,
  44148. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  44149. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  44150. this.setInterpolation(n || this.DefaultInterpolation),
  44151. this.validate(),
  44152. this.optimize()
  44153. }
  44154. ,
  44155. Ci.KeyframeTrack.prototype = {
  44156. constructor: Ci.KeyframeTrack,
  44157. TimeBufferType: Float32Array,
  44158. ValueBufferType: Float32Array,
  44159. DefaultInterpolation: Ci.InterpolateLinear,
  44160. InterpolantFactoryMethodDiscrete: function(e) {
  44161. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44162. },
  44163. InterpolantFactoryMethodLinear: function(e) {
  44164. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44165. },
  44166. InterpolantFactoryMethodSmooth: function(e) {
  44167. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44168. },
  44169. setInterpolation: function(e) {
  44170. var t = void 0;
  44171. switch (e) {
  44172. case Ci.InterpolateDiscrete:
  44173. t = this.InterpolantFactoryMethodDiscrete;
  44174. break;
  44175. case Ci.InterpolateLinear:
  44176. t = this.InterpolantFactoryMethodLinear;
  44177. break;
  44178. case Ci.InterpolateSmooth:
  44179. t = this.InterpolantFactoryMethodSmooth
  44180. }
  44181. if (void 0 !== t)
  44182. this.createInterpolant = t;
  44183. else {
  44184. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44185. if (void 0 === this.createInterpolant) {
  44186. if (e === this.DefaultInterpolation)
  44187. throw new Error(i);
  44188. this.setInterpolation(this.DefaultInterpolation)
  44189. }
  44190. console.warn(i)
  44191. }
  44192. },
  44193. getInterpolation: function() {
  44194. switch (this.createInterpolant) {
  44195. case this.InterpolantFactoryMethodDiscrete:
  44196. return Ci.InterpolateDiscrete;
  44197. case this.InterpolantFactoryMethodLinear:
  44198. return Ci.InterpolateLinear;
  44199. case this.InterpolantFactoryMethodSmooth:
  44200. return Ci.InterpolateSmooth
  44201. }
  44202. },
  44203. getValueSize: function() {
  44204. return this.values.length / this.times.length
  44205. },
  44206. shift: function(e) {
  44207. if (0 !== e)
  44208. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44209. t[i] += e;
  44210. return this
  44211. },
  44212. scale: function(e) {
  44213. if (1 !== e)
  44214. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44215. t[i] *= e;
  44216. return this
  44217. },
  44218. trim: function(e, t) {
  44219. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44220. ++r;
  44221. for (; -1 !== o && i[o] > t; )
  44222. --o;
  44223. if (++o,
  44224. 0 !== r || o !== n) {
  44225. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44226. var a = this.getValueSize();
  44227. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44228. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44229. }
  44230. return this
  44231. },
  44232. validate: function() {
  44233. var e = !0
  44234. , t = this.getValueSize();
  44235. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44236. e = !1);
  44237. var i = this.times
  44238. , n = this.values
  44239. , r = i.length;
  44240. 0 === r && (console.error("track is empty", this),
  44241. e = !1);
  44242. for (var o = null, a = 0; a !== r; a++) {
  44243. var s = i[a];
  44244. if ("number" == typeof s && isNaN(s)) {
  44245. console.error("time is not a valid number", this, a, s),
  44246. e = !1;
  44247. break
  44248. }
  44249. if (null !== o && s < o) {
  44250. console.error("out of order keys", this, a, s, o),
  44251. e = !1;
  44252. break
  44253. }
  44254. o = s
  44255. }
  44256. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44257. a = 0;
  44258. for (var l = n.length; a !== l; ++a) {
  44259. var c = n[a];
  44260. if (isNaN(c)) {
  44261. console.error("value is not a valid number", this, a, c),
  44262. e = !1;
  44263. break
  44264. }
  44265. }
  44266. }
  44267. return e
  44268. },
  44269. optimize: function() {
  44270. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44271. var a = !1
  44272. , s = e[r];
  44273. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44274. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44275. var d = t[l + u];
  44276. if (d !== t[c + u] || d !== t[h + u]) {
  44277. a = !0;
  44278. break
  44279. }
  44280. }
  44281. if (a) {
  44282. if (r !== n) {
  44283. e[n] = e[r];
  44284. var p = r * i
  44285. , f = n * i;
  44286. for (u = 0; u !== i; ++u)
  44287. t[f + u] = t[p + u]
  44288. }
  44289. ++n
  44290. }
  44291. }
  44292. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44293. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44294. this
  44295. }
  44296. },
  44297. Object.assign(Ci.KeyframeTrack, {
  44298. parse: function(e) {
  44299. if (void 0 === e.type)
  44300. throw new Error("track type undefined, can not parse");
  44301. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44302. if (void 0 === e.times) {
  44303. console.warn("legacy JSON format detected, converting");
  44304. var i = []
  44305. , n = [];
  44306. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44307. e.times = i,
  44308. e.values = n
  44309. }
  44310. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44311. },
  44312. toJSON: function(e) {
  44313. var t, i = e.constructor;
  44314. if (void 0 !== i.toJSON)
  44315. t = i.toJSON(e);
  44316. else {
  44317. t = {
  44318. name: e.name,
  44319. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44320. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44321. };
  44322. var n = e.getInterpolation();
  44323. n !== e.DefaultInterpolation && (t.interpolation = n)
  44324. }
  44325. return t.type = e.ValueTypeName,
  44326. t
  44327. },
  44328. _getTrackTypeForValueTypeName: function(e) {
  44329. switch (e.toLowerCase()) {
  44330. case "scalar":
  44331. case "double":
  44332. case "float":
  44333. case "number":
  44334. case "integer":
  44335. return Ci.NumberKeyframeTrack;
  44336. case "vector":
  44337. case "vector2":
  44338. case "vector3":
  44339. case "vector4":
  44340. return Ci.VectorKeyframeTrack;
  44341. case "color":
  44342. return Ci.ColorKeyframeTrack;
  44343. case "quaternion":
  44344. return Ci.QuaternionKeyframeTrack;
  44345. case "bool":
  44346. case "boolean":
  44347. return Ci.BooleanKeyframeTrack;
  44348. case "string":
  44349. return Ci.StringKeyframeTrack
  44350. }
  44351. throw new Error("Unsupported typeName: " + e)
  44352. }
  44353. }),
  44354. Ci.PropertyBinding = function(e, t, i) {
  44355. this.path = t,
  44356. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44357. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44358. this.rootNode = e
  44359. }
  44360. ,
  44361. Ci.PropertyBinding.prototype = {
  44362. constructor: Ci.PropertyBinding,
  44363. getValue: function(e, t) {
  44364. this.bind(),
  44365. this.getValue(e, t)
  44366. },
  44367. setValue: function(e, t) {
  44368. this.bind(),
  44369. this.setValue(e, t)
  44370. },
  44371. bind: function() {
  44372. var e = this.node
  44373. , t = this.parsedPath
  44374. , i = t.objectName
  44375. , n = t.propertyName
  44376. , r = t.propertyIndex;
  44377. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44378. this.node = e),
  44379. this.getValue = this._getValue_unavailable,
  44380. this.setValue = this._setValue_unavailable,
  44381. e) {
  44382. if (i) {
  44383. var o = t.objectIndex;
  44384. switch (i) {
  44385. case "materials":
  44386. if (!e.material)
  44387. return void console.error(" can not bind to material as node does not have a material", this);
  44388. if (!e.material.materials)
  44389. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44390. e = e.material.materials;
  44391. break;
  44392. case "bones":
  44393. if (!e.skeleton)
  44394. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44395. e = e.skeleton.bones;
  44396. for (var a = 0; a < e.length; a++)
  44397. if (e[a].name === o) {
  44398. o = a;
  44399. break
  44400. }
  44401. break;
  44402. default:
  44403. if (void 0 === e[i])
  44404. return void console.error(" can not bind to objectName of node, undefined", this);
  44405. e = e[i]
  44406. }
  44407. if (void 0 !== o) {
  44408. if (void 0 === e[o])
  44409. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44410. e = e[o]
  44411. }
  44412. }
  44413. var s = e[n];
  44414. if (s) {
  44415. var l = this.Versioning.None;
  44416. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44417. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44418. this.targetObject = e);
  44419. var c = this.BindingType.Direct;
  44420. if (void 0 !== r) {
  44421. if ("morphTargetInfluences" === n) {
  44422. if (!e.geometry)
  44423. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44424. if (!e.geometry.morphTargets)
  44425. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44426. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44427. if (e.geometry.morphTargets[a].name === r) {
  44428. r = a;
  44429. break
  44430. }
  44431. }
  44432. c = this.BindingType.ArrayElement,
  44433. this.resolvedProperty = s,
  44434. this.propertyIndex = r
  44435. } else
  44436. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44437. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44438. this.resolvedProperty = s) : this.propertyName = n;
  44439. this.getValue = this.GetterByBindingType[c],
  44440. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44441. } else {
  44442. var h = t.nodeName;
  44443. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44444. }
  44445. } else
  44446. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44447. },
  44448. unbind: function() {
  44449. this.node = null,
  44450. this.getValue = this._getValue_unbound,
  44451. this.setValue = this._setValue_unbound
  44452. }
  44453. },
  44454. Object.assign(Ci.PropertyBinding.prototype, {
  44455. _getValue_unavailable: function() {},
  44456. _setValue_unavailable: function() {},
  44457. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44458. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44459. BindingType: {
  44460. Direct: 0,
  44461. EntireArray: 1,
  44462. ArrayElement: 2,
  44463. HasFromToArray: 3
  44464. },
  44465. Versioning: {
  44466. None: 0,
  44467. NeedsUpdate: 1,
  44468. MatrixWorldNeedsUpdate: 2
  44469. },
  44470. GetterByBindingType: [function(e, t) {
  44471. e[t] = this.node[this.propertyName]
  44472. }
  44473. , function(e, t) {
  44474. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44475. e[t++] = i[n]
  44476. }
  44477. , function(e, t) {
  44478. e[t] = this.resolvedProperty[this.propertyIndex]
  44479. }
  44480. , function(e, t) {
  44481. this.resolvedProperty.toArray(e, t)
  44482. }
  44483. ],
  44484. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44485. this.node[this.propertyName] = e[t]
  44486. }
  44487. , function(e, t) {
  44488. this.node[this.propertyName] = e[t],
  44489. this.targetObject.needsUpdate = !0
  44490. }
  44491. , function(e, t) {
  44492. this.node[this.propertyName] = e[t],
  44493. this.targetObject.matrixWorldNeedsUpdate = !0
  44494. }
  44495. ], [function(e, t) {
  44496. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44497. i[n] = e[t++]
  44498. }
  44499. , function(e, t) {
  44500. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44501. i[n] = e[t++];
  44502. this.targetObject.needsUpdate = !0
  44503. }
  44504. , function(e, t) {
  44505. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44506. i[n] = e[t++];
  44507. this.targetObject.matrixWorldNeedsUpdate = !0
  44508. }
  44509. ], [function(e, t) {
  44510. this.resolvedProperty[this.propertyIndex] = e[t]
  44511. }
  44512. , function(e, t) {
  44513. this.resolvedProperty[this.propertyIndex] = e[t],
  44514. this.targetObject.needsUpdate = !0
  44515. }
  44516. , function(e, t) {
  44517. this.resolvedProperty[this.propertyIndex] = e[t],
  44518. this.targetObject.matrixWorldNeedsUpdate = !0
  44519. }
  44520. ], [function(e, t) {
  44521. this.resolvedProperty.fromArray(e, t)
  44522. }
  44523. , function(e, t) {
  44524. this.resolvedProperty.fromArray(e, t),
  44525. this.targetObject.needsUpdate = !0
  44526. }
  44527. , function(e, t) {
  44528. this.resolvedProperty.fromArray(e, t),
  44529. this.targetObject.matrixWorldNeedsUpdate = !0
  44530. }
  44531. ]]
  44532. }),
  44533. Ci.PropertyBinding.Composite = function(e, t, i) {
  44534. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44535. this._targetGroup = e,
  44536. this._bindings = e.subscribe_(t, n)
  44537. }
  44538. ,
  44539. Ci.PropertyBinding.Composite.prototype = {
  44540. constructor: Ci.PropertyBinding.Composite,
  44541. getValue: function(e, t) {
  44542. this.bind();
  44543. var i = this._targetGroup.nCachedObjects_
  44544. , n = this._bindings[i];
  44545. void 0 !== n && n.getValue(e, t)
  44546. },
  44547. setValue: function(e, t) {
  44548. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44549. i[n].setValue(e, t)
  44550. },
  44551. bind: function() {
  44552. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44553. e[t].bind()
  44554. },
  44555. unbind: function() {
  44556. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44557. e[t].unbind()
  44558. }
  44559. },
  44560. Ci.PropertyBinding.create = function(e, t, i) {
  44561. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44562. }
  44563. ,
  44564. Ci.PropertyBinding.parseTrackName = function(e) {
  44565. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44566. , i = t.exec(e);
  44567. if (!i)
  44568. throw new Error("cannot parse trackName at all: " + e);
  44569. i.index === t.lastIndex && t.lastIndex++;
  44570. var n = {
  44571. nodeName: i[3],
  44572. objectName: i[5],
  44573. objectIndex: i[7],
  44574. propertyName: i[9],
  44575. propertyIndex: i[11]
  44576. };
  44577. if (null === n.propertyName || 0 === n.propertyName.length)
  44578. throw new Error("can not parse propertyName from trackName: " + e);
  44579. return n
  44580. }
  44581. ,
  44582. Ci.PropertyBinding.findNode = function(e, r) {
  44583. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44584. return e;
  44585. if (e.skeleton) {
  44586. var t = function(e) {
  44587. for (var t = 0; t < e.bones.length; t++) {
  44588. var i = e.bones[t];
  44589. if (i.name === r)
  44590. return i
  44591. }
  44592. return null
  44593. }(e.skeleton);
  44594. if (t)
  44595. return t
  44596. }
  44597. if (e.children) {
  44598. var o = function(e) {
  44599. for (var t = 0; t < e.length; t++) {
  44600. var i = e[t];
  44601. if (i.name === r || i.uuid === r)
  44602. return i;
  44603. var n = o(i.children);
  44604. if (n)
  44605. return n
  44606. }
  44607. return null
  44608. }
  44609. , i = o(e.children);
  44610. if (i)
  44611. return i
  44612. }
  44613. return null
  44614. }
  44615. ,
  44616. Ci.PropertyMixer = function(e, t, i) {
  44617. this.binding = e,
  44618. this.valueSize = i;
  44619. var n, r = Float64Array;
  44620. switch (t) {
  44621. case "quaternion":
  44622. n = this._slerp;
  44623. break;
  44624. case "string":
  44625. case "bool":
  44626. r = Array,
  44627. n = this._select;
  44628. break;
  44629. default:
  44630. n = this._lerp
  44631. }
  44632. this.buffer = new r(4 * i),
  44633. this._mixBufferRegion = n,
  44634. this.cumulativeWeight = 0,
  44635. this.useCount = 0,
  44636. this.referenceCount = 0
  44637. }
  44638. ,
  44639. Ci.PropertyMixer.prototype = {
  44640. constructor: Ci.PropertyMixer,
  44641. accumulate: function(e, t) {
  44642. var i = this.buffer
  44643. , n = this.valueSize
  44644. , r = e * n + n
  44645. , o = this.cumulativeWeight;
  44646. if (0 === o) {
  44647. for (var a = 0; a !== n; ++a)
  44648. i[r + a] = i[a];
  44649. o = t
  44650. } else {
  44651. var s = t / (o += t);
  44652. this._mixBufferRegion(i, r, 0, s, n)
  44653. }
  44654. this.cumulativeWeight = o
  44655. },
  44656. apply: function(e) {
  44657. var t = this.valueSize
  44658. , i = this.buffer
  44659. , n = e * t + t
  44660. , r = this.cumulativeWeight
  44661. , o = this.binding;
  44662. if (this.cumulativeWeight = 0,
  44663. r < 1) {
  44664. var a = 3 * t;
  44665. this._mixBufferRegion(i, n, a, 1 - r, t)
  44666. }
  44667. for (var s = t, l = t + t; s !== l; ++s)
  44668. if (i[s] !== i[s + t]) {
  44669. o.setValue(i, n);
  44670. break
  44671. }
  44672. },
  44673. saveOriginalState: function() {
  44674. var e = this.binding
  44675. , t = this.buffer
  44676. , i = this.valueSize
  44677. , n = 3 * i;
  44678. e.getValue(t, n);
  44679. for (var r = i, o = n; r !== o; ++r)
  44680. t[r] = t[n + r % i];
  44681. this.cumulativeWeight = 0
  44682. },
  44683. restoreOriginalState: function() {
  44684. var e = 3 * this.valueSize;
  44685. this.binding.setValue(this.buffer, e)
  44686. },
  44687. _select: function(e, t, i, n, r) {
  44688. if (.5 <= n)
  44689. for (var o = 0; o !== r; ++o)
  44690. e[t + o] = e[i + o]
  44691. },
  44692. _slerp: function(e, t, i, n, r) {
  44693. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44694. },
  44695. _lerp: function(e, t, i, n, r) {
  44696. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44697. var s = t + a;
  44698. e[s] = e[s] * o + e[i + a] * n
  44699. }
  44700. }
  44701. },
  44702. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44703. Ci.KeyframeTrack.call(this, e, t, i)
  44704. }
  44705. ,
  44706. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44707. constructor: Ci.BooleanKeyframeTrack,
  44708. ValueTypeName: "bool",
  44709. ValueBufferType: Array,
  44710. DefaultInterpolation: Ci.IntepolateDiscrete,
  44711. InterpolantFactoryMethodLinear: void 0,
  44712. InterpolantFactoryMethodSmooth: void 0
  44713. }),
  44714. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44715. Ci.KeyframeTrack.call(this, e, t, i, n)
  44716. }
  44717. ,
  44718. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44719. constructor: Ci.NumberKeyframeTrack,
  44720. ValueTypeName: "number"
  44721. }),
  44722. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44723. Ci.KeyframeTrack.call(this, e, t, i, n)
  44724. }
  44725. ,
  44726. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44727. constructor: Ci.QuaternionKeyframeTrack,
  44728. ValueTypeName: "quaternion",
  44729. DefaultInterpolation: Ci.InterpolateLinear,
  44730. InterpolantFactoryMethodLinear: function(e) {
  44731. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44732. },
  44733. InterpolantFactoryMethodSmooth: void 0
  44734. }),
  44735. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44736. Ci.KeyframeTrack.call(this, e, t, i, n)
  44737. }
  44738. ,
  44739. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44740. constructor: Ci.StringKeyframeTrack,
  44741. ValueTypeName: "string",
  44742. ValueBufferType: Array,
  44743. DefaultInterpolation: Ci.IntepolateDiscrete,
  44744. InterpolantFactoryMethodLinear: void 0,
  44745. InterpolantFactoryMethodSmooth: void 0
  44746. }),
  44747. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44748. Ci.KeyframeTrack.call(this, e, t, i, n)
  44749. }
  44750. ,
  44751. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44752. constructor: Ci.VectorKeyframeTrack,
  44753. ValueTypeName: "vector"
  44754. }),
  44755. Ci.Audio = function(e) {
  44756. Ci.Object3D.call(this),
  44757. this.type = "Audio",
  44758. this.context = e.context,
  44759. this.source = this.context.createBufferSource(),
  44760. this.source.onended = this.onEnded.bind(this),
  44761. this.gain = this.context.createGain(),
  44762. this.gain.connect(e.getInput()),
  44763. this.autoplay = !1,
  44764. this.startTime = 0,
  44765. this.playbackRate = 1,
  44766. this.isPlaying = !1,
  44767. this.hasPlaybackControl = !0,
  44768. this.sourceType = "empty",
  44769. this.filter = null
  44770. }
  44771. ,
  44772. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44773. Ci.Audio.prototype.constructor = Ci.Audio,
  44774. Ci.Audio.prototype.getOutput = function() {
  44775. return this.gain
  44776. }
  44777. ,
  44778. Ci.Audio.prototype.load = function(e) {
  44779. var t = new Ci.AudioBuffer(this.context);
  44780. return t.load(e),
  44781. this.setBuffer(t),
  44782. this
  44783. }
  44784. ,
  44785. Ci.Audio.prototype.setNodeSource = function(e) {
  44786. return this.hasPlaybackControl = !1,
  44787. this.sourceType = "audioNode",
  44788. this.source = e,
  44789. this.connect(),
  44790. this
  44791. }
  44792. ,
  44793. Ci.Audio.prototype.setBuffer = function(e) {
  44794. var t = this;
  44795. return e.onReady(function(e) {
  44796. t.source.buffer = e,
  44797. t.sourceType = "buffer",
  44798. t.autoplay && t.play()
  44799. }),
  44800. this
  44801. }
  44802. ,
  44803. Ci.Audio.prototype.play = function() {
  44804. if (!0 !== this.isPlaying)
  44805. if (!1 !== this.hasPlaybackControl) {
  44806. var e = this.context.createBufferSource();
  44807. e.buffer = this.source.buffer,
  44808. e.loop = this.source.loop,
  44809. e.onended = this.source.onended,
  44810. e.start(0, this.startTime),
  44811. e.playbackRate.value = this.playbackRate,
  44812. this.isPlaying = !0,
  44813. this.source = e,
  44814. this.connect()
  44815. } else
  44816. console.warn("THREE.Audio: this Audio has no playback control.");
  44817. else
  44818. console.warn("THREE.Audio: Audio is already playing.")
  44819. }
  44820. ,
  44821. Ci.Audio.prototype.pause = function() {
  44822. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44823. void (this.startTime = this.context.currentTime))
  44824. }
  44825. ,
  44826. Ci.Audio.prototype.stop = function() {
  44827. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44828. void (this.startTime = 0))
  44829. }
  44830. ,
  44831. Ci.Audio.prototype.connect = function() {
  44832. null !== this.filter ? (this.source.connect(this.filter),
  44833. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44834. }
  44835. ,
  44836. Ci.Audio.prototype.disconnect = function() {
  44837. null !== this.filter ? (this.source.disconnect(this.filter),
  44838. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44839. }
  44840. ,
  44841. Ci.Audio.prototype.getFilter = function() {
  44842. return this.filter
  44843. }
  44844. ,
  44845. Ci.Audio.prototype.setFilter = function(e) {
  44846. void 0 === e && (e = null),
  44847. !0 === this.isPlaying ? (this.disconnect(),
  44848. this.filter = e,
  44849. this.connect()) : this.filter = e
  44850. }
  44851. ,
  44852. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44853. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44854. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44855. }
  44856. ,
  44857. Ci.Audio.prototype.getPlaybackRate = function() {
  44858. return this.playbackRate
  44859. }
  44860. ,
  44861. Ci.Audio.prototype.onEnded = function() {
  44862. this.isPlaying = !1
  44863. }
  44864. ,
  44865. Ci.Audio.prototype.setLoop = function(e) {
  44866. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44867. }
  44868. ,
  44869. Ci.Audio.prototype.getLoop = function() {
  44870. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44871. !1) : this.source.loop
  44872. }
  44873. ,
  44874. Ci.Audio.prototype.setVolume = function(e) {
  44875. this.gain.gain.value = e
  44876. }
  44877. ,
  44878. Ci.Audio.prototype.getVolume = function() {
  44879. return this.gain.gain.value
  44880. }
  44881. ,
  44882. Ci.AudioAnalyser = function(e, t) {
  44883. this.analyser = e.context.createAnalyser(),
  44884. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44885. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44886. e.getOutput().connect(this.analyser)
  44887. }
  44888. ,
  44889. Ci.AudioAnalyser.prototype = {
  44890. constructor: Ci.AudioAnalyser,
  44891. getData: function() {
  44892. return this.analyser.getByteFrequencyData(this.data),
  44893. this.data
  44894. }
  44895. },
  44896. Ci.AudioBuffer = function(e) {
  44897. this.context = e,
  44898. this.ready = !1,
  44899. this.readyCallbacks = []
  44900. }
  44901. ,
  44902. Ci.AudioBuffer.prototype.load = function(e) {
  44903. var i = this
  44904. , t = new XMLHttpRequest;
  44905. return t.open("GET", e, !0),
  44906. t.responseType = "arraybuffer",
  44907. t.onload = function(e) {
  44908. i.context.decodeAudioData(this.response, function(e) {
  44909. i.buffer = e,
  44910. i.ready = !0;
  44911. for (var t = 0; t < i.readyCallbacks.length; t++)
  44912. i.readyCallbacks[t](i.buffer);
  44913. i.readyCallbacks = []
  44914. })
  44915. }
  44916. ,
  44917. t.send(),
  44918. this
  44919. }
  44920. ,
  44921. Ci.AudioBuffer.prototype.onReady = function(e) {
  44922. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44923. }
  44924. ,
  44925. Ci.PositionalAudio = function(e) {
  44926. Ci.Audio.call(this, e),
  44927. this.panner = this.context.createPanner(),
  44928. this.panner.connect(this.gain)
  44929. }
  44930. ,
  44931. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44932. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44933. Ci.PositionalAudio.prototype.getOutput = function() {
  44934. return this.panner
  44935. }
  44936. ,
  44937. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44938. this.panner.refDistance = e
  44939. }
  44940. ,
  44941. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44942. return this.panner.refDistance
  44943. }
  44944. ,
  44945. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44946. this.panner.rolloffFactor = e
  44947. }
  44948. ,
  44949. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44950. return this.panner.rolloffFactor
  44951. }
  44952. ,
  44953. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44954. this.panner.distanceModel = e
  44955. }
  44956. ,
  44957. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44958. return this.panner.distanceModel
  44959. }
  44960. ,
  44961. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44962. this.panner.maxDistance = e
  44963. }
  44964. ,
  44965. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44966. return this.panner.maxDistance
  44967. }
  44968. ,
  44969. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44970. function(e) {
  44971. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44972. it.setFromMatrixPosition(this.matrixWorld),
  44973. this.panner.setPosition(it.x, it.y, it.z)
  44974. }
  44975. ),
  44976. Ci.AudioListener = function() {
  44977. Ci.Object3D.call(this),
  44978. this.type = "AudioListener",
  44979. this.context = new (window.AudioContext || window.webkitAudioContext),
  44980. this.gain = this.context.createGain(),
  44981. this.gain.connect(this.context.destination),
  44982. this.filter = null
  44983. }
  44984. ,
  44985. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44986. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44987. Ci.AudioListener.prototype.getInput = function() {
  44988. return this.gain
  44989. }
  44990. ,
  44991. Ci.AudioListener.prototype.removeFilter = function() {
  44992. null !== this.filter && (this.gain.disconnect(this.filter),
  44993. this.filter.disconnect(this.context.destination),
  44994. this.gain.connect(this.context.destination),
  44995. this.filter = null)
  44996. }
  44997. ,
  44998. Ci.AudioListener.prototype.setFilter = function(e) {
  44999. null !== this.filter ? (this.gain.disconnect(this.filter),
  45000. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  45001. this.filter = e,
  45002. this.gain.connect(this.filter),
  45003. this.filter.connect(this.context.destination)
  45004. }
  45005. ,
  45006. Ci.AudioListener.prototype.getFilter = function() {
  45007. return this.filter
  45008. }
  45009. ,
  45010. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  45011. this.gain.gain.value = e
  45012. }
  45013. ,
  45014. Ci.AudioListener.prototype.getMasterVolume = function() {
  45015. return this.gain.gain.value
  45016. }
  45017. ,
  45018. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  45019. $e = new Ci.Quaternion,
  45020. et = new Ci.Vector3,
  45021. tt = new Ci.Vector3,
  45022. function(e) {
  45023. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  45024. var t = this.context.listener
  45025. , i = this.up;
  45026. this.matrixWorld.decompose(Je, $e, et),
  45027. tt.set(0, 0, -1).applyQuaternion($e),
  45028. t.setPosition(Je.x, Je.y, Je.z),
  45029. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  45030. }
  45031. ),
  45032. Ci.Camera = function() {
  45033. Ci.Object3D.call(this),
  45034. this.type = "Camera",
  45035. this.matrixWorldInverse = new Ci.Matrix4,
  45036. this.projectionMatrix = new Ci.Matrix4
  45037. }
  45038. ,
  45039. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  45040. Ci.Camera.prototype.constructor = Ci.Camera,
  45041. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  45042. function(e) {
  45043. var t = e || new Ci.Vector3;
  45044. return this.getWorldQuaternion(Qe),
  45045. t.set(0, 0, -1).applyQuaternion(Qe)
  45046. }
  45047. ),
  45048. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  45049. function(e) {
  45050. Ke.lookAt(this.position, e, this.up),
  45051. this.quaternion.setFromRotationMatrix(Ke)
  45052. }
  45053. ),
  45054. Ci.Camera.prototype.clone = function() {
  45055. return (new this.constructor).copy(this)
  45056. }
  45057. ,
  45058. Ci.Camera.prototype.copy = function(e) {
  45059. return Ci.Object3D.prototype.copy.call(this, e),
  45060. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45061. this.projectionMatrix.copy(e.projectionMatrix),
  45062. this
  45063. }
  45064. ,
  45065. Ci.CubeCamera = function(e, t, i) {
  45066. Ci.Object3D.call(this),
  45067. this.type = "CubeCamera";
  45068. var r = new Ci.PerspectiveCamera(90,1,e,t);
  45069. r.up.set(0, -1, 0),
  45070. r.lookAt(new Ci.Vector3(1,0,0)),
  45071. this.add(r);
  45072. var o = new Ci.PerspectiveCamera(90,1,e,t);
  45073. o.up.set(0, -1, 0),
  45074. o.lookAt(new Ci.Vector3(-1,0,0)),
  45075. this.add(o);
  45076. var a = new Ci.PerspectiveCamera(90,1,e,t);
  45077. a.up.set(0, 0, 1),
  45078. a.lookAt(new Ci.Vector3(0,1,0)),
  45079. this.add(a);
  45080. var s = new Ci.PerspectiveCamera(90,1,e,t);
  45081. s.up.set(0, 0, -1),
  45082. s.lookAt(new Ci.Vector3(0,-1,0)),
  45083. this.add(s);
  45084. var l = new Ci.PerspectiveCamera(90,1,e,t);
  45085. l.up.set(0, -1, 0),
  45086. l.lookAt(new Ci.Vector3(0,0,1)),
  45087. this.add(l);
  45088. var c = new Ci.PerspectiveCamera(90,1,e,t);
  45089. c.up.set(0, -1, 0),
  45090. c.lookAt(new Ci.Vector3(0,0,-1)),
  45091. this.add(c);
  45092. var n = {
  45093. format: Ci.RGBFormat,
  45094. magFilter: Ci.LinearFilter,
  45095. minFilter: Ci.LinearFilter
  45096. };
  45097. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  45098. this.updateCubeMap = function(e, t) {
  45099. null === this.parent && this.updateMatrixWorld();
  45100. var i = this.renderTarget
  45101. , n = i.texture.generateMipmaps;
  45102. i.texture.generateMipmaps = !1,
  45103. i.activeCubeFace = 0,
  45104. e.render(t, r, i),
  45105. i.activeCubeFace = 1,
  45106. e.render(t, o, i),
  45107. i.activeCubeFace = 2,
  45108. e.render(t, a, i),
  45109. i.activeCubeFace = 3,
  45110. e.render(t, s, i),
  45111. i.activeCubeFace = 4,
  45112. e.render(t, l, i),
  45113. i.texture.generateMipmaps = n,
  45114. i.activeCubeFace = 5,
  45115. e.render(t, c, i),
  45116. e.setRenderTarget(null)
  45117. }
  45118. }
  45119. ,
  45120. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  45121. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  45122. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  45123. Ci.Camera.call(this),
  45124. this.type = "OrthographicCamera",
  45125. this.zoom = 1,
  45126. this.left = e,
  45127. this.right = t,
  45128. this.top = i,
  45129. this.bottom = n,
  45130. this.near = void 0 !== r ? r : .1,
  45131. this.far = void 0 !== o ? o : 2e3,
  45132. this.updateProjectionMatrix()
  45133. }
  45134. ,
  45135. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  45136. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  45137. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45138. var e = (this.right - this.left) / (2 * this.zoom)
  45139. , t = (this.top - this.bottom) / (2 * this.zoom)
  45140. , i = (this.right + this.left) / 2
  45141. , n = (this.top + this.bottom) / 2;
  45142. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45143. }
  45144. ,
  45145. Ci.OrthographicCamera.prototype.copy = function(e) {
  45146. return Ci.Camera.prototype.copy.call(this, e),
  45147. this.left = e.left,
  45148. this.right = e.right,
  45149. this.top = e.top,
  45150. this.bottom = e.bottom,
  45151. this.near = e.near,
  45152. this.far = e.far,
  45153. this.zoom = e.zoom,
  45154. this
  45155. }
  45156. ,
  45157. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  45158. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45159. return t.object.zoom = this.zoom,
  45160. t.object.left = this.left,
  45161. t.object.right = this.right,
  45162. t.object.top = this.top,
  45163. t.object.bottom = this.bottom,
  45164. t.object.near = this.near,
  45165. t.object.far = this.far,
  45166. t
  45167. }
  45168. ,
  45169. Ci.PerspectiveCamera = function(e, t, i, n) {
  45170. Ci.Camera.call(this),
  45171. this.type = "PerspectiveCamera",
  45172. this.focalLength = 10,
  45173. this.zoom = 1,
  45174. this.fov = void 0 !== e ? e : 50,
  45175. this.aspect = void 0 !== t ? t : 1,
  45176. this.near = void 0 !== i ? i : .1,
  45177. this.far = void 0 !== n ? n : 2e3,
  45178. this.updateProjectionMatrix()
  45179. }
  45180. ,
  45181. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  45182. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  45183. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  45184. void 0 === t && (t = 24),
  45185. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  45186. this.updateProjectionMatrix()
  45187. }
  45188. ,
  45189. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45190. this.fullWidth = e,
  45191. this.fullHeight = t,
  45192. this.x = i,
  45193. this.y = n,
  45194. this.width = r,
  45195. this.height = o,
  45196. this.updateProjectionMatrix()
  45197. }
  45198. ,
  45199. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45200. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  45201. if (this.fullWidth) {
  45202. var t = this.fullWidth / this.fullHeight
  45203. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  45204. , n = -i
  45205. , r = t * n
  45206. , o = t * i
  45207. , a = Math.abs(o - r)
  45208. , s = Math.abs(i - n);
  45209. 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)
  45210. } else
  45211. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45212. }
  45213. ,
  45214. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45215. return Ci.Camera.prototype.copy.call(this, e),
  45216. this.focalLength = e.focalLength,
  45217. this.zoom = e.zoom,
  45218. this.fov = e.fov,
  45219. this.aspect = e.aspect,
  45220. this.near = e.near,
  45221. this.far = e.far,
  45222. this
  45223. }
  45224. ,
  45225. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45226. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45227. return t.object.focalLength = this.focalLength,
  45228. t.object.zoom = this.zoom,
  45229. t.object.fov = this.fov,
  45230. t.object.aspect = this.aspect,
  45231. t.object.near = this.near,
  45232. t.object.far = this.far,
  45233. t
  45234. }
  45235. ,
  45236. Ci.StereoCamera = function() {
  45237. this.type = "StereoCamera",
  45238. this.aspect = 1,
  45239. this.cameraL = new Ci.PerspectiveCamera,
  45240. this.cameraL.layers.enable(1),
  45241. this.cameraL.matrixAutoUpdate = !1,
  45242. this.cameraR = new Ci.PerspectiveCamera,
  45243. this.cameraR.layers.enable(2),
  45244. this.cameraR.matrixAutoUpdate = !1
  45245. }
  45246. ,
  45247. Ci.StereoCamera.prototype = {
  45248. constructor: Ci.StereoCamera,
  45249. update: (Xe = new Ci.Matrix4,
  45250. Ze = new Ci.Matrix4,
  45251. function(e) {
  45252. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45253. Ge = e.focalLength,
  45254. We = e.fov,
  45255. je = e.aspect * this.aspect,
  45256. Ye = e.near,
  45257. qe = e.far;
  45258. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45259. Ze.elements[12] = -.032,
  45260. Xe.elements[12] = .032,
  45261. t = -o * je + r,
  45262. i = o * je + r,
  45263. n.elements[0] = 2 * Ye / (i - t),
  45264. n.elements[8] = (i + t) / (i - t),
  45265. this.cameraL.projectionMatrix.copy(n),
  45266. t = -o * je - r,
  45267. i = o * je - r,
  45268. n.elements[0] = 2 * Ye / (i - t),
  45269. n.elements[8] = (i + t) / (i - t),
  45270. this.cameraR.projectionMatrix.copy(n)
  45271. }
  45272. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45273. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45274. }
  45275. )
  45276. },
  45277. Ci.Light = function(e, t) {
  45278. Ci.Object3D.call(this),
  45279. this.type = "Light",
  45280. this.color = new Ci.Color(e),
  45281. this.intensity = void 0 !== t ? t : 1,
  45282. this.receiveShadow = void 0
  45283. }
  45284. ,
  45285. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45286. Ci.Light.prototype.constructor = Ci.Light,
  45287. Ci.Light.prototype.copy = function(e) {
  45288. return Ci.Object3D.prototype.copy.call(this, e),
  45289. this.color.copy(e.color),
  45290. this.intensity = e.intensity,
  45291. this
  45292. }
  45293. ,
  45294. Ci.Light.prototype.toJSON = function(e) {
  45295. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45296. return t.object.color = this.color.getHex(),
  45297. t.object.intensity = this.intensity,
  45298. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45299. void 0 !== this.distance && (t.object.distance = this.distance),
  45300. void 0 !== this.angle && (t.object.angle = this.angle),
  45301. void 0 !== this.decay && (t.object.decay = this.decay),
  45302. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45303. t
  45304. }
  45305. ,
  45306. Ci.LightShadow = function(e) {
  45307. this.camera = e,
  45308. this.bias = 0,
  45309. this.radius = 1,
  45310. this.mapSize = new Ci.Vector2(512,512),
  45311. this.map = null,
  45312. this.matrix = new Ci.Matrix4
  45313. }
  45314. ,
  45315. Ci.LightShadow.prototype = {
  45316. constructor: Ci.LightShadow,
  45317. copy: function(e) {
  45318. return this.camera = e.camera.clone(),
  45319. this.bias = e.bias,
  45320. this.radius = e.radius,
  45321. this.mapSize.copy(e.mapSize),
  45322. this
  45323. },
  45324. clone: function() {
  45325. return (new this.constructor).copy(this)
  45326. }
  45327. },
  45328. Ci.AmbientLight = function(e, t) {
  45329. Ci.Light.call(this, e, t),
  45330. this.type = "AmbientLight",
  45331. this.castShadow = void 0
  45332. }
  45333. ,
  45334. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45335. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45336. Ci.DirectionalLight = function(e, t) {
  45337. Ci.Light.call(this, e, t),
  45338. this.type = "DirectionalLight",
  45339. this.position.set(0, 1, 0),
  45340. this.updateMatrix(),
  45341. this.target = new Ci.Object3D,
  45342. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45343. }
  45344. ,
  45345. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45346. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45347. Ci.DirectionalLight.prototype.copy = function(e) {
  45348. return Ci.Light.prototype.copy.call(this, e),
  45349. this.target = e.target.clone(),
  45350. this.shadow = e.shadow.clone(),
  45351. this
  45352. }
  45353. ,
  45354. Ci.HemisphereLight = function(e, t, i) {
  45355. Ci.Light.call(this, e, i),
  45356. this.type = "HemisphereLight",
  45357. this.castShadow = void 0,
  45358. this.position.set(0, 1, 0),
  45359. this.updateMatrix(),
  45360. this.groundColor = new Ci.Color(t)
  45361. }
  45362. ,
  45363. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45364. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45365. Ci.HemisphereLight.prototype.copy = function(e) {
  45366. return Ci.Light.prototype.copy.call(this, e),
  45367. this.groundColor.copy(e.groundColor),
  45368. this
  45369. }
  45370. ,
  45371. Ci.PointLight = function(e, t, i, n) {
  45372. Ci.Light.call(this, e, t),
  45373. this.type = "PointLight",
  45374. this.distance = void 0 !== i ? i : 0,
  45375. this.decay = void 0 !== n ? n : 1,
  45376. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45377. }
  45378. ,
  45379. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45380. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45381. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45382. get: function() {
  45383. return 4 * this.intensity * Math.PI
  45384. },
  45385. set: function(e) {
  45386. this.intensity = e / (4 * Math.PI)
  45387. }
  45388. }),
  45389. Ci.PointLight.prototype.copy = function(e) {
  45390. return Ci.Light.prototype.copy.call(this, e),
  45391. this.distance = e.distance,
  45392. this.decay = e.decay,
  45393. this.shadow = e.shadow.clone(),
  45394. this
  45395. }
  45396. ,
  45397. Ci.SpotLight = function(e, t, i, n, r, o) {
  45398. Ci.Light.call(this, e, t),
  45399. this.type = "SpotLight",
  45400. this.position.set(0, 1, 0),
  45401. this.updateMatrix(),
  45402. this.target = new Ci.Object3D,
  45403. this.distance = void 0 !== i ? i : 0,
  45404. this.angle = void 0 !== n ? n : Math.PI / 3,
  45405. this.penumbra = void 0 !== r ? r : 0,
  45406. this.decay = void 0 !== o ? o : 1,
  45407. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45408. }
  45409. ,
  45410. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45411. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45412. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45413. get: function() {
  45414. return this.intensity * Math.PI
  45415. },
  45416. set: function(e) {
  45417. this.intensity = e / Math.PI
  45418. }
  45419. }),
  45420. Ci.SpotLight.prototype.copy = function(e) {
  45421. return Ci.Light.prototype.copy.call(this, e),
  45422. this.distance = e.distance,
  45423. this.angle = e.angle,
  45424. this.penumbra = e.penumbra,
  45425. this.decay = e.decay,
  45426. this.target = e.target.clone(),
  45427. this.shadow = e.shadow.clone(),
  45428. this
  45429. }
  45430. ,
  45431. Ci.Cache = {
  45432. enabled: !1,
  45433. files: {},
  45434. add: function(e, t) {
  45435. !1 !== this.enabled && (this.files[e] = t)
  45436. },
  45437. get: function(e) {
  45438. if (!1 !== this.enabled)
  45439. return this.files[e]
  45440. },
  45441. remove: function(e) {
  45442. delete this.files[e]
  45443. },
  45444. clear: function() {
  45445. this.files = {}
  45446. }
  45447. },
  45448. Ci.Loader = function() {
  45449. this.onLoadStart = function() {}
  45450. ,
  45451. this.onLoadProgress = function() {}
  45452. ,
  45453. this.onLoadComplete = function() {}
  45454. }
  45455. ,
  45456. Ci.Loader.prototype = {
  45457. constructor: Ci.Loader,
  45458. crossOrigin: void 0,
  45459. extractUrlBase: function(e) {
  45460. var t = e.split("/");
  45461. return 1 === t.length ? "./" : (t.pop(),
  45462. t.join("/") + "/")
  45463. },
  45464. initMaterials: function(e, t, i) {
  45465. for (var n = [], r = 0; r < e.length; ++r)
  45466. n[r] = this.createMaterial(e[r], t, i);
  45467. return n
  45468. },
  45469. createMaterial: function(e, c, h) {
  45470. function t(e, t, i, n, r) {
  45471. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45472. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45473. He.load(a)),
  45474. void 0 !== t && (o.repeat.fromArray(t),
  45475. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45476. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45477. void 0 !== i && o.offset.fromArray(i),
  45478. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45479. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45480. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45481. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45482. void 0 !== r && (o.anisotropy = r);
  45483. var l = Ci.Math.generateUUID();
  45484. return u[l] = o,
  45485. l
  45486. }
  45487. void 0 === Ue && (Ue = new Ci.Color),
  45488. void 0 === He && (He = new Ci.TextureLoader),
  45489. void 0 === ze && (ze = new Ci.MaterialLoader);
  45490. var u = {}
  45491. , i = {
  45492. uuid: Ci.Math.generateUUID(),
  45493. type: "MeshLambertMaterial"
  45494. };
  45495. for (var n in e) {
  45496. var r = e[n];
  45497. switch (n) {
  45498. case "DbgColor":
  45499. case "DbgIndex":
  45500. case "opticalDensity":
  45501. case "illumination":
  45502. break;
  45503. case "DbgName":
  45504. i.name = r;
  45505. break;
  45506. case "blending":
  45507. i.blending = Ci[r];
  45508. break;
  45509. case "colorAmbient":
  45510. case "mapAmbient":
  45511. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45512. break;
  45513. case "colorDiffuse":
  45514. i.color = Ue.fromArray(r).getHex();
  45515. break;
  45516. case "colorSpecular":
  45517. i.specular = Ue.fromArray(r).getHex();
  45518. break;
  45519. case "colorEmissive":
  45520. i.emissive = Ue.fromArray(r).getHex();
  45521. break;
  45522. case "specularCoef":
  45523. i.shininess = r;
  45524. break;
  45525. case "shading":
  45526. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45527. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45528. break;
  45529. case "mapDiffuse":
  45530. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45531. break;
  45532. case "mapDiffuseRepeat":
  45533. case "mapDiffuseOffset":
  45534. case "mapDiffuseWrap":
  45535. case "mapDiffuseAnisotropy":
  45536. break;
  45537. case "mapLight":
  45538. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45539. break;
  45540. case "mapLightRepeat":
  45541. case "mapLightOffset":
  45542. case "mapLightWrap":
  45543. case "mapLightAnisotropy":
  45544. break;
  45545. case "mapAO":
  45546. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45547. break;
  45548. case "mapAORepeat":
  45549. case "mapAOOffset":
  45550. case "mapAOWrap":
  45551. case "mapAOAnisotropy":
  45552. break;
  45553. case "mapBump":
  45554. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45555. break;
  45556. case "mapBumpScale":
  45557. i.bumpScale = r;
  45558. break;
  45559. case "mapBumpRepeat":
  45560. case "mapBumpOffset":
  45561. case "mapBumpWrap":
  45562. case "mapBumpAnisotropy":
  45563. break;
  45564. case "mapNormal":
  45565. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45566. break;
  45567. case "mapNormalFactor":
  45568. i.normalScale = [r, r];
  45569. break;
  45570. case "mapNormalRepeat":
  45571. case "mapNormalOffset":
  45572. case "mapNormalWrap":
  45573. case "mapNormalAnisotropy":
  45574. break;
  45575. case "mapSpecular":
  45576. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45577. break;
  45578. case "mapSpecularRepeat":
  45579. case "mapSpecularOffset":
  45580. case "mapSpecularWrap":
  45581. case "mapSpecularAnisotropy":
  45582. break;
  45583. case "mapAlpha":
  45584. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45585. break;
  45586. case "mapAlphaRepeat":
  45587. case "mapAlphaOffset":
  45588. case "mapAlphaWrap":
  45589. case "mapAlphaAnisotropy":
  45590. break;
  45591. case "flipSided":
  45592. i.side = Ci.BackSide;
  45593. break;
  45594. case "doubleSided":
  45595. i.side = Ci.DoubleSide;
  45596. break;
  45597. case "transparency":
  45598. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45599. i.opacity = r;
  45600. break;
  45601. case "depthTest":
  45602. case "depthWrite":
  45603. case "colorWrite":
  45604. case "opacity":
  45605. case "reflectivity":
  45606. case "transparent":
  45607. case "visible":
  45608. case "wireframe":
  45609. i[n] = r;
  45610. break;
  45611. case "vertexColors":
  45612. !0 === r && (i.vertexColors = Ci.VertexColors),
  45613. "face" === r && (i.vertexColors = Ci.FaceColors);
  45614. break;
  45615. default:
  45616. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45617. }
  45618. }
  45619. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45620. "MeshPhongMaterial" !== i.type && delete i.specular,
  45621. i.opacity < 1 && (i.transparent = !0),
  45622. ze.setTextures(u),
  45623. ze.parse(i)
  45624. }
  45625. },
  45626. Ci.Loader.Handlers = {
  45627. handlers: [],
  45628. add: function(e, t) {
  45629. this.handlers.push(e, t)
  45630. },
  45631. get: function(e) {
  45632. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45633. var r = t[i]
  45634. , o = t[i + 1];
  45635. if (r.test(e))
  45636. return o
  45637. }
  45638. return null
  45639. }
  45640. },
  45641. Ci.XHRLoader = function(e) {
  45642. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45643. }
  45644. ,
  45645. Ci.XHRLoader.prototype = {
  45646. constructor: Ci.XHRLoader,
  45647. load: function(i, n, t, r) {
  45648. void 0 !== this.path && (i = this.path + i);
  45649. var o = this
  45650. , e = Ci.Cache.get(i);
  45651. if (void 0 !== e)
  45652. return n && setTimeout(function() {
  45653. n(e)
  45654. }, 0),
  45655. e;
  45656. var a = new XMLHttpRequest;
  45657. return a.overrideMimeType("text/plain"),
  45658. a.open("GET", i, !0),
  45659. a.addEventListener("load", function(e) {
  45660. var t = e.target.response;
  45661. Ci.Cache.add(i, t),
  45662. 200 === this.status ? (n && n(t),
  45663. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45664. n && n(t),
  45665. o.manager.itemEnd(i)) : (r && r(e),
  45666. o.manager.itemError(i))
  45667. }, !1),
  45668. void 0 !== t && a.addEventListener("progress", function(e) {
  45669. t(e)
  45670. }, !1),
  45671. a.addEventListener("error", function(e) {
  45672. r && r(e),
  45673. o.manager.itemError(i)
  45674. }, !1),
  45675. void 0 !== this.responseType && (a.responseType = this.responseType),
  45676. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45677. a.send(null),
  45678. o.manager.itemStart(i),
  45679. a
  45680. },
  45681. setPath: function(e) {
  45682. this.path = e
  45683. },
  45684. setResponseType: function(e) {
  45685. this.responseType = e
  45686. },
  45687. setWithCredentials: function(e) {
  45688. this.withCredentials = e
  45689. }
  45690. },
  45691. Ci.FontLoader = function(e) {
  45692. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45693. }
  45694. ,
  45695. Ci.FontLoader.prototype = {
  45696. constructor: Ci.FontLoader,
  45697. load: function(e, t, i, n) {
  45698. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45699. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45700. }, i, n)
  45701. }
  45702. },
  45703. Ci.ImageLoader = function(e) {
  45704. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45705. }
  45706. ,
  45707. Ci.ImageLoader.prototype = {
  45708. constructor: Ci.ImageLoader,
  45709. load: function(t, i, n, r) {
  45710. void 0 !== this.path && (t = this.path + t);
  45711. var o = this
  45712. , e = Ci.Cache.get(t);
  45713. if (void 0 !== e)
  45714. return o.manager.itemStart(t),
  45715. i ? setTimeout(function() {
  45716. i(e),
  45717. o.manager.itemEnd(t)
  45718. }, 0) : o.manager.itemEnd(t),
  45719. e;
  45720. var a = document.createElement("img");
  45721. return a.addEventListener("load", function(e) {
  45722. Ci.Cache.add(t, this),
  45723. i && i(this),
  45724. o.manager.itemEnd(t)
  45725. }, !1),
  45726. void 0 !== n && a.addEventListener("progress", function(e) {
  45727. n(e)
  45728. }, !1),
  45729. a.addEventListener("error", function(e) {
  45730. r && r(e),
  45731. o.manager.itemError(t)
  45732. }, !1),
  45733. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45734. o.manager.itemStart(t),
  45735. a.src = t,
  45736. a
  45737. },
  45738. setCrossOrigin: function(e) {
  45739. this.crossOrigin = e
  45740. },
  45741. setPath: function(e) {
  45742. this.path = e
  45743. }
  45744. },
  45745. Ci.JSONLoader = function(e) {
  45746. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45747. e = void 0),
  45748. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45749. this.withCredentials = !1
  45750. }
  45751. ,
  45752. Ci.JSONLoader.prototype = {
  45753. constructor: Ci.JSONLoader,
  45754. get statusDomElement() {
  45755. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45756. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45757. this._statusDomElement
  45758. },
  45759. load: function(o, a, e, t) {
  45760. var s = this
  45761. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45762. , i = new Ci.XHRLoader(this.manager);
  45763. i.setWithCredentials(this.withCredentials),
  45764. i.load(o, function(e) {
  45765. var t = JSON.parse(e)
  45766. , i = t.metadata;
  45767. if (void 0 !== i) {
  45768. var n = i.type;
  45769. if (void 0 !== n) {
  45770. if ("object" === n.toLowerCase())
  45771. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45772. if ("scene" === n.toLowerCase())
  45773. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45774. }
  45775. }
  45776. var r = s.parse(t, l);
  45777. a(r.geometry, r.materials)
  45778. }, e, t)
  45779. },
  45780. setTexturePath: function(e) {
  45781. this.texturePath = e
  45782. },
  45783. parse: function(D, e) {
  45784. var N = new Ci.Geometry
  45785. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45786. if (function(e) {
  45787. function t(e, t) {
  45788. return e & 1 << t
  45789. }
  45790. 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;
  45791. if (void 0 !== D.uvs) {
  45792. for (i = 0; i < D.uvs.length; i++)
  45793. D.uvs[i].length && L++;
  45794. for (i = 0; i < L; i++)
  45795. N.faceVertexUvs[i] = []
  45796. }
  45797. for (o = 0,
  45798. a = R.length; o < a; )
  45799. (A = new Ci.Vector3).x = R[o++] * e,
  45800. A.y = R[o++] * e,
  45801. A.z = R[o++] * e,
  45802. N.vertices.push(A);
  45803. for (o = 0,
  45804. a = M.length; o < a; )
  45805. if (d = t(u = M[o++], 0),
  45806. p = t(u, 1),
  45807. f = t(u, 3),
  45808. g = t(u, 4),
  45809. m = t(u, 5),
  45810. v = t(u, 6),
  45811. y = t(u, 7),
  45812. d) {
  45813. if ((I = new Ci.Face3).a = M[o],
  45814. I.b = M[o + 1],
  45815. I.c = M[o + 3],
  45816. (E = new Ci.Face3).a = M[o + 1],
  45817. E.b = M[o + 2],
  45818. E.c = M[o + 3],
  45819. o += 4,
  45820. p && (h = M[o++],
  45821. I.materialIndex = h,
  45822. E.materialIndex = h),
  45823. r = N.faces.length,
  45824. f)
  45825. for (i = 0; i < L; i++)
  45826. for (w = D.uvs[i],
  45827. N.faceVertexUvs[i][r] = [],
  45828. N.faceVertexUvs[i][r + 1] = [],
  45829. n = 0; n < 4; n++)
  45830. x = w[2 * (c = M[o++])],
  45831. S = w[2 * c + 1],
  45832. T = new Ci.Vector2(x,S),
  45833. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45834. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45835. if (g && (l = 3 * M[o++],
  45836. I.normal.set(P[l++], P[l++], P[l]),
  45837. E.normal.copy(I.normal)),
  45838. m)
  45839. for (i = 0; i < 4; i++)
  45840. l = 3 * M[o++],
  45841. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45842. 2 !== i && I.vertexNormals.push(b),
  45843. 0 !== i && E.vertexNormals.push(b);
  45844. if (v && (_ = O[s = M[o++]],
  45845. I.color.setHex(_),
  45846. E.color.setHex(_)),
  45847. y)
  45848. for (i = 0; i < 4; i++)
  45849. _ = O[s = M[o++]],
  45850. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45851. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45852. N.faces.push(I),
  45853. N.faces.push(E)
  45854. } else {
  45855. if ((C = new Ci.Face3).a = M[o++],
  45856. C.b = M[o++],
  45857. C.c = M[o++],
  45858. p && (h = M[o++],
  45859. C.materialIndex = h),
  45860. r = N.faces.length,
  45861. f)
  45862. for (i = 0; i < L; i++)
  45863. for (w = D.uvs[i],
  45864. N.faceVertexUvs[i][r] = [],
  45865. n = 0; n < 3; n++)
  45866. x = w[2 * (c = M[o++])],
  45867. S = w[2 * c + 1],
  45868. T = new Ci.Vector2(x,S),
  45869. N.faceVertexUvs[i][r].push(T);
  45870. if (g && (l = 3 * M[o++],
  45871. C.normal.set(P[l++], P[l++], P[l])),
  45872. m)
  45873. for (i = 0; i < 3; i++)
  45874. l = 3 * M[o++],
  45875. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45876. C.vertexNormals.push(b);
  45877. if (v && (s = M[o++],
  45878. C.color.setHex(O[s])),
  45879. y)
  45880. for (i = 0; i < 3; i++)
  45881. s = M[o++],
  45882. C.vertexColors.push(new Ci.Color(O[s]));
  45883. N.faces.push(C)
  45884. }
  45885. }(t),
  45886. function() {
  45887. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45888. if (D.skinWeights)
  45889. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45890. var n = D.skinWeights[t]
  45891. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45892. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45893. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45894. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45895. }
  45896. if (D.skinIndices)
  45897. for (t = 0,
  45898. i = D.skinIndices.length; t < i; t += e) {
  45899. var s = D.skinIndices[t]
  45900. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45901. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45902. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45903. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45904. }
  45905. N.bones = D.bones,
  45906. 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.")
  45907. }(),
  45908. function(e) {
  45909. if (void 0 !== D.morphTargets)
  45910. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45911. N.morphTargets[t] = {},
  45912. N.morphTargets[t].name = D.morphTargets[t].name,
  45913. N.morphTargets[t].vertices = [];
  45914. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45915. var s = new Ci.Vector3;
  45916. s.x = r[o] * e,
  45917. s.y = r[o + 1] * e,
  45918. s.z = r[o + 2] * e,
  45919. n.push(s)
  45920. }
  45921. }
  45922. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45923. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45924. var l = N.faces
  45925. , c = D.morphColors[0].colors;
  45926. for (t = 0,
  45927. i = l.length; t < i; t++)
  45928. l[t].color.fromArray(c, 3 * t)
  45929. }
  45930. }(t),
  45931. function() {
  45932. var e = []
  45933. , t = [];
  45934. void 0 !== D.animation && t.push(D.animation),
  45935. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45936. for (var i = 0; i < t.length; i++) {
  45937. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45938. n && e.push(n)
  45939. }
  45940. if (N.morphTargets) {
  45941. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45942. e = e.concat(r)
  45943. }
  45944. 0 < e.length && (N.animations = e)
  45945. }(),
  45946. N.computeFaceNormals(),
  45947. N.computeBoundingSphere(),
  45948. void 0 === D.materials || 0 === D.materials.length)
  45949. return {
  45950. geometry: N
  45951. };
  45952. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45953. return {
  45954. geometry: N,
  45955. materials: i
  45956. }
  45957. }
  45958. },
  45959. Ci.LoadingManager = function(e, t, i) {
  45960. var n = this
  45961. , r = !1
  45962. , o = 0
  45963. , a = 0;
  45964. this.onStart = void 0,
  45965. this.onLoad = e,
  45966. this.onProgress = t,
  45967. this.onError = i,
  45968. this.itemStart = function(e) {
  45969. a++,
  45970. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45971. r = !0
  45972. }
  45973. ,
  45974. this.itemEnd = function(e) {
  45975. o++,
  45976. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45977. o === a && (r = !1,
  45978. void 0 !== n.onLoad && n.onLoad())
  45979. }
  45980. ,
  45981. this.itemError = function(e) {
  45982. void 0 !== n.onError && n.onError(e)
  45983. }
  45984. }
  45985. ,
  45986. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45987. Ci.BufferGeometryLoader = function(e) {
  45988. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45989. }
  45990. ,
  45991. Ci.BufferGeometryLoader.prototype = {
  45992. constructor: Ci.BufferGeometryLoader,
  45993. load: function(e, t, i, n) {
  45994. var r = this;
  45995. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45996. t(r.parse(JSON.parse(e)))
  45997. }, i, n)
  45998. },
  45999. parse: function(e) {
  46000. var t = new Ci.BufferGeometry
  46001. , i = e.data.index
  46002. , n = {
  46003. Int8Array: Int8Array,
  46004. Uint8Array: Uint8Array,
  46005. Uint8ClampedArray: Uint8ClampedArray,
  46006. Int16Array: Int16Array,
  46007. Uint16Array: Uint16Array,
  46008. Int32Array: Int32Array,
  46009. Uint32Array: Uint32Array,
  46010. Float32Array: Float32Array,
  46011. Float64Array: Float64Array
  46012. };
  46013. if (void 0 !== i) {
  46014. var r = new n[i.type](i.array);
  46015. t.setIndex(new Ci.BufferAttribute(r,1))
  46016. }
  46017. var o = e.data.attributes;
  46018. for (var a in o) {
  46019. var s = o[a];
  46020. r = new n[s.type](s.array);
  46021. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  46022. }
  46023. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  46024. if (void 0 !== l)
  46025. for (var c = 0, h = l.length; c !== h; ++c) {
  46026. var u = l[c];
  46027. t.addGroup(u.start, u.count, u.materialIndex)
  46028. }
  46029. var d = e.data.boundingSphere;
  46030. if (void 0 !== d) {
  46031. var p = new Ci.Vector3;
  46032. void 0 !== d.center && p.fromArray(d.center),
  46033. t.boundingSphere = new Ci.Sphere(p,d.radius)
  46034. }
  46035. return t
  46036. }
  46037. },
  46038. Ci.MaterialLoader = function(e) {
  46039. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46040. this.textures = {}
  46041. }
  46042. ,
  46043. Ci.MaterialLoader.prototype = {
  46044. constructor: Ci.MaterialLoader,
  46045. load: function(e, t, i, n) {
  46046. var r = this;
  46047. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46048. t(r.parse(JSON.parse(e)))
  46049. }, i, n)
  46050. },
  46051. setTextures: function(e) {
  46052. this.textures = e
  46053. },
  46054. getTexture: function(e) {
  46055. var t = this.textures;
  46056. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46057. t[e]
  46058. },
  46059. parse: function(e) {
  46060. var t = new Ci[e.type];
  46061. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46062. void 0 !== e.name && (t.name = e.name),
  46063. void 0 !== e.color && t.color.setHex(e.color),
  46064. void 0 !== e.roughness && (t.roughness = e.roughness),
  46065. void 0 !== e.metalness && (t.metalness = e.metalness),
  46066. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46067. void 0 !== e.specular && t.specular.setHex(e.specular),
  46068. void 0 !== e.shininess && (t.shininess = e.shininess),
  46069. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46070. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46071. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46072. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46073. void 0 !== e.shading && (t.shading = e.shading),
  46074. void 0 !== e.blending && (t.blending = e.blending),
  46075. void 0 !== e.side && (t.side = e.side),
  46076. void 0 !== e.opacity && (t.opacity = e.opacity),
  46077. void 0 !== e.transparent && (t.transparent = e.transparent),
  46078. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46079. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46080. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46081. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46082. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46083. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46084. void 0 !== e.size && (t.size = e.size),
  46085. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46086. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46087. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46088. t.transparent = !0),
  46089. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46090. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46091. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46092. void 0 !== e.normalScale) {
  46093. var i = e.normalScale;
  46094. !1 === Array.isArray(i) && (i = [i, i]),
  46095. t.normalScale = (new Ci.Vector2).fromArray(i)
  46096. }
  46097. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46098. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46099. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46100. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46101. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46102. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46103. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46104. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46105. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46106. t.combine = Ci.MultiplyOperation),
  46107. e.reflectivity && (t.reflectivity = e.reflectivity),
  46108. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46109. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46110. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46111. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46112. void 0 !== e.materials)
  46113. for (var n = 0, r = e.materials.length; n < r; n++)
  46114. t.materials.push(this.parse(e.materials[n]));
  46115. return t
  46116. }
  46117. },
  46118. Ci.ObjectLoader = function(e) {
  46119. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46120. this.texturePath = ""
  46121. }
  46122. ,
  46123. Ci.ObjectLoader.prototype = {
  46124. constructor: Ci.ObjectLoader,
  46125. load: function(e, t, i, n) {
  46126. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46127. var r = this;
  46128. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46129. r.parse(JSON.parse(e), t)
  46130. }, i, n)
  46131. },
  46132. setTexturePath: function(e) {
  46133. this.texturePath = e
  46134. },
  46135. setCrossOrigin: function(e) {
  46136. this.crossOrigin = e
  46137. },
  46138. parse: function(e, t) {
  46139. var i = this.parseGeometries(e.geometries)
  46140. , n = this.parseImages(e.images, function() {
  46141. void 0 !== t && t(a)
  46142. })
  46143. , r = this.parseTextures(e.textures, n)
  46144. , o = this.parseMaterials(e.materials, r)
  46145. , a = this.parseObject(e.object, i, o);
  46146. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46147. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46148. a
  46149. },
  46150. parseGeometries: function(e) {
  46151. var t = {};
  46152. if (void 0 !== e)
  46153. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  46154. var a, s = e[r];
  46155. switch (s.type) {
  46156. case "PlaneGeometry":
  46157. case "PlaneBufferGeometry":
  46158. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  46159. break;
  46160. case "BoxGeometry":
  46161. case "BoxBufferGeometry":
  46162. case "CubeGeometry":
  46163. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  46164. break;
  46165. case "CircleGeometry":
  46166. case "CircleBufferGeometry":
  46167. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  46168. break;
  46169. case "CylinderGeometry":
  46170. case "CylinderBufferGeometry":
  46171. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  46172. break;
  46173. case "SphereGeometry":
  46174. case "SphereBufferGeometry":
  46175. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  46176. break;
  46177. case "DodecahedronGeometry":
  46178. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  46179. break;
  46180. case "IcosahedronGeometry":
  46181. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  46182. break;
  46183. case "OctahedronGeometry":
  46184. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  46185. break;
  46186. case "TetrahedronGeometry":
  46187. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  46188. break;
  46189. case "RingGeometry":
  46190. case "RingBufferGeometry":
  46191. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  46192. break;
  46193. case "TorusGeometry":
  46194. case "TorusBufferGeometry":
  46195. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  46196. break;
  46197. case "TorusKnotGeometry":
  46198. case "TorusKnotBufferGeometry":
  46199. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  46200. break;
  46201. case "LatheGeometry":
  46202. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  46203. break;
  46204. case "BufferGeometry":
  46205. a = n.parse(s);
  46206. break;
  46207. case "Geometry":
  46208. a = i.parse(s.data, this.texturePath).geometry;
  46209. break;
  46210. default:
  46211. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46212. continue
  46213. }
  46214. a.uuid = s.uuid,
  46215. void 0 !== s.name && (a.name = s.name),
  46216. t[s.uuid] = a
  46217. }
  46218. return t
  46219. },
  46220. parseMaterials: function(e, t) {
  46221. var i = {};
  46222. if (void 0 !== e) {
  46223. var n = new Ci.MaterialLoader;
  46224. n.setTextures(t);
  46225. for (var r = 0, o = e.length; r < o; r++) {
  46226. var a = n.parse(e[r]);
  46227. i[a.uuid] = a
  46228. }
  46229. }
  46230. return i
  46231. },
  46232. parseAnimations: function(e) {
  46233. for (var t = [], i = 0; i < e.length; i++) {
  46234. var n = Ci.AnimationClip.parse(e[i]);
  46235. t.push(n)
  46236. }
  46237. return t
  46238. },
  46239. parseImages: function(e, t) {
  46240. function i(e) {
  46241. return n.manager.itemStart(e),
  46242. a.load(e, function() {
  46243. n.manager.itemEnd(e)
  46244. })
  46245. }
  46246. var n = this
  46247. , r = {};
  46248. if (void 0 !== e && 0 < e.length) {
  46249. var o = new Ci.LoadingManager(t)
  46250. , a = new Ci.ImageLoader(o);
  46251. a.setCrossOrigin(this.crossOrigin);
  46252. for (var s = 0, l = e.length; s < l; s++) {
  46253. var c = e[s]
  46254. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46255. r[c.uuid] = i(h)
  46256. }
  46257. }
  46258. return r
  46259. },
  46260. parseTextures: function(e, t) {
  46261. function i(e) {
  46262. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46263. Ci[e])
  46264. }
  46265. var n = {};
  46266. if (void 0 !== e)
  46267. for (var r = 0, o = e.length; r < o; r++) {
  46268. var a = e[r];
  46269. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46270. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46271. var s = new Ci.Texture(t[a.image]);
  46272. s.needsUpdate = !0,
  46273. s.uuid = a.uuid,
  46274. void 0 !== a.name && (s.name = a.name),
  46275. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46276. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46277. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46278. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46279. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46280. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46281. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46282. s.wrapT = i(a.wrap[1])),
  46283. n[a.uuid] = s
  46284. }
  46285. return n
  46286. },
  46287. parseObject: (ke = new Ci.Matrix4,
  46288. function(e, t, i) {
  46289. function n(e) {
  46290. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46291. t[e]
  46292. }
  46293. function r(e) {
  46294. if (void 0 !== e)
  46295. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46296. i[e]
  46297. }
  46298. var o;
  46299. switch (e.type) {
  46300. case "Scene":
  46301. o = new Ci.Scene;
  46302. break;
  46303. case "PerspectiveCamera":
  46304. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46305. break;
  46306. case "OrthographicCamera":
  46307. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46308. break;
  46309. case "AmbientLight":
  46310. o = new Ci.AmbientLight(e.color,e.intensity);
  46311. break;
  46312. case "DirectionalLight":
  46313. o = new Ci.DirectionalLight(e.color,e.intensity);
  46314. break;
  46315. case "PointLight":
  46316. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46317. break;
  46318. case "SpotLight":
  46319. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46320. break;
  46321. case "HemisphereLight":
  46322. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46323. break;
  46324. case "Mesh":
  46325. var a = n(e.geometry)
  46326. , s = r(e.material);
  46327. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46328. break;
  46329. case "LOD":
  46330. o = new Ci.LOD;
  46331. break;
  46332. case "Line":
  46333. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46334. break;
  46335. case "PointCloud":
  46336. case "Points":
  46337. o = new Ci.Points(n(e.geometry),r(e.material));
  46338. break;
  46339. case "Sprite":
  46340. o = new Ci.Sprite(r(e.material));
  46341. break;
  46342. case "Group":
  46343. o = new Ci.Group;
  46344. break;
  46345. default:
  46346. o = new Ci.Object3D
  46347. }
  46348. if (o.uuid = e.uuid,
  46349. void 0 !== e.name && (o.name = e.name),
  46350. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46351. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46352. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46353. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46354. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46355. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46356. void 0 !== e.visible && (o.visible = e.visible),
  46357. void 0 !== e.userData && (o.userData = e.userData),
  46358. void 0 !== e.children)
  46359. for (var l in e.children)
  46360. o.add(this.parseObject(e.children[l], t, i));
  46361. if ("LOD" === e.type)
  46362. for (var c = e.levels, h = 0; h < c.length; h++) {
  46363. var u = c[h];
  46364. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46365. }
  46366. return o
  46367. }
  46368. )
  46369. },
  46370. Ci.TextureLoader = function(e) {
  46371. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46372. }
  46373. ,
  46374. Ci.TextureLoader.prototype = {
  46375. constructor: Ci.TextureLoader,
  46376. load: function(e, t, i, n) {
  46377. var r = new Ci.Texture
  46378. , o = new Ci.ImageLoader(this.manager);
  46379. return o.setCrossOrigin(this.crossOrigin),
  46380. o.setPath(this.path),
  46381. o.load(e, function(e) {
  46382. r.image = e,
  46383. r.needsUpdate = !0,
  46384. void 0 !== t && t(r)
  46385. }, i, n),
  46386. r
  46387. },
  46388. setCrossOrigin: function(e) {
  46389. this.crossOrigin = e
  46390. },
  46391. setPath: function(e) {
  46392. this.path = e
  46393. }
  46394. },
  46395. Ci.CubeTextureLoader = function(e) {
  46396. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46397. }
  46398. ,
  46399. Ci.CubeTextureLoader.prototype = {
  46400. constructor: Ci.CubeTextureLoader,
  46401. load: function(e, i, t, n) {
  46402. function r(t) {
  46403. a.load(e[t], function(e) {
  46404. o.images[t] = e,
  46405. 6 === ++s && (o.needsUpdate = !0,
  46406. i && i(o))
  46407. }, void 0, n)
  46408. }
  46409. var o = new Ci.CubeTexture
  46410. , a = new Ci.ImageLoader(this.manager);
  46411. a.setCrossOrigin(this.crossOrigin),
  46412. a.setPath(this.path);
  46413. for (var s = 0, l = 0; l < e.length; ++l)
  46414. r(l);
  46415. return o
  46416. },
  46417. setCrossOrigin: function(e) {
  46418. this.crossOrigin = e
  46419. },
  46420. setPath: function(e) {
  46421. this.path = e
  46422. }
  46423. },
  46424. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46425. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46426. this._parser = null
  46427. }
  46428. ,
  46429. Ci.BinaryTextureLoader.prototype = {
  46430. constructor: Ci.BinaryTextureLoader,
  46431. load: function(e, i, t, n) {
  46432. var r = this
  46433. , o = new Ci.DataTexture
  46434. , a = new Ci.XHRLoader(this.manager);
  46435. return a.setResponseType("arraybuffer"),
  46436. a.load(e, function(e) {
  46437. var t = r._parser(e);
  46438. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46439. o.image.height = t.height,
  46440. o.image.data = t.data),
  46441. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46442. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46443. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46444. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46445. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46446. void 0 !== t.format && (o.format = t.format),
  46447. void 0 !== t.type && (o.type = t.type),
  46448. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46449. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46450. o.needsUpdate = !0,
  46451. i && i(o, t))
  46452. }, t, n),
  46453. o
  46454. }
  46455. },
  46456. Ci.CompressedTextureLoader = function(e) {
  46457. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46458. this._parser = null
  46459. }
  46460. ,
  46461. Ci.CompressedTextureLoader.prototype = {
  46462. constructor: Ci.CompressedTextureLoader,
  46463. load: function(e, o, t, n) {
  46464. function i(i) {
  46465. r.load(e[i], function(e) {
  46466. var t = a._parser(e, !0);
  46467. s[i] = {
  46468. width: t.width,
  46469. height: t.height,
  46470. format: t.format,
  46471. mipmaps: t.mipmaps
  46472. },
  46473. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46474. l.format = t.format,
  46475. l.needsUpdate = !0,
  46476. o && o(l))
  46477. }, t, n)
  46478. }
  46479. var a = this
  46480. , s = []
  46481. , l = new Ci.CompressedTexture;
  46482. l.image = s;
  46483. var r = new Ci.XHRLoader(this.manager);
  46484. if (r.setPath(this.path),
  46485. r.setResponseType("arraybuffer"),
  46486. Array.isArray(e))
  46487. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46488. i(h);
  46489. else
  46490. r.load(e, function(e) {
  46491. var t = a._parser(e, !0);
  46492. if (t.isCubemap)
  46493. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46494. s[n] = {
  46495. mipmaps: []
  46496. };
  46497. for (var r = 0; r < t.mipmapCount; r++)
  46498. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46499. s[n].format = t.format,
  46500. s[n].width = t.width,
  46501. s[n].height = t.height
  46502. }
  46503. else
  46504. l.image.width = t.width,
  46505. l.image.height = t.height,
  46506. l.mipmaps = t.mipmaps;
  46507. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46508. l.format = t.format,
  46509. l.needsUpdate = !0,
  46510. o && o(l)
  46511. }, t, n);
  46512. return l
  46513. },
  46514. setPath: function(e) {
  46515. this.path = e
  46516. }
  46517. },
  46518. Ci.Material = function() {
  46519. Object.defineProperty(this, "id", {
  46520. value: Ci.MaterialIdCount++
  46521. }),
  46522. this.uuid = Ci.Math.generateUUID(),
  46523. this.name = "",
  46524. this.type = "Material",
  46525. this.side = Ci.FrontSide,
  46526. this.opacity = 1,
  46527. this.transparent = !1,
  46528. this.blending = Ci.NormalBlending,
  46529. this.blendSrc = Ci.SrcAlphaFactor,
  46530. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46531. this.blendEquation = Ci.AddEquation,
  46532. this.blendSrcAlpha = null,
  46533. this.blendDstAlpha = null,
  46534. this.blendEquationAlpha = null,
  46535. this.depthFunc = Ci.LessEqualDepth,
  46536. this.depthTest = !0,
  46537. this.depthWrite = !0,
  46538. this.colorWrite = !0,
  46539. this.precision = null,
  46540. this.polygonOffset = !1,
  46541. this.polygonOffsetFactor = 0,
  46542. this.polygonOffsetUnits = 0,
  46543. this.alphaTest = 0,
  46544. this.premultipliedAlpha = !1,
  46545. this.overdraw = 0,
  46546. this.visible = !0,
  46547. this._needsUpdate = !0
  46548. }
  46549. ,
  46550. Ci.Material.prototype = {
  46551. constructor: Ci.Material,
  46552. get needsUpdate() {
  46553. return this._needsUpdate
  46554. },
  46555. set needsUpdate(e) {
  46556. !0 === e && this.update(),
  46557. this._needsUpdate = e
  46558. },
  46559. setValues: function(e) {
  46560. if (void 0 !== e)
  46561. for (var t in e) {
  46562. var i = e[t];
  46563. if (void 0 !== i) {
  46564. var n = this[t];
  46565. 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.")
  46566. } else
  46567. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46568. }
  46569. },
  46570. toJSON: function(e) {
  46571. function t(e) {
  46572. var t = [];
  46573. for (var i in e) {
  46574. var n = e[i];
  46575. delete n.metadata,
  46576. t.push(n)
  46577. }
  46578. return t
  46579. }
  46580. var i = void 0 === e;
  46581. i && (e = {
  46582. textures: {},
  46583. images: {}
  46584. });
  46585. var n = {
  46586. metadata: {
  46587. version: 4.4,
  46588. type: "Material",
  46589. generator: "Material.toJSON"
  46590. }
  46591. };
  46592. if (n.uuid = this.uuid,
  46593. n.type = this.type,
  46594. "" !== this.name && (n.name = this.name),
  46595. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46596. .5 !== this.roughness && (n.roughness = this.roughness),
  46597. .5 !== this.metalness && (n.metalness = this.metalness),
  46598. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46599. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46600. void 0 !== this.shininess && (n.shininess = this.shininess),
  46601. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46602. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46603. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46604. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46605. n.bumpScale = this.bumpScale),
  46606. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46607. n.normalScale = this.normalScale.toArray()),
  46608. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46609. n.displacementScale = this.displacementScale,
  46610. n.displacementBias = this.displacementBias),
  46611. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46612. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46613. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46614. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46615. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46616. n.reflectivity = this.reflectivity),
  46617. void 0 !== this.size && (n.size = this.size),
  46618. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46619. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46620. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46621. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46622. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46623. this.opacity < 1 && (n.opacity = this.opacity),
  46624. !0 === this.transparent && (n.transparent = this.transparent),
  46625. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46626. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46627. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46628. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46629. i) {
  46630. var r = t(e.textures)
  46631. , o = t(e.images);
  46632. 0 < r.length && (n.textures = r),
  46633. 0 < o.length && (n.images = o)
  46634. }
  46635. return n
  46636. },
  46637. clone: function() {
  46638. return (new this.constructor).copy(this)
  46639. },
  46640. copy: function(e) {
  46641. return this.name = e.name,
  46642. this.side = e.side,
  46643. this.opacity = e.opacity,
  46644. this.transparent = e.transparent,
  46645. this.blending = e.blending,
  46646. this.blendSrc = e.blendSrc,
  46647. this.blendDst = e.blendDst,
  46648. this.blendEquation = e.blendEquation,
  46649. this.blendSrcAlpha = e.blendSrcAlpha,
  46650. this.blendDstAlpha = e.blendDstAlpha,
  46651. this.blendEquationAlpha = e.blendEquationAlpha,
  46652. this.depthFunc = e.depthFunc,
  46653. this.depthTest = e.depthTest,
  46654. this.depthWrite = e.depthWrite,
  46655. this.colorWrite = e.colorWrite,
  46656. this.precision = e.precision,
  46657. this.polygonOffset = e.polygonOffset,
  46658. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46659. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46660. this.alphaTest = e.alphaTest,
  46661. this.premultipliedAlpha = e.premultipliedAlpha,
  46662. this.overdraw = e.overdraw,
  46663. this.visible = e.visible,
  46664. this
  46665. },
  46666. update: function() {
  46667. this.dispatchEvent({
  46668. type: "update"
  46669. })
  46670. },
  46671. dispose: function() {
  46672. this.dispatchEvent({
  46673. type: "dispose"
  46674. })
  46675. }
  46676. },
  46677. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46678. Ci.MaterialIdCount = 0,
  46679. Ci.LineBasicMaterial = function(e) {
  46680. Ci.Material.call(this),
  46681. this.type = "LineBasicMaterial",
  46682. this.color = new Ci.Color(16777215),
  46683. this.linewidth = 1,
  46684. this.linecap = "round",
  46685. this.linejoin = "round",
  46686. this.blending = Ci.NormalBlending,
  46687. this.vertexColors = Ci.NoColors,
  46688. this.fog = !0,
  46689. this.setValues(e)
  46690. }
  46691. ,
  46692. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46693. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46694. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46695. return Ci.Material.prototype.copy.call(this, e),
  46696. this.color.copy(e.color),
  46697. this.linewidth = e.linewidth,
  46698. this.linecap = e.linecap,
  46699. this.linejoin = e.linejoin,
  46700. this.vertexColors = e.vertexColors,
  46701. this.fog = e.fog,
  46702. this
  46703. }
  46704. ,
  46705. Ci.LineDashedMaterial = function(e) {
  46706. Ci.Material.call(this),
  46707. this.type = "LineDashedMaterial",
  46708. this.color = new Ci.Color(16777215),
  46709. this.linewidth = 1,
  46710. this.scale = 1,
  46711. this.dashSize = 3,
  46712. this.gapSize = 1,
  46713. this.blending = Ci.NormalBlending,
  46714. this.vertexColors = Ci.NoColors,
  46715. this.fog = !0,
  46716. this.setValues(e)
  46717. }
  46718. ,
  46719. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46720. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46721. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46722. return Ci.Material.prototype.copy.call(this, e),
  46723. this.color.copy(e.color),
  46724. this.linewidth = e.linewidth,
  46725. this.scale = e.scale,
  46726. this.dashSize = e.dashSize,
  46727. this.gapSize = e.gapSize,
  46728. this.vertexColors = e.vertexColors,
  46729. this.fog = e.fog,
  46730. this
  46731. }
  46732. ,
  46733. Ci.MeshBasicMaterial = function(e) {
  46734. Ci.Material.call(this),
  46735. this.type = "MeshBasicMaterial",
  46736. this.color = new Ci.Color(16777215),
  46737. this.map = null,
  46738. this.aoMap = null,
  46739. this.aoMapIntensity = 1,
  46740. this.specularMap = null,
  46741. this.alphaMap = null,
  46742. this.envMap = null,
  46743. this.combine = Ci.MultiplyOperation,
  46744. this.reflectivity = 1,
  46745. this.refractionRatio = .98,
  46746. this.fog = !0,
  46747. this.shading = Ci.SmoothShading,
  46748. this.blending = Ci.NormalBlending,
  46749. this.wireframe = !1,
  46750. this.wireframeLinewidth = 1,
  46751. this.wireframeLinecap = "round",
  46752. this.wireframeLinejoin = "round",
  46753. this.vertexColors = Ci.NoColors,
  46754. this.skinning = !1,
  46755. this.morphTargets = !1,
  46756. this.setValues(e)
  46757. }
  46758. ,
  46759. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46760. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46761. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46762. return Ci.Material.prototype.copy.call(this, e),
  46763. this.color.copy(e.color),
  46764. this.map = e.map,
  46765. this.aoMap = e.aoMap,
  46766. this.aoMapIntensity = e.aoMapIntensity,
  46767. this.specularMap = e.specularMap,
  46768. this.alphaMap = e.alphaMap,
  46769. this.envMap = e.envMap,
  46770. this.combine = e.combine,
  46771. this.reflectivity = e.reflectivity,
  46772. this.refractionRatio = e.refractionRatio,
  46773. this.fog = e.fog,
  46774. this.shading = e.shading,
  46775. this.wireframe = e.wireframe,
  46776. this.wireframeLinewidth = e.wireframeLinewidth,
  46777. this.wireframeLinecap = e.wireframeLinecap,
  46778. this.wireframeLinejoin = e.wireframeLinejoin,
  46779. this.vertexColors = e.vertexColors,
  46780. this.skinning = e.skinning,
  46781. this.morphTargets = e.morphTargets,
  46782. this
  46783. }
  46784. ,
  46785. Ci.MeshLambertMaterial = function(e) {
  46786. Ci.Material.call(this),
  46787. this.type = "MeshLambertMaterial",
  46788. this.color = new Ci.Color(16777215),
  46789. this.map = null,
  46790. this.lightMap = null,
  46791. this.lightMapIntensity = 1,
  46792. this.aoMap = null,
  46793. this.aoMapIntensity = 1,
  46794. this.emissive = new Ci.Color(0),
  46795. this.emissiveIntensity = 1,
  46796. this.emissiveMap = null,
  46797. this.specularMap = null,
  46798. this.alphaMap = null,
  46799. this.envMap = null,
  46800. this.combine = Ci.MultiplyOperation,
  46801. this.reflectivity = 1,
  46802. this.refractionRatio = .98,
  46803. this.fog = !0,
  46804. this.blending = Ci.NormalBlending,
  46805. this.wireframe = !1,
  46806. this.wireframeLinewidth = 1,
  46807. this.wireframeLinecap = "round",
  46808. this.wireframeLinejoin = "round",
  46809. this.vertexColors = Ci.NoColors,
  46810. this.skinning = !1,
  46811. this.morphTargets = !1,
  46812. this.morphNormals = !1,
  46813. this.setValues(e)
  46814. }
  46815. ,
  46816. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46817. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46818. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46819. return Ci.Material.prototype.copy.call(this, e),
  46820. this.color.copy(e.color),
  46821. this.map = e.map,
  46822. this.lightMap = e.lightMap,
  46823. this.lightMapIntensity = e.lightMapIntensity,
  46824. this.aoMap = e.aoMap,
  46825. this.aoMapIntensity = e.aoMapIntensity,
  46826. this.emissive.copy(e.emissive),
  46827. this.emissiveMap = e.emissiveMap,
  46828. this.emissiveIntensity = e.emissiveIntensity,
  46829. this.specularMap = e.specularMap,
  46830. this.alphaMap = e.alphaMap,
  46831. this.envMap = e.envMap,
  46832. this.combine = e.combine,
  46833. this.reflectivity = e.reflectivity,
  46834. this.refractionRatio = e.refractionRatio,
  46835. this.fog = e.fog,
  46836. this.wireframe = e.wireframe,
  46837. this.wireframeLinewidth = e.wireframeLinewidth,
  46838. this.wireframeLinecap = e.wireframeLinecap,
  46839. this.wireframeLinejoin = e.wireframeLinejoin,
  46840. this.vertexColors = e.vertexColors,
  46841. this.skinning = e.skinning,
  46842. this.morphTargets = e.morphTargets,
  46843. this.morphNormals = e.morphNormals,
  46844. this
  46845. }
  46846. ,
  46847. Ci.MeshPhongMaterial = function(e) {
  46848. Ci.Material.call(this),
  46849. this.type = "MeshPhongMaterial",
  46850. this.color = new Ci.Color(16777215),
  46851. this.specular = new Ci.Color(1118481),
  46852. this.shininess = 30,
  46853. this.map = null,
  46854. this.lightMap = null,
  46855. this.lightMapIntensity = 1,
  46856. this.aoMap = null,
  46857. this.aoMapIntensity = 1,
  46858. this.emissive = new Ci.Color(0),
  46859. this.emissiveIntensity = 1,
  46860. this.emissiveMap = null,
  46861. this.bumpMap = null,
  46862. this.bumpScale = 1,
  46863. this.normalMap = null,
  46864. this.normalScale = new Ci.Vector2(1,1),
  46865. this.displacementMap = null,
  46866. this.displacementScale = 1,
  46867. this.displacementBias = 0,
  46868. this.specularMap = null,
  46869. this.alphaMap = null,
  46870. this.envMap = null,
  46871. this.combine = Ci.MultiplyOperation,
  46872. this.reflectivity = 1,
  46873. this.refractionRatio = .98,
  46874. this.fog = !0,
  46875. this.shading = Ci.SmoothShading,
  46876. this.blending = Ci.NormalBlending,
  46877. this.wireframe = !1,
  46878. this.wireframeLinewidth = 1,
  46879. this.wireframeLinecap = "round",
  46880. this.wireframeLinejoin = "round",
  46881. this.vertexColors = Ci.NoColors,
  46882. this.skinning = !1,
  46883. this.morphTargets = !1,
  46884. this.morphNormals = !1,
  46885. this.setValues(e)
  46886. }
  46887. ,
  46888. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46889. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46890. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46891. return Ci.Material.prototype.copy.call(this, e),
  46892. this.color.copy(e.color),
  46893. this.specular.copy(e.specular),
  46894. this.shininess = e.shininess,
  46895. this.map = e.map,
  46896. this.lightMap = e.lightMap,
  46897. this.lightMapIntensity = e.lightMapIntensity,
  46898. this.aoMap = e.aoMap,
  46899. this.aoMapIntensity = e.aoMapIntensity,
  46900. this.emissive.copy(e.emissive),
  46901. this.emissiveMap = e.emissiveMap,
  46902. this.emissiveIntensity = e.emissiveIntensity,
  46903. this.bumpMap = e.bumpMap,
  46904. this.bumpScale = e.bumpScale,
  46905. this.normalMap = e.normalMap,
  46906. this.normalScale.copy(e.normalScale),
  46907. this.displacementMap = e.displacementMap,
  46908. this.displacementScale = e.displacementScale,
  46909. this.displacementBias = e.displacementBias,
  46910. this.specularMap = e.specularMap,
  46911. this.alphaMap = e.alphaMap,
  46912. this.envMap = e.envMap,
  46913. this.combine = e.combine,
  46914. this.reflectivity = e.reflectivity,
  46915. this.refractionRatio = e.refractionRatio,
  46916. this.fog = e.fog,
  46917. this.shading = e.shading,
  46918. this.wireframe = e.wireframe,
  46919. this.wireframeLinewidth = e.wireframeLinewidth,
  46920. this.wireframeLinecap = e.wireframeLinecap,
  46921. this.wireframeLinejoin = e.wireframeLinejoin,
  46922. this.vertexColors = e.vertexColors,
  46923. this.skinning = e.skinning,
  46924. this.morphTargets = e.morphTargets,
  46925. this.morphNormals = e.morphNormals,
  46926. this
  46927. }
  46928. ,
  46929. Ci.MeshStandardMaterial = function(e) {
  46930. Ci.Material.call(this),
  46931. this.type = "MeshStandardMaterial",
  46932. this.color = new Ci.Color(16777215),
  46933. this.roughness = .5,
  46934. this.metalness = .5,
  46935. this.map = null,
  46936. this.lightMap = null,
  46937. this.lightMapIntensity = 1,
  46938. this.aoMap = null,
  46939. this.aoMapIntensity = 1,
  46940. this.emissive = new Ci.Color(0),
  46941. this.emissiveIntensity = 1,
  46942. this.emissiveMap = null,
  46943. this.bumpMap = null,
  46944. this.bumpScale = 1,
  46945. this.normalMap = null,
  46946. this.normalScale = new Ci.Vector2(1,1),
  46947. this.displacementMap = null,
  46948. this.displacementScale = 1,
  46949. this.displacementBias = 0,
  46950. this.roughnessMap = null,
  46951. this.metalnessMap = null,
  46952. this.alphaMap = null,
  46953. this.envMap = null,
  46954. this.envMapIntensity = 1,
  46955. this.refractionRatio = .98,
  46956. this.fog = !0,
  46957. this.shading = Ci.SmoothShading,
  46958. this.blending = Ci.NormalBlending,
  46959. this.wireframe = !1,
  46960. this.wireframeLinewidth = 1,
  46961. this.wireframeLinecap = "round",
  46962. this.wireframeLinejoin = "round",
  46963. this.vertexColors = Ci.NoColors,
  46964. this.skinning = !1,
  46965. this.morphTargets = !1,
  46966. this.morphNormals = !1,
  46967. this.setValues(e)
  46968. }
  46969. ,
  46970. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46971. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46972. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46973. return Ci.Material.prototype.copy.call(this, e),
  46974. this.color.copy(e.color),
  46975. this.roughness = e.roughness,
  46976. this.metalness = e.metalness,
  46977. this.map = e.map,
  46978. this.lightMap = e.lightMap,
  46979. this.lightMapIntensity = e.lightMapIntensity,
  46980. this.aoMap = e.aoMap,
  46981. this.aoMapIntensity = e.aoMapIntensity,
  46982. this.emissive.copy(e.emissive),
  46983. this.emissiveMap = e.emissiveMap,
  46984. this.emissiveIntensity = e.emissiveIntensity,
  46985. this.bumpMap = e.bumpMap,
  46986. this.bumpScale = e.bumpScale,
  46987. this.normalMap = e.normalMap,
  46988. this.normalScale.copy(e.normalScale),
  46989. this.displacementMap = e.displacementMap,
  46990. this.displacementScale = e.displacementScale,
  46991. this.displacementBias = e.displacementBias,
  46992. this.roughnessMap = e.roughnessMap,
  46993. this.metalnessMap = e.metalnessMap,
  46994. this.alphaMap = e.alphaMap,
  46995. this.envMap = e.envMap,
  46996. this.envMapIntensity = e.envMapIntensity,
  46997. this.refractionRatio = e.refractionRatio,
  46998. this.fog = e.fog,
  46999. this.shading = e.shading,
  47000. this.wireframe = e.wireframe,
  47001. this.wireframeLinewidth = e.wireframeLinewidth,
  47002. this.wireframeLinecap = e.wireframeLinecap,
  47003. this.wireframeLinejoin = e.wireframeLinejoin,
  47004. this.vertexColors = e.vertexColors,
  47005. this.skinning = e.skinning,
  47006. this.morphTargets = e.morphTargets,
  47007. this.morphNormals = e.morphNormals,
  47008. this
  47009. }
  47010. ,
  47011. Ci.MeshDepthMaterial = function(e) {
  47012. Ci.Material.call(this),
  47013. this.type = "MeshDepthMaterial",
  47014. this.morphTargets = !1,
  47015. this.wireframe = !1,
  47016. this.wireframeLinewidth = 1,
  47017. this.setValues(e)
  47018. }
  47019. ,
  47020. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  47021. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  47022. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  47023. return Ci.Material.prototype.copy.call(this, e),
  47024. this.wireframe = e.wireframe,
  47025. this.wireframeLinewidth = e.wireframeLinewidth,
  47026. this
  47027. }
  47028. ,
  47029. Ci.MeshNormalMaterial = function(e) {
  47030. Ci.Material.call(this, e),
  47031. this.type = "MeshNormalMaterial",
  47032. this.wireframe = !1,
  47033. this.wireframeLinewidth = 1,
  47034. this.morphTargets = !1,
  47035. this.setValues(e)
  47036. }
  47037. ,
  47038. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  47039. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  47040. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  47041. return Ci.Material.prototype.copy.call(this, e),
  47042. this.wireframe = e.wireframe,
  47043. this.wireframeLinewidth = e.wireframeLinewidth,
  47044. this
  47045. }
  47046. ,
  47047. Ci.MultiMaterial = function(e) {
  47048. this.uuid = Ci.Math.generateUUID(),
  47049. this.type = "MultiMaterial",
  47050. this.materials = e instanceof Array ? e : [],
  47051. this.visible = !0
  47052. }
  47053. ,
  47054. Ci.MultiMaterial.prototype = {
  47055. constructor: Ci.MultiMaterial,
  47056. toJSON: function(e) {
  47057. for (var t = {
  47058. metadata: {
  47059. version: 4.2,
  47060. type: "material",
  47061. generator: "MaterialExporter"
  47062. },
  47063. uuid: this.uuid,
  47064. type: this.type,
  47065. materials: []
  47066. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47067. var o = i[n].toJSON(e);
  47068. delete o.metadata,
  47069. t.materials.push(o)
  47070. }
  47071. return t.visible = this.visible,
  47072. t
  47073. },
  47074. clone: function() {
  47075. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47076. e.materials.push(this.materials[t].clone());
  47077. return e.visible = this.visible,
  47078. e
  47079. }
  47080. },
  47081. Ci.PointsMaterial = function(e) {
  47082. Ci.Material.call(this),
  47083. this.type = "PointsMaterial",
  47084. this.color = new Ci.Color(16777215),
  47085. this.map = null,
  47086. this.size = 1,
  47087. this.sizeAttenuation = !0,
  47088. this.blending = Ci.NormalBlending,
  47089. this.vertexColors = Ci.NoColors,
  47090. this.fog = !0,
  47091. this.setValues(e)
  47092. }
  47093. ,
  47094. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  47095. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  47096. Ci.PointsMaterial.prototype.copy = function(e) {
  47097. return Ci.Material.prototype.copy.call(this, e),
  47098. this.color.copy(e.color),
  47099. this.map = e.map,
  47100. this.size = e.size,
  47101. this.sizeAttenuation = e.sizeAttenuation,
  47102. this.vertexColors = e.vertexColors,
  47103. this.fog = e.fog,
  47104. this
  47105. }
  47106. ,
  47107. Ci.ShaderMaterial = function(e) {
  47108. Ci.Material.call(this),
  47109. this.type = "ShaderMaterial",
  47110. this.defines = {},
  47111. this.uniforms = {},
  47112. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47113. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47114. this.shading = Ci.SmoothShading,
  47115. this.linewidth = 1,
  47116. this.wireframe = !1,
  47117. this.wireframeLinewidth = 1,
  47118. this.fog = !1,
  47119. this.lights = !1,
  47120. this.vertexColors = Ci.NoColors,
  47121. this.skinning = !1,
  47122. this.morphTargets = !1,
  47123. this.morphNormals = !1,
  47124. this.extensions = {
  47125. derivatives: !1,
  47126. fragDepth: !1,
  47127. drawBuffers: !1,
  47128. shaderTextureLOD: !1
  47129. },
  47130. this.defaultAttributeValues = {
  47131. color: [1, 1, 1],
  47132. uv: [0, 0],
  47133. uv2: [0, 0]
  47134. },
  47135. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47136. this.setValues(e))
  47137. }
  47138. ,
  47139. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  47140. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  47141. Ci.ShaderMaterial.prototype.copy = function(e) {
  47142. return Ci.Material.prototype.copy.call(this, e),
  47143. this.fragmentShader = e.fragmentShader,
  47144. this.vertexShader = e.vertexShader,
  47145. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  47146. this.defines = e.defines,
  47147. this.shading = e.shading,
  47148. this.wireframe = e.wireframe,
  47149. this.wireframeLinewidth = e.wireframeLinewidth,
  47150. this.fog = e.fog,
  47151. this.lights = e.lights,
  47152. this.vertexColors = e.vertexColors,
  47153. this.skinning = e.skinning,
  47154. this.morphTargets = e.morphTargets,
  47155. this.morphNormals = e.morphNormals,
  47156. this.extensions = e.extensions,
  47157. this
  47158. }
  47159. ,
  47160. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  47161. var t = Ci.Material.prototype.toJSON.call(this, e);
  47162. return t.uniforms = this.uniforms,
  47163. t.vertexShader = this.vertexShader,
  47164. t.fragmentShader = this.fragmentShader,
  47165. t
  47166. }
  47167. ,
  47168. Ci.RawShaderMaterial = function(e) {
  47169. Ci.ShaderMaterial.call(this, e),
  47170. this.type = "RawShaderMaterial"
  47171. }
  47172. ,
  47173. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  47174. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  47175. Ci.SpriteMaterial = function(e) {
  47176. Ci.Material.call(this),
  47177. this.type = "SpriteMaterial",
  47178. this.color = new Ci.Color(16777215),
  47179. this.map = null,
  47180. this.rotation = 0,
  47181. this.fog = !1,
  47182. this.setValues(e)
  47183. }
  47184. ,
  47185. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  47186. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  47187. Ci.SpriteMaterial.prototype.copy = function(e) {
  47188. return Ci.Material.prototype.copy.call(this, e),
  47189. this.color.copy(e.color),
  47190. this.map = e.map,
  47191. this.rotation = e.rotation,
  47192. this.fog = e.fog,
  47193. this
  47194. }
  47195. ,
  47196. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  47197. Object.defineProperty(this, "id", {
  47198. value: Ci.TextureIdCount++
  47199. }),
  47200. this.uuid = Ci.Math.generateUUID(),
  47201. this.name = "",
  47202. this.sourceFile = "",
  47203. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  47204. this.mipmaps = [],
  47205. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  47206. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  47207. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47208. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47209. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47210. this.anisotropy = void 0 !== l ? l : 1,
  47211. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47212. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47213. this.offset = new Ci.Vector2(0,0),
  47214. this.repeat = new Ci.Vector2(1,1),
  47215. this.generateMipmaps = !0,
  47216. this.premultiplyAlpha = !1,
  47217. this.flipY = !0,
  47218. this.unpackAlignment = 4,
  47219. this.encoding = Ci.LinearEncoding,
  47220. this.version = 0,
  47221. this.onUpdate = null
  47222. }
  47223. ,
  47224. Ci.Texture.DEFAULT_IMAGE = void 0,
  47225. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47226. Ci.Texture.prototype = {
  47227. constructor: Ci.Texture,
  47228. set needsUpdate(e) {
  47229. !0 === e && this.version++
  47230. },
  47231. clone: function() {
  47232. return (new this.constructor).copy(this)
  47233. },
  47234. copy: function(e) {
  47235. return this.image = e.image,
  47236. this.mipmaps = e.mipmaps.slice(0),
  47237. this.mapping = e.mapping,
  47238. this.wrapS = e.wrapS,
  47239. this.wrapT = e.wrapT,
  47240. this.magFilter = e.magFilter,
  47241. this.minFilter = e.minFilter,
  47242. this.anisotropy = e.anisotropy,
  47243. this.format = e.format,
  47244. this.type = e.type,
  47245. this.offset.copy(e.offset),
  47246. this.repeat.copy(e.repeat),
  47247. this.generateMipmaps = e.generateMipmaps,
  47248. this.premultiplyAlpha = e.premultiplyAlpha,
  47249. this.flipY = e.flipY,
  47250. this.unpackAlignment = e.unpackAlignment,
  47251. this.encoding = e.encoding,
  47252. this
  47253. },
  47254. toJSON: function(e) {
  47255. if (void 0 !== e.textures[this.uuid])
  47256. return e.textures[this.uuid];
  47257. var t, i, n = {
  47258. metadata: {
  47259. version: 4.4,
  47260. type: "Texture",
  47261. generator: "Texture.toJSON"
  47262. },
  47263. uuid: this.uuid,
  47264. name: this.name,
  47265. mapping: this.mapping,
  47266. repeat: [this.repeat.x, this.repeat.y],
  47267. offset: [this.offset.x, this.offset.y],
  47268. wrap: [this.wrapS, this.wrapT],
  47269. minFilter: this.minFilter,
  47270. magFilter: this.magFilter,
  47271. anisotropy: this.anisotropy
  47272. };
  47273. if (void 0 !== this.image) {
  47274. var r = this.image;
  47275. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47276. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47277. uuid: r.uuid,
  47278. url: (t = r,
  47279. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47280. i.height = t.height,
  47281. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47282. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47283. }),
  47284. n.image = r.uuid
  47285. }
  47286. return e.textures[this.uuid] = n
  47287. },
  47288. dispose: function() {
  47289. this.dispatchEvent({
  47290. type: "dispose"
  47291. })
  47292. },
  47293. transformUv: function(e) {
  47294. if (this.mapping === Ci.UVMapping) {
  47295. if (e.multiply(this.repeat),
  47296. e.add(this.offset),
  47297. e.x < 0 || 1 < e.x)
  47298. switch (this.wrapS) {
  47299. case Ci.RepeatWrapping:
  47300. e.x = e.x - Math.floor(e.x);
  47301. break;
  47302. case Ci.ClampToEdgeWrapping:
  47303. e.x = e.x < 0 ? 0 : 1;
  47304. break;
  47305. case Ci.MirroredRepeatWrapping:
  47306. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47307. }
  47308. if (e.y < 0 || 1 < e.y)
  47309. switch (this.wrapT) {
  47310. case Ci.RepeatWrapping:
  47311. e.y = e.y - Math.floor(e.y);
  47312. break;
  47313. case Ci.ClampToEdgeWrapping:
  47314. e.y = e.y < 0 ? 0 : 1;
  47315. break;
  47316. case Ci.MirroredRepeatWrapping:
  47317. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47318. }
  47319. this.flipY && (e.y = 1 - e.y)
  47320. }
  47321. }
  47322. },
  47323. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47324. Ci.TextureIdCount = 0,
  47325. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47326. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47327. this.needsUpdate = !0
  47328. }
  47329. ,
  47330. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47331. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47332. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47333. e = void 0 !== e ? e : [],
  47334. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47335. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47336. this.flipY = !1
  47337. }
  47338. ,
  47339. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47340. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47341. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47342. get: function() {
  47343. return this.image
  47344. },
  47345. set: function(e) {
  47346. this.image = e
  47347. }
  47348. }),
  47349. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47350. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47351. this.image = {
  47352. width: t,
  47353. height: i
  47354. },
  47355. this.mipmaps = e,
  47356. this.flipY = !1,
  47357. this.generateMipmaps = !1
  47358. }
  47359. ,
  47360. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47361. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47362. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47363. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47364. this.image = {
  47365. data: e,
  47366. width: t,
  47367. height: i
  47368. },
  47369. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47370. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47371. this.flipY = !1,
  47372. this.generateMipmaps = !1
  47373. }
  47374. ,
  47375. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47376. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47377. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47378. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47379. this.generateMipmaps = !1;
  47380. var c = this;
  47381. !function e() {
  47382. requestAnimationFrame(e),
  47383. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47384. }()
  47385. }
  47386. ,
  47387. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47388. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47389. Ci.Group = function() {
  47390. Ci.Object3D.call(this),
  47391. this.type = "Group"
  47392. }
  47393. ,
  47394. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47395. Ci.Group.prototype.constructor = Ci.Group,
  47396. Ci.Points = function(e, t) {
  47397. Ci.Object3D.call(this),
  47398. this.type = "Points",
  47399. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47400. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47401. color: 16777215 * Math.random()
  47402. })
  47403. }
  47404. ,
  47405. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47406. Ci.Points.prototype.constructor = Ci.Points,
  47407. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47408. jt = new Ci.Ray,
  47409. Yt = new Ci.Sphere,
  47410. function(o, a) {
  47411. function e(e, t) {
  47412. var i = jt.distanceSqToPoint(e);
  47413. if (i < c) {
  47414. var n = jt.closestPointToPoint(e);
  47415. n.applyMatrix4(l);
  47416. var r = o.ray.origin.distanceTo(n);
  47417. if (r < o.near || r > o.far)
  47418. return;
  47419. a.push({
  47420. distance: r,
  47421. distanceToRay: Math.sqrt(i),
  47422. point: n.clone(),
  47423. index: t,
  47424. face: null,
  47425. object: s
  47426. })
  47427. }
  47428. }
  47429. var s = this
  47430. , t = this.geometry
  47431. , l = this.matrixWorld
  47432. , i = o.params.Points.threshold;
  47433. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47434. Yt.copy(t.boundingSphere),
  47435. Yt.applyMatrix4(l),
  47436. !1 !== o.ray.intersectsSphere(Yt)) {
  47437. Wt.getInverse(l),
  47438. jt.copy(o.ray).applyMatrix4(Wt);
  47439. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47440. , c = n * n
  47441. , r = new Ci.Vector3;
  47442. if (t instanceof Ci.BufferGeometry) {
  47443. var h = t.index
  47444. , u = t.attributes.position.array;
  47445. if (null !== h)
  47446. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47447. var g = d[p];
  47448. r.fromArray(u, 3 * g),
  47449. e(r, g)
  47450. }
  47451. else {
  47452. p = 0;
  47453. for (var m = u.length / 3; p < m; p++)
  47454. r.fromArray(u, 3 * p),
  47455. e(r, p)
  47456. }
  47457. } else {
  47458. var v = t.vertices;
  47459. for (p = 0,
  47460. m = v.length; p < m; p++)
  47461. e(v[p], p)
  47462. }
  47463. }
  47464. }
  47465. ),
  47466. Ci.Points.prototype.clone = function() {
  47467. return new this.constructor(this.geometry,this.material).copy(this)
  47468. }
  47469. ,
  47470. Ci.Line = function(e, t, i) {
  47471. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47472. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47473. this.type = "Line",
  47474. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47475. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47476. color: 16777215 * Math.random()
  47477. })))
  47478. }
  47479. ,
  47480. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47481. Ci.Line.prototype.constructor = Ci.Line,
  47482. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47483. zt = new Ci.Ray,
  47484. Gt = new Ci.Sphere,
  47485. function(e, t) {
  47486. var i = e.linePrecision
  47487. , n = i * i
  47488. , r = this.geometry
  47489. , o = this.matrixWorld;
  47490. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47491. Gt.copy(r.boundingSphere),
  47492. Gt.applyMatrix4(o),
  47493. !1 !== e.ray.intersectsSphere(Gt)) {
  47494. Ht.getInverse(o),
  47495. zt.copy(e.ray).applyMatrix4(Ht);
  47496. var a = new Ci.Vector3
  47497. , s = new Ci.Vector3
  47498. , l = new Ci.Vector3
  47499. , c = new Ci.Vector3
  47500. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47501. if (r instanceof Ci.BufferGeometry) {
  47502. var u = r.index
  47503. , d = r.attributes.position.array;
  47504. if (null !== u)
  47505. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47506. var m = p[f]
  47507. , v = p[f + 1];
  47508. a.fromArray(d, 3 * m),
  47509. s.fromArray(d, 3 * v),
  47510. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47511. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47512. distance: C,
  47513. point: l.clone().applyMatrix4(this.matrixWorld),
  47514. index: f,
  47515. face: null,
  47516. faceIndex: null,
  47517. object: this
  47518. }))
  47519. }
  47520. else
  47521. for (f = 0,
  47522. g = d.length / 3 - 1; f < g; f += h)
  47523. a.fromArray(d, 3 * f),
  47524. s.fromArray(d, 3 * f + 3),
  47525. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47526. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47527. distance: C,
  47528. point: l.clone().applyMatrix4(this.matrixWorld),
  47529. index: f,
  47530. face: null,
  47531. faceIndex: null,
  47532. object: this
  47533. }))
  47534. } else if (r instanceof Ci.Geometry) {
  47535. var y = r.vertices
  47536. , A = y.length;
  47537. for (f = 0; f < A - 1; f += h) {
  47538. var C;
  47539. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47540. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47541. distance: C,
  47542. point: l.clone().applyMatrix4(this.matrixWorld),
  47543. index: f,
  47544. face: null,
  47545. faceIndex: null,
  47546. object: this
  47547. }))
  47548. }
  47549. }
  47550. }
  47551. }
  47552. ),
  47553. Ci.Line.prototype.clone = function() {
  47554. return new this.constructor(this.geometry,this.material).copy(this)
  47555. }
  47556. ,
  47557. Ci.LineStrip = 0,
  47558. Ci.LinePieces = 1,
  47559. Ci.LineSegments = function(e, t) {
  47560. Ci.Line.call(this, e, t),
  47561. this.type = "LineSegments"
  47562. }
  47563. ,
  47564. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47565. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47566. Ci.Mesh = function(e, t) {
  47567. Ci.Object3D.call(this),
  47568. this.type = "Mesh",
  47569. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47570. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47571. color: 16777215 * Math.random()
  47572. }),
  47573. this.drawMode = Ci.TrianglesDrawMode,
  47574. this.updateMorphTargets()
  47575. }
  47576. ,
  47577. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47578. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47579. Ci.Mesh.prototype.setDrawMode = function(e) {
  47580. this.drawMode = e
  47581. }
  47582. ,
  47583. Ci.Mesh.prototype.updateMorphTargets = function() {
  47584. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47585. this.morphTargetBase = -1,
  47586. this.morphTargetInfluences = [],
  47587. this.morphTargetDictionary = {};
  47588. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47589. this.morphTargetInfluences.push(0),
  47590. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47591. }
  47592. }
  47593. ,
  47594. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47595. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47596. 0)
  47597. }
  47598. ,
  47599. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47600. xt = new Ci.Ray,
  47601. St = new Ci.Sphere,
  47602. Mt = new Ci.Vector3,
  47603. Rt = new Ci.Vector3,
  47604. Pt = new Ci.Vector3,
  47605. Ot = new Ci.Vector3,
  47606. Lt = new Ci.Vector3,
  47607. Dt = new Ci.Vector3,
  47608. Nt = new Ci.Vector2,
  47609. Ft = new Ci.Vector2,
  47610. Bt = new Ci.Vector2,
  47611. Vt = new Ci.Vector3,
  47612. kt = new Ci.Vector3,
  47613. Ut = new Ci.Vector3,
  47614. function(e, t) {
  47615. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47616. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47617. St.copy(r.boundingSphere),
  47618. St.applyMatrix4(a),
  47619. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47620. xt.copy(e.ray).applyMatrix4(Tt),
  47621. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47622. if (r instanceof Ci.BufferGeometry) {
  47623. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47624. if (void 0 !== u.uv && (i = u.uv.array),
  47625. null !== h)
  47626. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47627. s = p[f],
  47628. l = p[f + 1],
  47629. c = p[f + 2],
  47630. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47631. t.push(n));
  47632. else
  47633. for (f = 0,
  47634. g = d.length; f < g; f += 9)
  47635. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47636. t.push(n))
  47637. } else if (r instanceof Ci.Geometry) {
  47638. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47639. 0 < _.length && (i = _);
  47640. for (var b = 0, w = E.length; b < w; b++) {
  47641. var T = E[b]
  47642. , x = 1 == A ? C[T.materialIndex] : o;
  47643. if (void 0 !== x) {
  47644. if (m = I[T.a],
  47645. v = I[T.b],
  47646. y = I[T.c],
  47647. !0 === x.morphTargets) {
  47648. var S = r.morphTargets
  47649. , M = this.morphTargetInfluences;
  47650. Mt.set(0, 0, 0),
  47651. Rt.set(0, 0, 0),
  47652. Pt.set(0, 0, 0);
  47653. for (var R = 0, P = S.length; R < P; R++) {
  47654. var O = M[R];
  47655. if (0 !== O) {
  47656. var L = S[R].vertices;
  47657. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47658. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47659. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47660. }
  47661. }
  47662. Mt.add(m),
  47663. Rt.add(v),
  47664. Pt.add(y),
  47665. m = Mt,
  47666. v = Rt,
  47667. y = Pt
  47668. }
  47669. if (n = wi(this, e, xt, m, v, y, kt)) {
  47670. if (i) {
  47671. var D = i[b];
  47672. Nt.copy(D[0]),
  47673. Ft.copy(D[1]),
  47674. Bt.copy(D[2]),
  47675. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47676. }
  47677. n.face = T,
  47678. n.faceIndex = b,
  47679. t.push(n)
  47680. }
  47681. }
  47682. }
  47683. }
  47684. }
  47685. ),
  47686. Ci.Mesh.prototype.clone = function() {
  47687. return new this.constructor(this.geometry,this.material).copy(this)
  47688. }
  47689. ,
  47690. Ci.Bone = function(e) {
  47691. Ci.Object3D.call(this),
  47692. this.type = "Bone",
  47693. this.skin = e
  47694. }
  47695. ,
  47696. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47697. Ci.Bone.prototype.constructor = Ci.Bone,
  47698. Ci.Bone.prototype.copy = function(e) {
  47699. return Ci.Object3D.prototype.copy.call(this, e),
  47700. this.skin = e.skin,
  47701. this
  47702. }
  47703. ,
  47704. Ci.Skeleton = function(e, t, i) {
  47705. if (this.useVertexTexture = void 0 === i || i,
  47706. this.identityMatrix = new Ci.Matrix4,
  47707. e = e || [],
  47708. this.bones = e.slice(0),
  47709. this.useVertexTexture) {
  47710. var n = Math.sqrt(4 * this.bones.length);
  47711. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47712. n = Math.max(n, 4),
  47713. this.boneTextureWidth = n,
  47714. this.boneTextureHeight = n,
  47715. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47716. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47717. } else
  47718. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47719. if (void 0 === t)
  47720. this.calculateInverses();
  47721. else if (this.bones.length === t.length)
  47722. this.boneInverses = t.slice(0);
  47723. else {
  47724. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47725. this.boneInverses = [];
  47726. for (var r = 0, o = this.bones.length; r < o; r++)
  47727. this.boneInverses.push(new Ci.Matrix4)
  47728. }
  47729. }
  47730. ,
  47731. Ci.Skeleton.prototype.calculateInverses = function() {
  47732. this.boneInverses = [];
  47733. for (var e = 0, t = this.bones.length; e < t; e++) {
  47734. var i = new Ci.Matrix4;
  47735. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47736. this.boneInverses.push(i)
  47737. }
  47738. }
  47739. ,
  47740. Ci.Skeleton.prototype.pose = function() {
  47741. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47742. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47743. for (t = 0,
  47744. i = this.bones.length; t < i; t++)
  47745. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47746. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47747. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47748. }
  47749. ,
  47750. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47751. function() {
  47752. for (var e = 0, t = this.bones.length; e < t; e++) {
  47753. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47754. wt.multiplyMatrices(i, this.boneInverses[e]),
  47755. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47756. }
  47757. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47758. }
  47759. ),
  47760. Ci.Skeleton.prototype.clone = function() {
  47761. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47762. }
  47763. ,
  47764. Ci.SkinnedMesh = function(e, t, i) {
  47765. Ci.Mesh.call(this, e, t),
  47766. this.type = "SkinnedMesh",
  47767. this.bindMode = "attached",
  47768. this.bindMatrix = new Ci.Matrix4,
  47769. this.bindMatrixInverse = new Ci.Matrix4;
  47770. var n = [];
  47771. if (this.geometry && void 0 !== this.geometry.bones) {
  47772. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47773. o = this.geometry.bones[a],
  47774. r = new Ci.Bone(this),
  47775. n.push(r),
  47776. r.name = o.name,
  47777. r.position.fromArray(o.pos),
  47778. r.quaternion.fromArray(o.rotq),
  47779. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47780. for (a = 0,
  47781. s = this.geometry.bones.length; a < s; ++a)
  47782. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47783. }
  47784. this.normalizeSkinWeights(),
  47785. this.updateMatrixWorld(!0),
  47786. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47787. }
  47788. ,
  47789. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47790. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47791. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47792. this.skeleton = e,
  47793. void 0 === t && (this.updateMatrixWorld(!0),
  47794. this.skeleton.calculateInverses(),
  47795. t = this.matrixWorld),
  47796. this.bindMatrix.copy(t),
  47797. this.bindMatrixInverse.getInverse(t)
  47798. }
  47799. ,
  47800. Ci.SkinnedMesh.prototype.pose = function() {
  47801. this.skeleton.pose()
  47802. }
  47803. ,
  47804. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47805. if (this.geometry instanceof Ci.Geometry)
  47806. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47807. var t = this.geometry.skinWeights[e];
  47808. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47809. }
  47810. else if (this.geometry instanceof Ci.BufferGeometry) {
  47811. var i = new Ci.Vector4
  47812. , n = this.geometry.attributes.skinWeight;
  47813. for (e = 0; e < n.count; e++) {
  47814. var r;
  47815. i.x = n.getX(e),
  47816. i.y = n.getY(e),
  47817. i.z = n.getZ(e),
  47818. i.w = n.getW(e),
  47819. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47820. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47821. }
  47822. }
  47823. }
  47824. ,
  47825. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47826. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47827. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47828. }
  47829. ,
  47830. Ci.SkinnedMesh.prototype.clone = function() {
  47831. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47832. }
  47833. ,
  47834. Ci.LOD = function() {
  47835. Ci.Object3D.call(this),
  47836. this.type = "LOD",
  47837. Object.defineProperties(this, {
  47838. levels: {
  47839. enumerable: !0,
  47840. value: []
  47841. },
  47842. objects: {
  47843. get: function() {
  47844. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47845. this.levels
  47846. }
  47847. }
  47848. })
  47849. }
  47850. ,
  47851. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47852. Ci.LOD.prototype.constructor = Ci.LOD,
  47853. Ci.LOD.prototype.addLevel = function(e, t) {
  47854. void 0 === t && (t = 0),
  47855. t = Math.abs(t);
  47856. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47857. ;
  47858. i.splice(n, 0, {
  47859. distance: t,
  47860. object: e
  47861. }),
  47862. this.add(e)
  47863. }
  47864. ,
  47865. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47866. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47867. ;
  47868. return t[i - 1].object
  47869. }
  47870. ,
  47871. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47872. function(e, t) {
  47873. bt.setFromMatrixPosition(this.matrixWorld);
  47874. var i = e.ray.origin.distanceTo(bt);
  47875. this.getObjectForDistance(i).raycast(e, t)
  47876. }
  47877. ),
  47878. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47879. _t = new Ci.Vector3,
  47880. function(e) {
  47881. var t = this.levels;
  47882. if (1 < t.length) {
  47883. Et.setFromMatrixPosition(e.matrixWorld),
  47884. _t.setFromMatrixPosition(this.matrixWorld);
  47885. var i = Et.distanceTo(_t);
  47886. t[0].object.visible = !0;
  47887. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47888. t[n - 1].object.visible = !1,
  47889. t[n].object.visible = !0;
  47890. for (; n < r; n++)
  47891. t[n].object.visible = !1
  47892. }
  47893. }
  47894. ),
  47895. Ci.LOD.prototype.copy = function(e) {
  47896. Ci.Object3D.prototype.copy.call(this, e, !1);
  47897. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47898. var r = t[i];
  47899. this.addLevel(r.object.clone(), r.distance)
  47900. }
  47901. return this
  47902. }
  47903. ,
  47904. Ci.LOD.prototype.toJSON = function(e) {
  47905. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47906. t.object.levels = [];
  47907. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47908. var o = i[n];
  47909. t.object.levels.push({
  47910. object: o.object.uuid,
  47911. distance: o.distance
  47912. })
  47913. }
  47914. return t
  47915. }
  47916. ,
  47917. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47918. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47919. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47920. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47921. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47922. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47923. function(e) {
  47924. Ci.Object3D.call(this),
  47925. this.type = "Sprite",
  47926. this.geometry = It,
  47927. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47928. }
  47929. ),
  47930. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47931. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47932. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47933. function(e, t) {
  47934. vt.setFromMatrixPosition(this.matrixWorld);
  47935. var i = e.ray.distanceSqToPoint(vt);
  47936. this.scale.x * this.scale.y < i || t.push({
  47937. distance: Math.sqrt(i),
  47938. point: this.position,
  47939. face: null,
  47940. object: this
  47941. })
  47942. }
  47943. ),
  47944. Ci.Sprite.prototype.clone = function() {
  47945. return new this.constructor(this.material).copy(this)
  47946. }
  47947. ,
  47948. Ci.Particle = Ci.Sprite,
  47949. Ci.LensFlare = function(e, t, i, n, r) {
  47950. Ci.Object3D.call(this),
  47951. this.lensFlares = [],
  47952. this.positionScreen = new Ci.Vector3,
  47953. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47954. }
  47955. ,
  47956. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47957. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47958. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47959. void 0 === t && (t = -1),
  47960. void 0 === i && (i = 0),
  47961. void 0 === o && (o = 1),
  47962. void 0 === r && (r = new Ci.Color(16777215)),
  47963. void 0 === n && (n = Ci.NormalBlending),
  47964. i = Math.min(i, Math.max(0, i)),
  47965. this.lensFlares.push({
  47966. texture: e,
  47967. size: t,
  47968. distance: i,
  47969. x: 0,
  47970. y: 0,
  47971. z: 0,
  47972. scale: 1,
  47973. rotation: 0,
  47974. opacity: o,
  47975. color: r,
  47976. blending: n
  47977. })
  47978. }
  47979. ,
  47980. Ci.LensFlare.prototype.updateLensFlares = function() {
  47981. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47982. for (e = 0; e < i; e++)
  47983. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47984. t.y = this.positionScreen.y + r * t.distance,
  47985. t.wantedRotation = t.x * Math.PI * .25,
  47986. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47987. }
  47988. ,
  47989. Ci.LensFlare.prototype.copy = function(e) {
  47990. Ci.Object3D.prototype.copy.call(this, e),
  47991. this.positionScreen.copy(e.positionScreen),
  47992. this.customUpdateCallback = e.customUpdateCallback;
  47993. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47994. this.lensFlares.push(e.lensFlares[t]);
  47995. return this
  47996. }
  47997. ,
  47998. Ci.Scene = function() {
  47999. Ci.Object3D.call(this),
  48000. this.type = "Scene",
  48001. this.fog = null,
  48002. this.overrideMaterial = null,
  48003. this.autoUpdate = !0
  48004. }
  48005. ,
  48006. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  48007. Ci.Scene.prototype.constructor = Ci.Scene,
  48008. Ci.Scene.prototype.copy = function(e, t) {
  48009. return Ci.Object3D.prototype.copy.call(this, e, t),
  48010. null !== e.fog && (this.fog = e.fog.clone()),
  48011. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48012. this.autoUpdate = e.autoUpdate,
  48013. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48014. this
  48015. }
  48016. ,
  48017. Ci.Fog = function(e, t, i) {
  48018. this.name = "",
  48019. this.color = new Ci.Color(e),
  48020. this.near = void 0 !== t ? t : 1,
  48021. this.far = void 0 !== i ? i : 1e3
  48022. }
  48023. ,
  48024. Ci.Fog.prototype.clone = function() {
  48025. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  48026. }
  48027. ,
  48028. Ci.FogExp2 = function(e, t) {
  48029. this.name = "",
  48030. this.color = new Ci.Color(e),
  48031. this.density = void 0 !== t ? t : 25e-5
  48032. }
  48033. ,
  48034. Ci.FogExp2.prototype.clone = function() {
  48035. return new Ci.FogExp2(this.color.getHex(),this.density)
  48036. }
  48037. ,
  48038. Ci.ShaderChunk = {},
  48039. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48040. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48041. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48042. 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",
  48043. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48044. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48045. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48046. 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",
  48047. 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",
  48048. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48049. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48050. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48051. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48052. 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",
  48053. 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",
  48054. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48055. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48056. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48057. 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",
  48058. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48059. 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",
  48060. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48061. 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",
  48062. 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",
  48063. 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",
  48064. 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",
  48065. 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",
  48066. 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",
  48067. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48068. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48069. 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",
  48070. 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",
  48071. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48072. 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",
  48073. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48074. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48075. 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",
  48076. 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",
  48077. 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",
  48078. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48079. 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",
  48080. 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",
  48081. 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",
  48082. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48083. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48084. 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",
  48085. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48086. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48087. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48088. 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",
  48089. 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",
  48090. 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",
  48091. 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",
  48092. 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",
  48093. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48094. 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",
  48095. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48096. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48097. 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",
  48098. 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",
  48099. 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",
  48100. 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",
  48101. 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",
  48102. 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",
  48103. 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",
  48104. 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",
  48105. 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",
  48106. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48107. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48108. 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",
  48109. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48110. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48111. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48112. 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",
  48113. 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",
  48114. 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",
  48115. 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",
  48116. Ci.UniformsUtils = {
  48117. merge: function(e) {
  48118. for (var t = {}, i = 0; i < e.length; i++) {
  48119. var n = this.clone(e[i]);
  48120. for (var r in n)
  48121. t[r] = n[r]
  48122. }
  48123. return t
  48124. },
  48125. clone: function(e) {
  48126. var t = {};
  48127. for (var i in e)
  48128. for (var n in t[i] = {},
  48129. e[i]) {
  48130. var r = e[i][n];
  48131. 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
  48132. }
  48133. return t
  48134. }
  48135. },
  48136. Ci.UniformsLib = {
  48137. common: {
  48138. diffuse: {
  48139. type: "c",
  48140. value: new Ci.Color(15658734)
  48141. },
  48142. opacity: {
  48143. type: "f",
  48144. value: 1
  48145. },
  48146. map: {
  48147. type: "t",
  48148. value: null
  48149. },
  48150. offsetRepeat: {
  48151. type: "v4",
  48152. value: new Ci.Vector4(0,0,1,1)
  48153. },
  48154. specularMap: {
  48155. type: "t",
  48156. value: null
  48157. },
  48158. alphaMap: {
  48159. type: "t",
  48160. value: null
  48161. },
  48162. envMap: {
  48163. type: "t",
  48164. value: null
  48165. },
  48166. flipEnvMap: {
  48167. type: "f",
  48168. value: -1
  48169. },
  48170. reflectivity: {
  48171. type: "f",
  48172. value: 1
  48173. },
  48174. refractionRatio: {
  48175. type: "f",
  48176. value: .98
  48177. }
  48178. },
  48179. aomap: {
  48180. aoMap: {
  48181. type: "t",
  48182. value: null
  48183. },
  48184. aoMapIntensity: {
  48185. type: "f",
  48186. value: 1
  48187. }
  48188. },
  48189. lightmap: {
  48190. lightMap: {
  48191. type: "t",
  48192. value: null
  48193. },
  48194. lightMapIntensity: {
  48195. type: "f",
  48196. value: 1
  48197. }
  48198. },
  48199. emissivemap: {
  48200. emissiveMap: {
  48201. type: "t",
  48202. value: null
  48203. }
  48204. },
  48205. bumpmap: {
  48206. bumpMap: {
  48207. type: "t",
  48208. value: null
  48209. },
  48210. bumpScale: {
  48211. type: "f",
  48212. value: 1
  48213. }
  48214. },
  48215. normalmap: {
  48216. normalMap: {
  48217. type: "t",
  48218. value: null
  48219. },
  48220. normalScale: {
  48221. type: "v2",
  48222. value: new Ci.Vector2(1,1)
  48223. }
  48224. },
  48225. displacementmap: {
  48226. displacementMap: {
  48227. type: "t",
  48228. value: null
  48229. },
  48230. displacementScale: {
  48231. type: "f",
  48232. value: 1
  48233. },
  48234. displacementBias: {
  48235. type: "f",
  48236. value: 0
  48237. }
  48238. },
  48239. roughnessmap: {
  48240. roughnessMap: {
  48241. type: "t",
  48242. value: null
  48243. }
  48244. },
  48245. metalnessmap: {
  48246. metalnessMap: {
  48247. type: "t",
  48248. value: null
  48249. }
  48250. },
  48251. fog: {
  48252. fogDensity: {
  48253. type: "f",
  48254. value: 25e-5
  48255. },
  48256. fogNear: {
  48257. type: "f",
  48258. value: 1
  48259. },
  48260. fogFar: {
  48261. type: "f",
  48262. value: 2e3
  48263. },
  48264. fogColor: {
  48265. type: "c",
  48266. value: new Ci.Color(16777215)
  48267. }
  48268. },
  48269. lights: {
  48270. ambientLightColor: {
  48271. type: "fv",
  48272. value: []
  48273. },
  48274. directionalLights: {
  48275. type: "sa",
  48276. value: [],
  48277. properties: {
  48278. direction: {
  48279. type: "v3"
  48280. },
  48281. color: {
  48282. type: "c"
  48283. },
  48284. shadow: {
  48285. type: "i"
  48286. },
  48287. shadowBias: {
  48288. type: "f"
  48289. },
  48290. shadowRadius: {
  48291. type: "f"
  48292. },
  48293. shadowMapSize: {
  48294. type: "v2"
  48295. }
  48296. }
  48297. },
  48298. directionalShadowMap: {
  48299. type: "tv",
  48300. value: []
  48301. },
  48302. directionalShadowMatrix: {
  48303. type: "m4v",
  48304. value: []
  48305. },
  48306. spotLights: {
  48307. type: "sa",
  48308. value: [],
  48309. properties: {
  48310. color: {
  48311. type: "c"
  48312. },
  48313. position: {
  48314. type: "v3"
  48315. },
  48316. direction: {
  48317. type: "v3"
  48318. },
  48319. distance: {
  48320. type: "f"
  48321. },
  48322. coneCos: {
  48323. type: "f"
  48324. },
  48325. penumbraCos: {
  48326. type: "f"
  48327. },
  48328. decay: {
  48329. type: "f"
  48330. },
  48331. shadow: {
  48332. type: "i"
  48333. },
  48334. shadowBias: {
  48335. type: "f"
  48336. },
  48337. shadowRadius: {
  48338. type: "f"
  48339. },
  48340. shadowMapSize: {
  48341. type: "v2"
  48342. }
  48343. }
  48344. },
  48345. spotShadowMap: {
  48346. type: "tv",
  48347. value: []
  48348. },
  48349. spotShadowMatrix: {
  48350. type: "m4v",
  48351. value: []
  48352. },
  48353. pointLights: {
  48354. type: "sa",
  48355. value: [],
  48356. properties: {
  48357. color: {
  48358. type: "c"
  48359. },
  48360. position: {
  48361. type: "v3"
  48362. },
  48363. decay: {
  48364. type: "f"
  48365. },
  48366. distance: {
  48367. type: "f"
  48368. },
  48369. shadow: {
  48370. type: "i"
  48371. },
  48372. shadowBias: {
  48373. type: "f"
  48374. },
  48375. shadowRadius: {
  48376. type: "f"
  48377. },
  48378. shadowMapSize: {
  48379. type: "v2"
  48380. }
  48381. }
  48382. },
  48383. pointShadowMap: {
  48384. type: "tv",
  48385. value: []
  48386. },
  48387. pointShadowMatrix: {
  48388. type: "m4v",
  48389. value: []
  48390. },
  48391. hemisphereLights: {
  48392. type: "sa",
  48393. value: [],
  48394. properties: {
  48395. direction: {
  48396. type: "v3"
  48397. },
  48398. skyColor: {
  48399. type: "c"
  48400. },
  48401. groundColor: {
  48402. type: "c"
  48403. }
  48404. }
  48405. }
  48406. },
  48407. points: {
  48408. diffuse: {
  48409. type: "c",
  48410. value: new Ci.Color(15658734)
  48411. },
  48412. opacity: {
  48413. type: "f",
  48414. value: 1
  48415. },
  48416. size: {
  48417. type: "f",
  48418. value: 1
  48419. },
  48420. scale: {
  48421. type: "f",
  48422. value: 1
  48423. },
  48424. map: {
  48425. type: "t",
  48426. value: null
  48427. },
  48428. offsetRepeat: {
  48429. type: "v4",
  48430. value: new Ci.Vector4(0,0,1,1)
  48431. }
  48432. }
  48433. },
  48434. 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",
  48435. 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",
  48436. 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",
  48437. 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",
  48438. 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",
  48439. 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",
  48440. 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",
  48441. 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",
  48442. 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",
  48443. 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",
  48444. 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",
  48445. 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",
  48446. 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",
  48447. 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",
  48448. 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",
  48449. 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",
  48450. 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",
  48451. 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",
  48452. 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",
  48453. 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",
  48454. 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",
  48455. 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",
  48456. 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",
  48457. 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",
  48458. Ci.ShaderLib = {
  48459. basic: {
  48460. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48461. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48462. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48463. },
  48464. lambert: {
  48465. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48466. emissive: {
  48467. type: "c",
  48468. value: new Ci.Color(0)
  48469. }
  48470. }]),
  48471. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48472. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48473. },
  48474. phong: {
  48475. 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, {
  48476. emissive: {
  48477. type: "c",
  48478. value: new Ci.Color(0)
  48479. },
  48480. specular: {
  48481. type: "c",
  48482. value: new Ci.Color(1118481)
  48483. },
  48484. shininess: {
  48485. type: "f",
  48486. value: 30
  48487. }
  48488. }]),
  48489. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48490. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48491. },
  48492. standard: {
  48493. 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, {
  48494. emissive: {
  48495. type: "c",
  48496. value: new Ci.Color(0)
  48497. },
  48498. roughness: {
  48499. type: "f",
  48500. value: .5
  48501. },
  48502. metalness: {
  48503. type: "f",
  48504. value: 0
  48505. },
  48506. envMapIntensity: {
  48507. type: "f",
  48508. value: 1
  48509. }
  48510. }]),
  48511. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48512. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48513. },
  48514. points: {
  48515. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48516. vertexShader: Ci.ShaderChunk.points_vert,
  48517. fragmentShader: Ci.ShaderChunk.points_frag
  48518. },
  48519. dashed: {
  48520. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48521. scale: {
  48522. type: "f",
  48523. value: 1
  48524. },
  48525. dashSize: {
  48526. type: "f",
  48527. value: 1
  48528. },
  48529. totalSize: {
  48530. type: "f",
  48531. value: 2
  48532. }
  48533. }]),
  48534. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48535. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48536. },
  48537. depth: {
  48538. uniforms: {
  48539. mNear: {
  48540. type: "f",
  48541. value: 1
  48542. },
  48543. mFar: {
  48544. type: "f",
  48545. value: 2e3
  48546. },
  48547. opacity: {
  48548. type: "f",
  48549. value: 1
  48550. }
  48551. },
  48552. vertexShader: Ci.ShaderChunk.depth_vert,
  48553. fragmentShader: Ci.ShaderChunk.depth_frag
  48554. },
  48555. normal: {
  48556. uniforms: {
  48557. opacity: {
  48558. type: "f",
  48559. value: 1
  48560. }
  48561. },
  48562. vertexShader: Ci.ShaderChunk.normal_vert,
  48563. fragmentShader: Ci.ShaderChunk.normal_frag
  48564. },
  48565. cube: {
  48566. uniforms: {
  48567. tCube: {
  48568. type: "t",
  48569. value: null
  48570. },
  48571. tFlip: {
  48572. type: "f",
  48573. value: -1
  48574. }
  48575. },
  48576. vertexShader: Ci.ShaderChunk.cube_vert,
  48577. fragmentShader: Ci.ShaderChunk.cube_frag
  48578. },
  48579. equirect: {
  48580. uniforms: {
  48581. tEquirect: {
  48582. type: "t",
  48583. value: null
  48584. },
  48585. tFlip: {
  48586. type: "f",
  48587. value: -1
  48588. }
  48589. },
  48590. vertexShader: Ci.ShaderChunk.equirect_vert,
  48591. fragmentShader: Ci.ShaderChunk.equirect_frag
  48592. },
  48593. depthRGBA: {
  48594. uniforms: {},
  48595. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48596. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48597. },
  48598. distanceRGBA: {
  48599. uniforms: {
  48600. lightPos: {
  48601. type: "v3",
  48602. value: new Ci.Vector3(0,0,0)
  48603. }
  48604. },
  48605. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48606. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48607. }
  48608. },
  48609. Ci.WebGLRenderer = function(e) {
  48610. function S() {
  48611. return null === Q ? he : 1
  48612. }
  48613. function i(e, t, i, n) {
  48614. !0 === V && (e *= n,
  48615. t *= n,
  48616. i *= n),
  48617. _e.clearColor(e, t, i, n)
  48618. }
  48619. function t() {
  48620. _e.init(),
  48621. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48622. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48623. i(ae.r, ae.g, ae.b, se)
  48624. }
  48625. function n() {
  48626. te = K = null,
  48627. ee = "",
  48628. $ = -1,
  48629. _e.reset()
  48630. }
  48631. function r(e) {
  48632. e.preventDefault(),
  48633. n(),
  48634. t(),
  48635. be.clear()
  48636. }
  48637. function f(e) {
  48638. var t = e.target;
  48639. t.removeEventListener("dispose", f),
  48640. function(e) {
  48641. var t = be.get(e);
  48642. if (e.image && t.__image__webglTextureCube)
  48643. X.deleteTexture(t.__image__webglTextureCube);
  48644. else {
  48645. if (void 0 === t.__webglInit)
  48646. return;
  48647. X.deleteTexture(t.__webglTexture)
  48648. }
  48649. be.delete(e)
  48650. }(t),
  48651. ye.textures--
  48652. }
  48653. function a(e) {
  48654. var t = e.target;
  48655. t.removeEventListener("dispose", a),
  48656. function(e) {
  48657. var t = be.get(e)
  48658. , i = be.get(e.texture);
  48659. if (e && void 0 !== i.__webglTexture) {
  48660. if (X.deleteTexture(i.__webglTexture),
  48661. e instanceof Ci.WebGLRenderTargetCube)
  48662. for (var n = 0; n < 6; n++)
  48663. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48664. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48665. else
  48666. X.deleteFramebuffer(t.__webglFramebuffer),
  48667. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48668. be.delete(e.texture),
  48669. be.delete(e)
  48670. }
  48671. }(t),
  48672. ye.textures--
  48673. }
  48674. function v(e) {
  48675. var t = e.target;
  48676. t.removeEventListener("dispose", v),
  48677. function(e) {
  48678. y(e),
  48679. be.delete(e)
  48680. }(t)
  48681. }
  48682. function y(e) {
  48683. var t = be.get(e).program;
  48684. (e.program = void 0) !== t && Te.releaseProgram(t)
  48685. }
  48686. function M(e, t) {
  48687. return Math.abs(t[0]) - Math.abs(e[0])
  48688. }
  48689. function s(e, t) {
  48690. 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
  48691. }
  48692. function l(e, t) {
  48693. 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
  48694. }
  48695. function d(e, t, i, n, r) {
  48696. var o, a;
  48697. a = i.transparent ? (o = G,
  48698. ++W) : (o = H,
  48699. ++z);
  48700. var s = o[a];
  48701. void 0 !== s ? (s.id = e.id,
  48702. s.object = e,
  48703. s.geometry = t,
  48704. s.material = i,
  48705. s.z = me.z,
  48706. s.group = r) : (s = {
  48707. id: e.id,
  48708. object: e,
  48709. geometry: t,
  48710. material: i,
  48711. z: me.z,
  48712. group: r
  48713. },
  48714. o.push(s))
  48715. }
  48716. function c(e, t, i, n) {
  48717. for (var r = 0, o = e.length; r < o; r++) {
  48718. var a = e[r]
  48719. , s = a.object
  48720. , l = a.geometry
  48721. , c = void 0 === n ? a.material : n
  48722. , h = a.group;
  48723. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48724. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48725. s instanceof Ci.ImmediateRenderObject) {
  48726. R(c);
  48727. var u = P(t, i, c, s);
  48728. ee = "",
  48729. s.render(function(e) {
  48730. Z.renderBufferImmediate(e, u, c)
  48731. })
  48732. } else
  48733. Z.renderBufferDirect(t, i, l, c, s, h)
  48734. }
  48735. }
  48736. function R(e) {
  48737. (function(e) {
  48738. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48739. _e.setFlipSided(e.side === Ci.BackSide)
  48740. }
  48741. )(e),
  48742. !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),
  48743. _e.setDepthFunc(e.depthFunc),
  48744. _e.setDepthTest(e.depthTest),
  48745. _e.setDepthWrite(e.depthWrite),
  48746. _e.setColorWrite(e.colorWrite),
  48747. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48748. }
  48749. function P(e, t, i, n) {
  48750. oe = 0;
  48751. var r = be.get(i);
  48752. void 0 === r.program && (i.needsUpdate = !0),
  48753. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48754. i.needsUpdate && (function(e, t, i) {
  48755. var n = be.get(e)
  48756. , r = Te.getParameters(e, ve, t, i)
  48757. , o = Te.getProgramCode(e, r)
  48758. , a = n.program
  48759. , s = !0;
  48760. if (void 0 === a)
  48761. e.addEventListener("dispose", v);
  48762. else if (a.code !== o)
  48763. y(e);
  48764. else {
  48765. if (void 0 !== r.shaderID)
  48766. return;
  48767. s = !1
  48768. }
  48769. if (s) {
  48770. if (r.shaderID) {
  48771. var l = Ci.ShaderLib[r.shaderID];
  48772. n.__webglShader = {
  48773. name: e.type,
  48774. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48775. vertexShader: l.vertexShader,
  48776. fragmentShader: l.fragmentShader
  48777. }
  48778. } else
  48779. n.__webglShader = {
  48780. name: e.type,
  48781. uniforms: e.uniforms,
  48782. vertexShader: e.vertexShader,
  48783. fragmentShader: e.fragmentShader
  48784. };
  48785. e.__webglShader = n.__webglShader,
  48786. a = Te.acquireProgram(e, r, o),
  48787. n.program = a,
  48788. e.program = a
  48789. }
  48790. var c = a.getAttributes();
  48791. if (e.morphTargets)
  48792. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48793. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48794. if (e.morphNormals)
  48795. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48796. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48797. n.uniformsList = [];
  48798. var u = n.__webglShader.uniforms
  48799. , d = n.program.getUniforms();
  48800. for (var p in u) {
  48801. var f = d[p];
  48802. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48803. }
  48804. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48805. u.ambientLightColor.value = ve.ambient,
  48806. u.directionalLights.value = ve.directional,
  48807. u.spotLights.value = ve.spot,
  48808. u.pointLights.value = ve.point,
  48809. u.hemisphereLights.value = ve.hemi,
  48810. u.directionalShadowMap.value = ve.directionalShadowMap,
  48811. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48812. u.spotShadowMap.value = ve.spotShadowMap,
  48813. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48814. u.pointShadowMap.value = ve.pointShadowMap,
  48815. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48816. n.hasDynamicUniforms = !1;
  48817. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48818. if (!0 === n.uniformsList[g][0].dynamic) {
  48819. n.hasDynamicUniforms = !0;
  48820. break
  48821. }
  48822. }
  48823. }(i, t, n),
  48824. i.needsUpdate = !1);
  48825. var o = !1
  48826. , a = !1
  48827. , s = !1
  48828. , l = r.program
  48829. , c = l.getUniforms()
  48830. , h = r.__webglShader.uniforms;
  48831. if (l.id !== K && (X.useProgram(l.program),
  48832. K = l.id,
  48833. s = a = o = !0),
  48834. i.id !== $ && ($ = i.id,
  48835. a = !0),
  48836. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48837. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48838. e !== te && (te = e,
  48839. s = a = !0),
  48840. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48841. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48842. (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),
  48843. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48844. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48845. i.skinning)
  48846. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48847. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48848. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48849. if (void 0 !== c.boneTexture) {
  48850. var u = A();
  48851. X.uniform1i(c.boneTexture, u),
  48852. Z.setTexture(n.skeleton.boneTexture, u)
  48853. }
  48854. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48855. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48856. } else
  48857. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48858. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48859. e.ambientLightColor.needsUpdate = t,
  48860. e.directionalLights.needsUpdate = t,
  48861. e.pointLights.needsUpdate = t,
  48862. e.spotLights.needsUpdate = t,
  48863. e.hemisphereLights.needsUpdate = t
  48864. }(h, s),
  48865. t && i.fog && function(e, t) {
  48866. e.fogColor.value = t.color,
  48867. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48868. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48869. }(h, t),
  48870. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48871. var i;
  48872. if (e.opacity.value = t.opacity,
  48873. e.diffuse.value = t.color,
  48874. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48875. e.map.value = t.map,
  48876. e.specularMap.value = t.specularMap,
  48877. e.alphaMap.value = t.alphaMap,
  48878. t.aoMap && (e.aoMap.value = t.aoMap,
  48879. e.aoMapIntensity.value = t.aoMapIntensity),
  48880. 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),
  48881. void 0 !== i) {
  48882. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48883. var n = i.offset
  48884. , r = i.repeat;
  48885. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48886. }
  48887. e.envMap.value = t.envMap,
  48888. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48889. e.reflectivity.value = t.reflectivity,
  48890. e.refractionRatio.value = t.refractionRatio
  48891. }(h, i),
  48892. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48893. function(e, t) {
  48894. e.dashSize.value = t.dashSize,
  48895. e.totalSize.value = t.dashSize + t.gapSize,
  48896. e.scale.value = t.scale
  48897. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48898. if (e.diffuse.value = t.color,
  48899. e.opacity.value = t.opacity,
  48900. e.size.value = t.size * he,
  48901. e.scale.value = O.clientHeight / 2,
  48902. e.map.value = t.map,
  48903. null !== t.map) {
  48904. var i = t.map.offset
  48905. , n = t.map.repeat;
  48906. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48907. }
  48908. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48909. t.lightMap && (e.lightMap.value = t.lightMap,
  48910. e.lightMapIntensity.value = t.lightMapIntensity),
  48911. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48912. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48913. e.specular.value = t.specular,
  48914. e.shininess.value = Math.max(t.shininess, 1e-4),
  48915. t.lightMap && (e.lightMap.value = t.lightMap,
  48916. e.lightMapIntensity.value = t.lightMapIntensity),
  48917. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48918. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48919. e.bumpScale.value = t.bumpScale),
  48920. t.normalMap && (e.normalMap.value = t.normalMap,
  48921. e.normalScale.value.copy(t.normalScale)),
  48922. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48923. e.displacementScale.value = t.displacementScale,
  48924. e.displacementBias.value = t.displacementBias)
  48925. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48926. e.roughness.value = t.roughness,
  48927. e.metalness.value = t.metalness,
  48928. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48929. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48930. t.lightMap && (e.lightMap.value = t.lightMap,
  48931. e.lightMapIntensity.value = t.lightMapIntensity),
  48932. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48933. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48934. e.bumpScale.value = t.bumpScale),
  48935. t.normalMap && (e.normalMap.value = t.normalMap,
  48936. e.normalScale.value.copy(t.normalScale)),
  48937. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48938. e.displacementScale.value = t.displacementScale,
  48939. e.displacementBias.value = t.displacementBias),
  48940. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48941. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48942. h.mFar.value = e.far,
  48943. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48944. g(r.uniformsList)),
  48945. function(e, t) {
  48946. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48947. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48948. }(c, n),
  48949. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48950. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48951. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48952. var a = e[r][0]
  48953. , s = a.onUpdateCallback;
  48954. void 0 !== s && (s.bind(a)(t, i),
  48955. n.push(e[r]))
  48956. }
  48957. g(n)
  48958. }(r.uniformsList, n, e),
  48959. l
  48960. }
  48961. function p(e, t) {
  48962. e.diffuse.value = t.color,
  48963. e.opacity.value = t.opacity
  48964. }
  48965. function A() {
  48966. var e = oe;
  48967. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48968. oe += 1,
  48969. e
  48970. }
  48971. function C(e, t, i, n) {
  48972. var r, o;
  48973. if ("1i" === t)
  48974. X.uniform1i(i, n);
  48975. else if ("1f" === t)
  48976. X.uniform1f(i, n);
  48977. else if ("2f" === t)
  48978. X.uniform2f(i, n[0], n[1]);
  48979. else if ("3f" === t)
  48980. X.uniform3f(i, n[0], n[1], n[2]);
  48981. else if ("4f" === t)
  48982. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48983. else if ("1iv" === t)
  48984. X.uniform1iv(i, n);
  48985. else if ("3iv" === t)
  48986. X.uniform3iv(i, n);
  48987. else if ("1fv" === t)
  48988. X.uniform1fv(i, n);
  48989. else if ("2fv" === t)
  48990. X.uniform2fv(i, n);
  48991. else if ("3fv" === t)
  48992. X.uniform3fv(i, n);
  48993. else if ("4fv" === t)
  48994. X.uniform4fv(i, n);
  48995. else if ("Matrix2fv" === t)
  48996. X.uniformMatrix2fv(i, !1, n);
  48997. else if ("Matrix3fv" === t)
  48998. X.uniformMatrix3fv(i, !1, n);
  48999. else if ("Matrix4fv" === t)
  49000. X.uniformMatrix4fv(i, !1, n);
  49001. else if ("i" === t)
  49002. X.uniform1i(i, n);
  49003. else if ("f" === t)
  49004. X.uniform1f(i, n);
  49005. else if ("v2" === t)
  49006. X.uniform2f(i, n.x, n.y);
  49007. else if ("v3" === t)
  49008. X.uniform3f(i, n.x, n.y, n.z);
  49009. else if ("v4" === t)
  49010. X.uniform4f(i, n.x, n.y, n.z, n.w);
  49011. else if ("c" === t)
  49012. X.uniform3f(i, n.r, n.g, n.b);
  49013. else if ("s" === t) {
  49014. var a = e.properties;
  49015. for (var s in a) {
  49016. var l = a[s]
  49017. , c = i[s]
  49018. , h = n[s];
  49019. C(l, l.type, c, h)
  49020. }
  49021. } else if ("sa" === t) {
  49022. a = e.properties;
  49023. for (var u = 0, d = n.length; u < d; u++)
  49024. for (var s in a) {
  49025. l = a[s],
  49026. c = i[u][s],
  49027. h = n[u][s];
  49028. C(l, l.type, c, h)
  49029. }
  49030. } else if ("iv1" === t)
  49031. X.uniform1iv(i, n);
  49032. else if ("iv" === t)
  49033. X.uniform3iv(i, n);
  49034. else if ("fv1" === t)
  49035. X.uniform1fv(i, n);
  49036. else if ("fv" === t)
  49037. X.uniform3fv(i, n);
  49038. else if ("v2v" === t) {
  49039. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  49040. u = 0;
  49041. for (var p = 0, f = n.length; u < f; u++,
  49042. p += 2)
  49043. e._array[p + 0] = n[u].x,
  49044. e._array[p + 1] = n[u].y;
  49045. X.uniform2fv(i, e._array)
  49046. } else if ("v3v" === t) {
  49047. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  49048. u = 0;
  49049. var g = 0;
  49050. for (f = n.length; u < f; u++,
  49051. g += 3)
  49052. e._array[g + 0] = n[u].x,
  49053. e._array[g + 1] = n[u].y,
  49054. e._array[g + 2] = n[u].z;
  49055. X.uniform3fv(i, e._array)
  49056. } else if ("v4v" === t) {
  49057. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  49058. u = 0;
  49059. var m = 0;
  49060. for (f = n.length; u < f; u++,
  49061. m += 4)
  49062. e._array[m + 0] = n[u].x,
  49063. e._array[m + 1] = n[u].y,
  49064. e._array[m + 2] = n[u].z,
  49065. e._array[m + 3] = n[u].w;
  49066. X.uniform4fv(i, e._array)
  49067. } else if ("m2" === t)
  49068. X.uniformMatrix2fv(i, !1, n.elements);
  49069. else if ("m3" === t)
  49070. X.uniformMatrix3fv(i, !1, n.elements);
  49071. else if ("m3v" === t) {
  49072. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  49073. for (u = 0,
  49074. f = n.length; u < f; u++)
  49075. n[u].flattenToArrayOffset(e._array, 9 * u);
  49076. X.uniformMatrix3fv(i, !1, e._array)
  49077. } else if ("m4" === t)
  49078. X.uniformMatrix4fv(i, !1, n.elements);
  49079. else if ("m4v" === t) {
  49080. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  49081. for (u = 0,
  49082. f = n.length; u < f; u++)
  49083. n[u].flattenToArrayOffset(e._array, 16 * u);
  49084. X.uniformMatrix4fv(i, !1, e._array)
  49085. } else if ("t" === t) {
  49086. if (r = n,
  49087. o = A(),
  49088. X.uniform1i(i, o),
  49089. !r)
  49090. return;
  49091. 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)
  49092. } else if ("tv" === t) {
  49093. void 0 === e._array && (e._array = []);
  49094. for (u = 0,
  49095. f = e.value.length; u < f; u++)
  49096. e._array[u] = A();
  49097. X.uniform1iv(i, e._array);
  49098. for (u = 0,
  49099. f = e.value.length; u < f; u++)
  49100. r = e.value[u],
  49101. o = e._array[u],
  49102. 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))
  49103. } else
  49104. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49105. }
  49106. function g(e) {
  49107. for (var t = 0, i = e.length; t < i; t++) {
  49108. var n = e[t][0];
  49109. if (!1 !== n.needsUpdate)
  49110. C(n, n.type, e[t][1], n.value)
  49111. }
  49112. }
  49113. function m(e, t, i) {
  49114. var n;
  49115. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  49116. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  49117. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  49118. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  49119. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  49120. 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),
  49121. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  49122. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  49123. 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)),
  49124. n = Ie.get("EXT_texture_filter_anisotropic")) {
  49125. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  49126. return;
  49127. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  49128. return;
  49129. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  49130. be.get(t).__currentAnisotropy = t.anisotropy)
  49131. }
  49132. }
  49133. function o(e, t, i) {
  49134. void 0 === e.__webglInit && (e.__webglInit = !0,
  49135. t.addEventListener("dispose", f),
  49136. e.__webglTexture = X.createTexture(),
  49137. ye.textures++),
  49138. _e.activeTexture(X.TEXTURE0 + i),
  49139. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  49140. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49141. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49142. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  49143. var n = I(t.image, Ee.maxTextureSize);
  49144. !function(e) {
  49145. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  49146. }(t) || !1 !== E(n) || (n = function(e) {
  49147. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49148. var t = document.createElement("canvas");
  49149. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  49150. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  49151. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  49152. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49153. t
  49154. }
  49155. return e
  49156. }(n));
  49157. var r = E(n)
  49158. , o = x(t.format)
  49159. , a = x(t.type);
  49160. m(X.TEXTURE_2D, t, r);
  49161. var s, l = t.mipmaps;
  49162. if (t instanceof Ci.DataTexture)
  49163. if (0 < l.length && r) {
  49164. for (var c = 0, h = l.length; c < h; c++)
  49165. s = l[c],
  49166. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49167. t.generateMipmaps = !1
  49168. } else
  49169. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  49170. else if (t instanceof Ci.CompressedTexture)
  49171. for (c = 0,
  49172. h = l.length; c < h; c++)
  49173. s = l[c],
  49174. 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);
  49175. else if (0 < l.length && r) {
  49176. for (c = 0,
  49177. h = l.length; c < h; c++)
  49178. s = l[c],
  49179. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  49180. t.generateMipmaps = !1
  49181. } else
  49182. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  49183. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49184. e.__version = t.version,
  49185. t.onUpdate && t.onUpdate(t)
  49186. }
  49187. function I(e, t) {
  49188. if (e.width > t || e.height > t) {
  49189. var i = t / Math.max(e.width, e.height)
  49190. , n = document.createElement("canvas");
  49191. return n.width = Math.floor(e.width * i),
  49192. n.height = Math.floor(e.height * i),
  49193. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49194. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49195. n
  49196. }
  49197. return e
  49198. }
  49199. function E(e) {
  49200. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  49201. }
  49202. function _(e, t) {
  49203. var i = be.get(e);
  49204. if (6 === e.image.length)
  49205. if (0 < e.version && i.__version !== e.version) {
  49206. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  49207. i.__image__webglTextureCube = X.createTexture(),
  49208. ye.textures++),
  49209. _e.activeTexture(X.TEXTURE0 + t),
  49210. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49211. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49212. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49213. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49214. var s = E(o[0])
  49215. , l = x(e.format)
  49216. , c = x(e.type);
  49217. m(X.TEXTURE_CUBE_MAP, e, s);
  49218. for (a = 0; a < 6; a++)
  49219. if (n)
  49220. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49221. h = u[d],
  49222. 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);
  49223. else
  49224. 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]);
  49225. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49226. i.__version = e.version,
  49227. e.onUpdate && e.onUpdate(e)
  49228. } else
  49229. _e.activeTexture(X.TEXTURE0 + t),
  49230. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49231. }
  49232. function b(e, t) {
  49233. _e.activeTexture(X.TEXTURE0 + t),
  49234. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49235. }
  49236. function h(e, t, i, n) {
  49237. var r = x(t.texture.format)
  49238. , o = x(t.texture.type);
  49239. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49240. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49241. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49242. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49243. }
  49244. function u(e, t) {
  49245. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49246. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49247. 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),
  49248. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49249. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49250. }
  49251. function w(e) {
  49252. var t = be.get(e)
  49253. , i = be.get(e.texture);
  49254. e.addEventListener("dispose", a),
  49255. i.__webglTexture = X.createTexture(),
  49256. ye.textures++;
  49257. var n = e instanceof Ci.WebGLRenderTargetCube
  49258. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49259. if (n) {
  49260. t.__webglFramebuffer = [];
  49261. for (var o = 0; o < 6; o++)
  49262. t.__webglFramebuffer[o] = X.createFramebuffer()
  49263. } else
  49264. t.__webglFramebuffer = X.createFramebuffer();
  49265. if (n) {
  49266. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49267. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49268. for (o = 0; o < 6; o++)
  49269. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49270. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49271. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49272. } else
  49273. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49274. m(X.TEXTURE_2D, e.texture, r),
  49275. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49276. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49277. _e.bindTexture(X.TEXTURE_2D, null);
  49278. e.depthBuffer && function(e) {
  49279. var t = be.get(e);
  49280. if (e instanceof Ci.WebGLRenderTargetCube) {
  49281. t.__webglDepthbuffer = [];
  49282. for (var i = 0; i < 6; i++)
  49283. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49284. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49285. u(t.__webglDepthbuffer[i], e)
  49286. } else
  49287. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49288. t.__webglDepthbuffer = X.createRenderbuffer(),
  49289. u(t.__webglDepthbuffer, e);
  49290. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49291. }(e)
  49292. }
  49293. function T(e) {
  49294. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49295. }
  49296. function x(e) {
  49297. var t;
  49298. if (e === Ci.RepeatWrapping)
  49299. return X.REPEAT;
  49300. if (e === Ci.ClampToEdgeWrapping)
  49301. return X.CLAMP_TO_EDGE;
  49302. if (e === Ci.MirroredRepeatWrapping)
  49303. return X.MIRRORED_REPEAT;
  49304. if (e === Ci.NearestFilter)
  49305. return X.NEAREST;
  49306. if (e === Ci.NearestMipMapNearestFilter)
  49307. return X.NEAREST_MIPMAP_NEAREST;
  49308. if (e === Ci.NearestMipMapLinearFilter)
  49309. return X.NEAREST_MIPMAP_LINEAR;
  49310. if (e === Ci.LinearFilter)
  49311. return X.LINEAR;
  49312. if (e === Ci.LinearMipMapNearestFilter)
  49313. return X.LINEAR_MIPMAP_NEAREST;
  49314. if (e === Ci.LinearMipMapLinearFilter)
  49315. return X.LINEAR_MIPMAP_LINEAR;
  49316. if (e === Ci.UnsignedByteType)
  49317. return X.UNSIGNED_BYTE;
  49318. if (e === Ci.UnsignedShort4444Type)
  49319. return X.UNSIGNED_SHORT_4_4_4_4;
  49320. if (e === Ci.UnsignedShort5551Type)
  49321. return X.UNSIGNED_SHORT_5_5_5_1;
  49322. if (e === Ci.UnsignedShort565Type)
  49323. return X.UNSIGNED_SHORT_5_6_5;
  49324. if (e === Ci.ByteType)
  49325. return X.BYTE;
  49326. if (e === Ci.ShortType)
  49327. return X.SHORT;
  49328. if (e === Ci.UnsignedShortType)
  49329. return X.UNSIGNED_SHORT;
  49330. if (e === Ci.IntType)
  49331. return X.INT;
  49332. if (e === Ci.UnsignedIntType)
  49333. return X.UNSIGNED_INT;
  49334. if (e === Ci.FloatType)
  49335. return X.FLOAT;
  49336. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49337. return t.HALF_FLOAT_OES;
  49338. if (e === Ci.AlphaFormat)
  49339. return X.ALPHA;
  49340. if (e === Ci.RGBFormat)
  49341. return X.RGB;
  49342. if (e === Ci.RGBAFormat)
  49343. return X.RGBA;
  49344. if (e === Ci.LuminanceFormat)
  49345. return X.LUMINANCE;
  49346. if (e === Ci.LuminanceAlphaFormat)
  49347. return X.LUMINANCE_ALPHA;
  49348. if (e === Ci.AddEquation)
  49349. return X.FUNC_ADD;
  49350. if (e === Ci.SubtractEquation)
  49351. return X.FUNC_SUBTRACT;
  49352. if (e === Ci.ReverseSubtractEquation)
  49353. return X.FUNC_REVERSE_SUBTRACT;
  49354. if (e === Ci.ZeroFactor)
  49355. return X.ZERO;
  49356. if (e === Ci.OneFactor)
  49357. return X.ONE;
  49358. if (e === Ci.SrcColorFactor)
  49359. return X.SRC_COLOR;
  49360. if (e === Ci.OneMinusSrcColorFactor)
  49361. return X.ONE_MINUS_SRC_COLOR;
  49362. if (e === Ci.SrcAlphaFactor)
  49363. return X.SRC_ALPHA;
  49364. if (e === Ci.OneMinusSrcAlphaFactor)
  49365. return X.ONE_MINUS_SRC_ALPHA;
  49366. if (e === Ci.DstAlphaFactor)
  49367. return X.DST_ALPHA;
  49368. if (e === Ci.OneMinusDstAlphaFactor)
  49369. return X.ONE_MINUS_DST_ALPHA;
  49370. if (e === Ci.DstColorFactor)
  49371. return X.DST_COLOR;
  49372. if (e === Ci.OneMinusDstColorFactor)
  49373. return X.ONE_MINUS_DST_COLOR;
  49374. if (e === Ci.SrcAlphaSaturateFactor)
  49375. return X.SRC_ALPHA_SATURATE;
  49376. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49377. if (e === Ci.RGB_S3TC_DXT1_Format)
  49378. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49379. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49380. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49381. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49382. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49383. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49384. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49385. }
  49386. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49387. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49388. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49389. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49390. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49391. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49392. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49393. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49394. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49395. }
  49396. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49397. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49398. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49399. if (e === Ci.MinEquation)
  49400. return t.MIN_EXT;
  49401. if (e === Ci.MaxEquation)
  49402. return t.MAX_EXT
  49403. }
  49404. return 0
  49405. }
  49406. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49407. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49408. , L = void 0 !== e.context ? e.context : null
  49409. , D = void 0 !== e.alpha && e.alpha
  49410. , N = void 0 === e.depth || e.depth
  49411. , F = void 0 === e.stencil || e.stencil
  49412. , B = void 0 !== e.antialias && e.antialias
  49413. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49414. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49415. , U = []
  49416. , H = []
  49417. , z = -1
  49418. , G = []
  49419. , W = -1
  49420. , j = new Float32Array(8)
  49421. , Y = []
  49422. , q = [];
  49423. this.domElement = O,
  49424. this.context = null,
  49425. this.autoClear = !0,
  49426. this.autoClearColor = !0,
  49427. this.autoClearDepth = !0,
  49428. this.autoClearStencil = !0,
  49429. this.sortObjects = !0,
  49430. this.gammaFactor = 2,
  49431. this.gammaInput = !1,
  49432. this.gammaOutput = !1,
  49433. this.physicallyCorrectLights = !1,
  49434. this.toneMapping = Ci.LinearToneMapping,
  49435. this.toneMappingExposure = 1,
  49436. this.toneMappingWhitePoint = 1,
  49437. this.maxMorphTargets = 8,
  49438. this.maxMorphNormals = 4,
  49439. this.autoScaleCubemaps = !0;
  49440. 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 = {
  49441. hash: "",
  49442. ambient: [0, 0, 0],
  49443. directional: [],
  49444. directionalShadowMap: [],
  49445. directionalShadowMatrix: [],
  49446. spot: [],
  49447. spotShadowMap: [],
  49448. spotShadowMatrix: [],
  49449. point: [],
  49450. pointShadowMap: [],
  49451. pointShadowMatrix: [],
  49452. hemi: [],
  49453. shadows: [],
  49454. shadowsPointLight: 0
  49455. }, ye = {
  49456. geometries: 0,
  49457. textures: 0
  49458. }, Ae = {
  49459. calls: 0,
  49460. vertices: 0,
  49461. faces: 0,
  49462. points: 0
  49463. };
  49464. this.info = {
  49465. render: Ae,
  49466. memory: ye,
  49467. programs: null
  49468. };
  49469. try {
  49470. var Ce = {
  49471. alpha: D,
  49472. depth: N,
  49473. stencil: F,
  49474. antialias: B,
  49475. premultipliedAlpha: V,
  49476. preserveDrawingBuffer: k
  49477. };
  49478. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49479. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49480. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49481. return {
  49482. rangeMin: 1,
  49483. rangeMax: 1,
  49484. precision: 1
  49485. }
  49486. }
  49487. ),
  49488. O.addEventListener("webglcontextlost", r, !1)
  49489. } catch (e) {
  49490. console.error("THREE.WebGLRenderer: " + e)
  49491. }
  49492. var Ie = new Ci.WebGLExtensions(X);
  49493. Ie.get("OES_texture_float"),
  49494. Ie.get("OES_texture_float_linear"),
  49495. Ie.get("OES_texture_half_float"),
  49496. Ie.get("OES_texture_half_float_linear"),
  49497. Ie.get("OES_standard_derivatives"),
  49498. Ie.get("ANGLE_instanced_arrays"),
  49499. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49500. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49501. , _e = new Ci.WebGLState(X,Ie,x)
  49502. , be = new Ci.WebGLProperties
  49503. , we = new Ci.WebGLObjects(X,be,this.info)
  49504. , Te = new Ci.WebGLPrograms(this,Ee)
  49505. , xe = new Ci.WebGLLights;
  49506. this.info.programs = Te.programs;
  49507. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49508. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49509. t(),
  49510. this.context = X,
  49511. this.capabilities = Ee,
  49512. this.extensions = Ie,
  49513. this.properties = be,
  49514. this.state = _e;
  49515. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49516. this.shadowMap = Re;
  49517. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49518. this.getContext = function() {
  49519. return X
  49520. }
  49521. ,
  49522. this.getContextAttributes = function() {
  49523. return X.getContextAttributes()
  49524. }
  49525. ,
  49526. this.forceContextLoss = function() {
  49527. Ie.get("WEBGL_lose_context").loseContext()
  49528. }
  49529. ,
  49530. this.getMaxAnisotropy = function() {
  49531. if (void 0 !== Pe)
  49532. return Pe;
  49533. var e = Ie.get("EXT_texture_filter_anisotropic");
  49534. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49535. }
  49536. ,
  49537. this.getPrecision = function() {
  49538. return Ee.precision
  49539. }
  49540. ,
  49541. this.getPixelRatio = function() {
  49542. return he
  49543. }
  49544. ,
  49545. this.setPixelRatio = function(e) {
  49546. void 0 !== e && (he = e,
  49547. this.setSize(pe.z, pe.w, !1))
  49548. }
  49549. ,
  49550. this.getSize = function() {
  49551. return {
  49552. width: le,
  49553. height: ce
  49554. }
  49555. }
  49556. ,
  49557. this.setSize = function(e, t, i, n) {
  49558. null != n && (he = n),
  49559. le = e,
  49560. ce = t,
  49561. O.width = e * he,
  49562. O.height = t * he,
  49563. !1 !== i && (O.style.width = e + "px",
  49564. O.style.height = t + "px"),
  49565. this.setViewport(0, 0, e, t)
  49566. }
  49567. ,
  49568. this.setViewport = function(e, t, i, n) {
  49569. _e.viewport(pe.set(e, t, i, n))
  49570. }
  49571. ,
  49572. this.setScissor = function(e, t, i, n) {
  49573. _e.scissor(ue.set(e, t, i, n))
  49574. }
  49575. ,
  49576. this.setScissorTest = function(e) {
  49577. _e.setScissorTest(de = e)
  49578. }
  49579. ,
  49580. this.getClearColor = function() {
  49581. return ae
  49582. }
  49583. ,
  49584. this.setClearColor = function(e, t) {
  49585. ae.set(e),
  49586. se = void 0 !== t ? t : 1,
  49587. i(ae.r, ae.g, ae.b, se)
  49588. }
  49589. ,
  49590. this.getClearAlpha = function() {
  49591. return se
  49592. }
  49593. ,
  49594. this.setClearAlpha = function(e) {
  49595. se = e,
  49596. i(ae.r, ae.g, ae.b, se)
  49597. }
  49598. ,
  49599. this.clear = function(e, t, i) {
  49600. var n = 0;
  49601. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49602. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49603. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49604. X.clear(n)
  49605. }
  49606. ,
  49607. this.clearColor = function() {
  49608. this.clear(!0, !1, !1)
  49609. }
  49610. ,
  49611. this.clearDepth = function() {
  49612. this.clear(!1, !0, !1)
  49613. }
  49614. ,
  49615. this.clearStencil = function() {
  49616. this.clear(!1, !1, !0)
  49617. }
  49618. ,
  49619. this.clearTarget = function(e, t, i, n) {
  49620. this.setRenderTarget(e),
  49621. this.clear(t, i, n)
  49622. }
  49623. ,
  49624. this.resetGLState = n,
  49625. this.dispose = function() {
  49626. O.removeEventListener("webglcontextlost", r, !1)
  49627. }
  49628. ,
  49629. this.renderBufferImmediate = function(e, t, i) {
  49630. _e.initAttributes();
  49631. var n = be.get(e);
  49632. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49633. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49634. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49635. e.hasColors && !n.color && (n.color = X.createBuffer());
  49636. var r = t.getAttributes();
  49637. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49638. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49639. _e.enableAttribute(r.position),
  49640. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49641. e.hasNormals) {
  49642. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49643. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49644. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49645. var s = e.normalArray
  49646. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49647. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49648. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49649. s[o + 0] = l,
  49650. s[o + 1] = c,
  49651. s[o + 2] = h,
  49652. s[o + 3] = l,
  49653. s[o + 4] = c,
  49654. s[o + 5] = h,
  49655. s[o + 6] = l,
  49656. s[o + 7] = c,
  49657. s[o + 8] = h
  49658. }
  49659. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49660. _e.enableAttribute(r.normal),
  49661. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49662. }
  49663. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49664. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49665. _e.enableAttribute(r.uv),
  49666. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49667. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49668. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49669. _e.enableAttribute(r.color),
  49670. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49671. _e.disableUnusedAttributes(),
  49672. X.drawArrays(X.TRIANGLES, 0, e.count),
  49673. e.count = 0
  49674. }
  49675. ,
  49676. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49677. R(n);
  49678. var a = P(e, t, n, r)
  49679. , s = !1
  49680. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49681. l !== ee && (ee = l,
  49682. s = !0);
  49683. var c = r.morphTargetInfluences;
  49684. if (void 0 !== c) {
  49685. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49686. var p = c[u];
  49687. h.push([p, u])
  49688. }
  49689. h.sort(M),
  49690. 8 < h.length && (h.length = 8);
  49691. var f = i.morphAttributes;
  49692. for (u = 0,
  49693. d = h.length; u < d; u++) {
  49694. p = h[u];
  49695. if (j[u] = p[0],
  49696. 0 !== p[0]) {
  49697. var g = p[1];
  49698. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49699. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49700. } else
  49701. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49702. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49703. }
  49704. var m = a.getUniforms();
  49705. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49706. s = !0
  49707. }
  49708. g = i.index;
  49709. var v, y = i.attributes.position;
  49710. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49711. null !== g ? (v = Me).setIndex(g) : v = Se,
  49712. s && (function(e, t, i, n) {
  49713. var r;
  49714. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49715. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49716. else {
  49717. void 0 === n && (n = 0),
  49718. _e.initAttributes();
  49719. var o = i.attributes
  49720. , a = t.getAttributes()
  49721. , s = e.defaultAttributeValues;
  49722. for (var l in a) {
  49723. var c = a[l];
  49724. if (0 <= c) {
  49725. var h = o[l];
  49726. if (void 0 !== h) {
  49727. var u = h.itemSize
  49728. , d = we.getAttributeBuffer(h);
  49729. if (h instanceof Ci.InterleavedBufferAttribute) {
  49730. var p = h.data
  49731. , f = p.stride
  49732. , g = h.offset;
  49733. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49734. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49735. X.bindBuffer(X.ARRAY_BUFFER, d),
  49736. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49737. } else
  49738. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49739. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49740. X.bindBuffer(X.ARRAY_BUFFER, d),
  49741. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49742. } else if (void 0 !== s) {
  49743. var m = s[l];
  49744. if (void 0 !== m)
  49745. switch (m.length) {
  49746. case 2:
  49747. X.vertexAttrib2fv(c, m);
  49748. break;
  49749. case 3:
  49750. X.vertexAttrib3fv(c, m);
  49751. break;
  49752. case 4:
  49753. X.vertexAttrib4fv(c, m);
  49754. break;
  49755. default:
  49756. X.vertexAttrib1fv(c, m)
  49757. }
  49758. }
  49759. }
  49760. }
  49761. _e.disableUnusedAttributes()
  49762. }
  49763. }(n, a, i),
  49764. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49765. var A = 1 / 0;
  49766. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49767. var C = i.drawRange.start
  49768. , I = i.drawRange.count
  49769. , E = null !== o ? o.start : 0
  49770. , _ = null !== o ? o.count : 1 / 0
  49771. , b = Math.max(0, C, E)
  49772. , w = Math.min(0 + A, C + I, E + _) - 1
  49773. , T = Math.max(0, w - b + 1);
  49774. if (r instanceof Ci.Mesh)
  49775. if (!0 === n.wireframe)
  49776. _e.setLineWidth(n.wireframeLinewidth * S()),
  49777. v.setMode(X.LINES);
  49778. else
  49779. switch (r.drawMode) {
  49780. case Ci.TrianglesDrawMode:
  49781. v.setMode(X.TRIANGLES);
  49782. break;
  49783. case Ci.TriangleStripDrawMode:
  49784. v.setMode(X.TRIANGLE_STRIP);
  49785. break;
  49786. case Ci.TriangleFanDrawMode:
  49787. v.setMode(X.TRIANGLE_FAN)
  49788. }
  49789. else if (r instanceof Ci.Line) {
  49790. var x = n.linewidth;
  49791. void 0 === x && (x = 1),
  49792. _e.setLineWidth(x * S()),
  49793. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49794. } else
  49795. r instanceof Ci.Points && v.setMode(X.POINTS);
  49796. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49797. }
  49798. ,
  49799. this.render = function(e, t, i, n) {
  49800. if (t instanceof Ci.Camera != 0) {
  49801. var r = e.fog;
  49802. if (ee = "",
  49803. $ = -1,
  49804. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49805. null === t.parent && t.updateMatrixWorld(),
  49806. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49807. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49808. fe.setFromMatrix(ge),
  49809. U.length = 0,
  49810. W = z = -1,
  49811. Y.length = 0,
  49812. q.length = 0,
  49813. function e(t, i) {
  49814. if (!1 !== t.visible) {
  49815. if (t.layers.test(i.layers))
  49816. if (t instanceof Ci.Light)
  49817. U.push(t);
  49818. else if (t instanceof Ci.Sprite)
  49819. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49820. else if (t instanceof Ci.LensFlare)
  49821. q.push(t);
  49822. else if (t instanceof Ci.ImmediateRenderObject)
  49823. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49824. me.applyProjection(ge)),
  49825. d(t, null, t.material, me.z, null);
  49826. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49827. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49828. var n = t.material;
  49829. if (!0 === n.visible) {
  49830. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49831. me.applyProjection(ge));
  49832. var r = we.update(t);
  49833. if (n instanceof Ci.MultiMaterial)
  49834. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49835. var c = o[s]
  49836. , h = a[c.materialIndex];
  49837. !0 === h.visible && d(t, r, h, me.z, c)
  49838. }
  49839. else
  49840. d(t, r, n, me.z, null)
  49841. }
  49842. }
  49843. var u = t.children;
  49844. for (s = 0,
  49845. l = u.length; s < l; s++)
  49846. e(u[s], i)
  49847. }
  49848. }(e, t),
  49849. H.length = z + 1,
  49850. G.length = W + 1,
  49851. !0 === Z.sortObjects && (H.sort(s),
  49852. G.sort(l)),
  49853. function(e, t) {
  49854. 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;
  49855. for (i = ve.shadowsPointLight = 0,
  49856. n = e.length; i < n; i++)
  49857. if (o = (r = e[i]).color,
  49858. a = r.intensity,
  49859. s = r.distance,
  49860. r instanceof Ci.AmbientLight)
  49861. l += o.r * a,
  49862. c += o.g * a,
  49863. h += o.b * a;
  49864. else if (r instanceof Ci.DirectionalLight) {
  49865. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49866. v.direction.setFromMatrixPosition(r.matrixWorld),
  49867. me.setFromMatrixPosition(r.target.matrixWorld),
  49868. v.direction.sub(me),
  49869. v.direction.transformDirection(u),
  49870. v.shadow = r.castShadow,
  49871. r.castShadow && (v.shadowBias = r.shadow.bias,
  49872. v.shadowRadius = r.shadow.radius,
  49873. v.shadowMapSize = r.shadow.mapSize,
  49874. ve.shadows[m++] = r),
  49875. ve.directionalShadowMap[d] = r.shadow.map,
  49876. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49877. ve.directional[d++] = v
  49878. } else if (r instanceof Ci.SpotLight) {
  49879. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49880. v.position.applyMatrix4(u),
  49881. v.color.copy(o).multiplyScalar(a),
  49882. v.distance = s,
  49883. v.direction.setFromMatrixPosition(r.matrixWorld),
  49884. me.setFromMatrixPosition(r.target.matrixWorld),
  49885. v.direction.sub(me),
  49886. v.direction.transformDirection(u),
  49887. v.coneCos = Math.cos(r.angle),
  49888. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49889. v.decay = 0 === r.distance ? 0 : r.decay,
  49890. v.shadow = r.castShadow,
  49891. r.castShadow && (v.shadowBias = r.shadow.bias,
  49892. v.shadowRadius = r.shadow.radius,
  49893. v.shadowMapSize = r.shadow.mapSize,
  49894. ve.shadows[m++] = r),
  49895. ve.spotShadowMap[f] = r.shadow.map,
  49896. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49897. ve.spot[f++] = v
  49898. } else if (r instanceof Ci.PointLight) {
  49899. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49900. v.position.applyMatrix4(u),
  49901. v.color.copy(r.color).multiplyScalar(r.intensity),
  49902. v.distance = r.distance,
  49903. v.decay = 0 === r.distance ? 0 : r.decay,
  49904. v.shadow = r.castShadow,
  49905. r.castShadow && (v.shadowBias = r.shadow.bias,
  49906. v.shadowRadius = r.shadow.radius,
  49907. v.shadowMapSize = r.shadow.mapSize,
  49908. ve.shadows[m++] = r),
  49909. ve.pointShadowMap[p] = r.shadow.map,
  49910. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49911. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49912. ve.pointShadowMatrix[p].identity().setPosition(me),
  49913. ve.point[p++] = v
  49914. } else if (r instanceof Ci.HemisphereLight) {
  49915. var v;
  49916. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49917. v.direction.transformDirection(u),
  49918. v.direction.normalize(),
  49919. v.skyColor.copy(r.color).multiplyScalar(a),
  49920. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49921. ve.hemi[g++] = v
  49922. }
  49923. ve.ambient[0] = l,
  49924. ve.ambient[1] = c,
  49925. ve.ambient[2] = h,
  49926. ve.directional.length = d,
  49927. ve.spot.length = f,
  49928. ve.point.length = p,
  49929. ve.hemi.length = g,
  49930. ve.shadows.length = m,
  49931. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49932. }(U, t),
  49933. Re.render(e, t),
  49934. Ae.calls = 0,
  49935. Ae.vertices = 0,
  49936. Ae.faces = 0,
  49937. void (Ae.points = 0) === i && (i = null),
  49938. this.setRenderTarget(i),
  49939. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49940. e.overrideMaterial) {
  49941. var o = e.overrideMaterial;
  49942. c(H, t, r, o),
  49943. c(G, t, r, o)
  49944. } else
  49945. _e.setBlending(Ci.NoBlending),
  49946. c(H, t, r),
  49947. c(G, t, r);
  49948. if (Oe.render(e, t),
  49949. Le.render(e, t, re),
  49950. i) {
  49951. var a = i.texture;
  49952. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49953. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49954. , i = be.get(e.texture).__webglTexture;
  49955. _e.bindTexture(t, i),
  49956. X.generateMipmap(t),
  49957. _e.bindTexture(t, null)
  49958. }(i)
  49959. }
  49960. _e.setDepthTest(!0),
  49961. _e.setDepthWrite(!0),
  49962. _e.setColorWrite(!0)
  49963. } else
  49964. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49965. }
  49966. ,
  49967. this.setFaceCulling = function(e, t) {
  49968. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49969. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49970. _e.enable(X.CULL_FACE))
  49971. }
  49972. ,
  49973. this.setTexture = function(e, t) {
  49974. var i = be.get(e);
  49975. if (0 < e.version && i.__version !== e.version) {
  49976. var n = e.image;
  49977. 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)
  49978. }
  49979. _e.activeTexture(X.TEXTURE0 + t),
  49980. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49981. }
  49982. ,
  49983. this.getCurrentRenderTarget = function() {
  49984. return Q
  49985. }
  49986. ,
  49987. this.setRenderTarget = function(e) {
  49988. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49989. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49990. if (e) {
  49991. var n = be.get(e);
  49992. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49993. ie.copy(e.scissor),
  49994. ne = e.scissorTest,
  49995. re.copy(e.viewport)
  49996. } else
  49997. t = null,
  49998. ie.copy(ue).multiplyScalar(he),
  49999. ne = de,
  50000. re.copy(pe).multiplyScalar(he);
  50001. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  50002. J = t),
  50003. _e.scissor(ie),
  50004. _e.setScissorTest(ne),
  50005. _e.viewport(re),
  50006. i) {
  50007. var r = be.get(e.texture);
  50008. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  50009. }
  50010. }
  50011. ,
  50012. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  50013. if (e instanceof Ci.WebGLRenderTarget != 0) {
  50014. var a = be.get(e).__webglFramebuffer;
  50015. if (a) {
  50016. var s = !1;
  50017. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  50018. s = !0);
  50019. try {
  50020. var l = e.texture;
  50021. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  50022. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50023. 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")))
  50024. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50025. 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.")
  50026. } finally {
  50027. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  50028. }
  50029. }
  50030. } else
  50031. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  50032. }
  50033. }
  50034. ,
  50035. Ci.WebGLRenderTarget = function(e, t, i) {
  50036. this.uuid = Ci.Math.generateUUID(),
  50037. this.width = e,
  50038. this.height = t,
  50039. this.scissor = new Ci.Vector4(0,0,e,t),
  50040. this.scissorTest = !1,
  50041. this.viewport = new Ci.Vector4(0,0,e,t),
  50042. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  50043. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50044. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50045. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50046. }
  50047. ,
  50048. Ci.WebGLRenderTarget.prototype = {
  50049. constructor: Ci.WebGLRenderTarget,
  50050. setSize: function(e, t) {
  50051. this.width === e && this.height === t || (this.width = e,
  50052. this.height = t,
  50053. this.dispose()),
  50054. this.viewport.set(0, 0, e, t),
  50055. this.scissor.set(0, 0, e, t)
  50056. },
  50057. clone: function() {
  50058. return (new this.constructor).copy(this)
  50059. },
  50060. copy: function(e) {
  50061. return this.width = e.width,
  50062. this.height = e.height,
  50063. this.viewport.copy(e.viewport),
  50064. this.texture = e.texture.clone(),
  50065. this.depthBuffer = e.depthBuffer,
  50066. this.stencilBuffer = e.stencilBuffer,
  50067. this
  50068. },
  50069. dispose: function() {
  50070. this.dispatchEvent({
  50071. type: "dispose"
  50072. })
  50073. }
  50074. },
  50075. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  50076. Ci.WebGLRenderTargetCube = function(e, t, i) {
  50077. Ci.WebGLRenderTarget.call(this, e, t, i),
  50078. this.activeCubeFace = 0,
  50079. this.activeMipMapLevel = 0
  50080. }
  50081. ,
  50082. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  50083. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  50084. Ci.WebGLBufferRenderer = function(r, o, a) {
  50085. var s;
  50086. this.setMode = function(e) {
  50087. s = e
  50088. }
  50089. ,
  50090. this.render = function(e, t) {
  50091. r.drawArrays(s, e, t),
  50092. a.calls++,
  50093. a.vertices += t,
  50094. s === r.TRIANGLES && (a.faces += t / 3)
  50095. }
  50096. ,
  50097. this.renderInstances = function(e) {
  50098. var t = o.get("ANGLE_instanced_arrays");
  50099. if (null !== t) {
  50100. var i = e.attributes.position
  50101. , n = 0;
  50102. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  50103. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  50104. a.calls++,
  50105. a.vertices += n * e.maxInstancedCount,
  50106. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  50107. } else
  50108. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  50109. }
  50110. }
  50111. ,
  50112. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  50113. var s, l, c;
  50114. this.setMode = function(e) {
  50115. s = e
  50116. }
  50117. ,
  50118. this.setIndex = function(e) {
  50119. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  50120. 4) : (l = r.UNSIGNED_SHORT,
  50121. 2)
  50122. }
  50123. ,
  50124. this.render = function(e, t) {
  50125. r.drawElements(s, t, l, e * c),
  50126. a.calls++,
  50127. a.vertices += t,
  50128. s === r.TRIANGLES && (a.faces += t / 3)
  50129. }
  50130. ,
  50131. this.renderInstances = function(e, t, i) {
  50132. var n = o.get("ANGLE_instanced_arrays");
  50133. 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),
  50134. a.calls++,
  50135. a.vertices += i * e.maxInstancedCount,
  50136. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  50137. }
  50138. }
  50139. ,
  50140. Ci.WebGLExtensions = function(i) {
  50141. var n = {};
  50142. this.get = function(e) {
  50143. if (void 0 !== n[e])
  50144. return n[e];
  50145. var t;
  50146. switch (e) {
  50147. case "EXT_texture_filter_anisotropic":
  50148. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50149. break;
  50150. case "WEBGL_compressed_texture_s3tc":
  50151. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50152. break;
  50153. case "WEBGL_compressed_texture_pvrtc":
  50154. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50155. break;
  50156. case "WEBGL_compressed_texture_etc1":
  50157. t = i.getExtension("WEBGL_compressed_texture_etc1");
  50158. break;
  50159. default:
  50160. t = i.getExtension(e)
  50161. }
  50162. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  50163. n[e] = t
  50164. }
  50165. }
  50166. ,
  50167. Ci.WebGLCapabilities = function(t, e, i) {
  50168. function n(e) {
  50169. if ("highp" === e) {
  50170. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  50171. return "highp";
  50172. e = "mediump"
  50173. }
  50174. 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"
  50175. }
  50176. this.getMaxPrecision = n,
  50177. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50178. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50179. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  50180. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50181. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  50182. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  50183. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  50184. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  50185. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  50186. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  50187. this.vertexTextures = 0 < this.maxVertexTextures,
  50188. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  50189. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50190. var r = n(this.precision);
  50191. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50192. this.precision = r),
  50193. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  50194. }
  50195. ,
  50196. Ci.WebGLGeometries = function(i, o, a) {
  50197. function s(e) {
  50198. var t = e.target
  50199. , i = c[t.id];
  50200. null !== i.index && l(i.index),
  50201. function(e) {
  50202. for (var t in e)
  50203. l(e[t])
  50204. }(i.attributes),
  50205. t.removeEventListener("dispose", s),
  50206. delete c[t.id];
  50207. var n = o.get(t);
  50208. n.wireframe && l(n.wireframe),
  50209. o.delete(t);
  50210. var r = o.get(i);
  50211. r.wireframe && l(r.wireframe),
  50212. o.delete(i),
  50213. a.memory.geometries--
  50214. }
  50215. function l(e) {
  50216. var t = function(e) {
  50217. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50218. }(e);
  50219. void 0 !== t && (i.deleteBuffer(t),
  50220. function(e) {
  50221. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50222. }(e))
  50223. }
  50224. var c = {};
  50225. this.get = function(e) {
  50226. var t, i = e.geometry;
  50227. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50228. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50229. t = i._bufferGeometry),
  50230. c[i.id] = t,
  50231. a.memory.geometries++,
  50232. t)
  50233. }
  50234. }
  50235. ,
  50236. Ci.WebGLLights = function() {
  50237. var i = {};
  50238. this.get = function(e) {
  50239. if (void 0 !== i[e.id])
  50240. return i[e.id];
  50241. var t;
  50242. switch (e.type) {
  50243. case "DirectionalLight":
  50244. t = {
  50245. direction: new Ci.Vector3,
  50246. color: new Ci.Color,
  50247. shadow: !1,
  50248. shadowBias: 0,
  50249. shadowRadius: 1,
  50250. shadowMapSize: new Ci.Vector2
  50251. };
  50252. break;
  50253. case "SpotLight":
  50254. t = {
  50255. position: new Ci.Vector3,
  50256. direction: new Ci.Vector3,
  50257. color: new Ci.Color,
  50258. distance: 0,
  50259. coneCos: 0,
  50260. penumbraCos: 0,
  50261. decay: 0,
  50262. shadow: !1,
  50263. shadowBias: 0,
  50264. shadowRadius: 1,
  50265. shadowMapSize: new Ci.Vector2
  50266. };
  50267. break;
  50268. case "PointLight":
  50269. t = {
  50270. position: new Ci.Vector3,
  50271. color: new Ci.Color,
  50272. distance: 0,
  50273. decay: 0,
  50274. shadow: !1,
  50275. shadowBias: 0,
  50276. shadowRadius: 1,
  50277. shadowMapSize: new Ci.Vector2
  50278. };
  50279. break;
  50280. case "HemisphereLight":
  50281. t = {
  50282. direction: new Ci.Vector3,
  50283. skyColor: new Ci.Color,
  50284. groundColor: new Ci.Color
  50285. }
  50286. }
  50287. return i[e.id] = t
  50288. }
  50289. }
  50290. ,
  50291. Ci.WebGLObjects = function(g, m, e) {
  50292. function v(e, t) {
  50293. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50294. , n = m.get(i);
  50295. void 0 === n.__webglBuffer ? function(e, t, i) {
  50296. e.__webglBuffer = g.createBuffer(),
  50297. g.bindBuffer(i, e.__webglBuffer);
  50298. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50299. g.bufferData(i, t.array, n),
  50300. e.version = t.version
  50301. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50302. g.bindBuffer(i, e.__webglBuffer),
  50303. !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)),
  50304. t.updateRange.count = 0),
  50305. e.version = t.version
  50306. }(n, i, t)
  50307. }
  50308. function y(e, t, i) {
  50309. if (i < t) {
  50310. var n = t;
  50311. t = i,
  50312. i = n
  50313. }
  50314. var r = e[t];
  50315. return void 0 === r ? (e[t] = [i],
  50316. !0) : -1 === r.indexOf(i) && (r.push(i),
  50317. !0)
  50318. }
  50319. var c = new Ci.WebGLGeometries(g,m,e);
  50320. this.getAttributeBuffer = function(e) {
  50321. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50322. }
  50323. ,
  50324. this.getWireframeAttribute = function(e) {
  50325. var t = m.get(e);
  50326. if (void 0 !== t.wireframe)
  50327. return t.wireframe;
  50328. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50329. if (null !== r)
  50330. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50331. var h = i[l + 0]
  50332. , u = i[l + 1]
  50333. , d = i[l + 2];
  50334. y(s, h, u) && n.push(h, u),
  50335. y(s, u, d) && n.push(u, d),
  50336. y(s, d, h) && n.push(d, h)
  50337. }
  50338. else
  50339. for (l = 0,
  50340. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50341. h = l + 0,
  50342. u = l + 1,
  50343. d = l + 2;
  50344. n.push(h, u, u, d, d, h)
  50345. }
  50346. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50347. , f = new Ci.BufferAttribute(new p(n),1);
  50348. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50349. t.wireframe = f
  50350. }
  50351. ,
  50352. this.update = function(e) {
  50353. var t = c.get(e);
  50354. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50355. var i = t.index
  50356. , n = t.attributes;
  50357. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50358. n)
  50359. v(n[r], g.ARRAY_BUFFER);
  50360. var o = t.morphAttributes;
  50361. for (var r in o)
  50362. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50363. v(a[s], g.ARRAY_BUFFER);
  50364. return t
  50365. }
  50366. }
  50367. ,
  50368. Ci.WebGLProgram = (Qt = 0,
  50369. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50370. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50371. ei = /^([\w\d_]+)\[0\]$/,
  50372. function(e, t, i, n) {
  50373. var r = e.context
  50374. , o = i.extensions
  50375. , a = i.defines
  50376. , s = i.__webglShader.vertexShader
  50377. , l = i.__webglShader.fragmentShader
  50378. , c = "SHADOWMAP_TYPE_BASIC";
  50379. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50380. var h = "ENVMAP_TYPE_CUBE"
  50381. , u = "ENVMAP_MODE_REFLECTION"
  50382. , d = "ENVMAP_BLENDING_MULTIPLY";
  50383. if (n.envMap) {
  50384. switch (i.envMap.mapping) {
  50385. case Ci.CubeReflectionMapping:
  50386. case Ci.CubeRefractionMapping:
  50387. h = "ENVMAP_TYPE_CUBE";
  50388. break;
  50389. case Ci.CubeUVReflectionMapping:
  50390. case Ci.CubeUVRefractionMapping:
  50391. h = "ENVMAP_TYPE_CUBE_UV";
  50392. break;
  50393. case Ci.EquirectangularReflectionMapping:
  50394. case Ci.EquirectangularRefractionMapping:
  50395. h = "ENVMAP_TYPE_EQUIREC";
  50396. break;
  50397. case Ci.SphericalReflectionMapping:
  50398. h = "ENVMAP_TYPE_SPHERE"
  50399. }
  50400. switch (i.envMap.mapping) {
  50401. case Ci.CubeRefractionMapping:
  50402. case Ci.EquirectangularRefractionMapping:
  50403. u = "ENVMAP_MODE_REFRACTION"
  50404. }
  50405. switch (i.combine) {
  50406. case Ci.MultiplyOperation:
  50407. d = "ENVMAP_BLENDING_MULTIPLY";
  50408. break;
  50409. case Ci.MixOperation:
  50410. d = "ENVMAP_BLENDING_MIX";
  50411. break;
  50412. case Ci.AddOperation:
  50413. d = "ENVMAP_BLENDING_ADD"
  50414. }
  50415. }
  50416. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50417. 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")
  50418. }(o, n, e.extensions), v = function(e) {
  50419. var t = [];
  50420. for (var i in e) {
  50421. var n = e[i];
  50422. !1 !== n && t.push("#define " + i + " " + n)
  50423. }
  50424. return t.join("\n")
  50425. }(a), y = r.createProgram();
  50426. 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"),
  50427. [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) {
  50428. var i;
  50429. switch (t) {
  50430. case Ci.LinearToneMapping:
  50431. i = "Linear";
  50432. break;
  50433. case Ci.ReinhardToneMapping:
  50434. i = "Reinhard";
  50435. break;
  50436. case Ci.Uncharted2ToneMapping:
  50437. i = "Uncharted2";
  50438. break;
  50439. case Ci.CineonToneMapping:
  50440. i = "OptimizedCineon";
  50441. break;
  50442. default:
  50443. throw new Error("unsupported toneMapping: " + t)
  50444. }
  50445. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50446. }("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) {
  50447. var i = Mi(t);
  50448. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50449. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50450. s = Oi(s = Li(s), n),
  50451. l = Oi(l = Li(l), n),
  50452. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50453. l = Di(l));
  50454. var A = p + s
  50455. , C = f + l
  50456. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50457. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50458. r.attachShader(y, I),
  50459. r.attachShader(y, E),
  50460. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50461. r.linkProgram(y);
  50462. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50463. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50464. 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),
  50465. M && (this.diagnostics = {
  50466. runnable: S,
  50467. material: i,
  50468. programLog: w,
  50469. vertexShader: {
  50470. log: T,
  50471. prefix: p
  50472. },
  50473. fragmentShader: {
  50474. log: x,
  50475. prefix: f
  50476. }
  50477. }),
  50478. r.deleteShader(I),
  50479. r.deleteShader(E),
  50480. this.getUniforms = function() {
  50481. return void 0 === _ && (_ = function(e, t) {
  50482. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50483. var o = e.getActiveUniform(t, r).name
  50484. , a = e.getUniformLocation(t, o)
  50485. , s = Jt.exec(o);
  50486. if (s) {
  50487. var l = s[1]
  50488. , c = s[2]
  50489. , h = i[l];
  50490. (h = h || (i[l] = {}))[c] = a
  50491. } else if (s = $t.exec(o)) {
  50492. var u = s[1]
  50493. , d = s[2]
  50494. , p = s[3]
  50495. , f = i[u]
  50496. , g = (f = f || (i[u] = []))[d];
  50497. (g = g || (f[d] = {}))[p] = a
  50498. } else
  50499. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50500. }
  50501. return i
  50502. }(r, y)),
  50503. _
  50504. }
  50505. ,
  50506. this.getAttributes = function() {
  50507. return void 0 === b && (b = function(e, t) {
  50508. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50509. var o = e.getActiveAttrib(t, r).name;
  50510. i[o] = e.getAttribLocation(t, o)
  50511. }
  50512. return i
  50513. }(r, y)),
  50514. b
  50515. }
  50516. ,
  50517. this.destroy = function() {
  50518. r.deleteProgram(y),
  50519. this.program = void 0
  50520. }
  50521. ,
  50522. Object.defineProperties(this, {
  50523. uniforms: {
  50524. get: function() {
  50525. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50526. this.getUniforms()
  50527. }
  50528. },
  50529. attributes: {
  50530. get: function() {
  50531. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50532. this.getAttributes()
  50533. }
  50534. }
  50535. }),
  50536. this.id = Qt++,
  50537. this.code = t,
  50538. this.usedTimes = 1,
  50539. this.program = y,
  50540. this.vertexShader = I,
  50541. this.fragmentShader = E,
  50542. this
  50543. }
  50544. ),
  50545. Ci.WebGLPrograms = function(s, l) {
  50546. function c(e, t) {
  50547. var i;
  50548. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50549. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50550. i
  50551. }
  50552. var h = []
  50553. , u = {
  50554. MeshDepthMaterial: "depth",
  50555. MeshNormalMaterial: "normal",
  50556. MeshBasicMaterial: "basic",
  50557. MeshLambertMaterial: "lambert",
  50558. MeshPhongMaterial: "phong",
  50559. MeshStandardMaterial: "standard",
  50560. LineBasicMaterial: "basic",
  50561. LineDashedMaterial: "dashed",
  50562. PointsMaterial: "points"
  50563. }
  50564. , 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"];
  50565. this.getParameters = function(e, t, i, n) {
  50566. var r = u[e.type]
  50567. , o = function(e) {
  50568. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50569. return 1024;
  50570. var t = l.maxVertexUniforms
  50571. , i = Math.floor((t - 20) / 4);
  50572. 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)")),
  50573. i
  50574. }(n)
  50575. , a = s.getPrecision();
  50576. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50577. {
  50578. shaderID: r,
  50579. precision: a,
  50580. supportsVertexTextures: l.vertexTextures,
  50581. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50582. map: !!e.map,
  50583. mapEncoding: c(e.map, s.gammaInput),
  50584. envMap: !!e.envMap,
  50585. envMapMode: e.envMap && e.envMap.mapping,
  50586. envMapEncoding: c(e.envMap, s.gammaInput),
  50587. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50588. lightMap: !!e.lightMap,
  50589. aoMap: !!e.aoMap,
  50590. emissiveMap: !!e.emissiveMap,
  50591. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50592. bumpMap: !!e.bumpMap,
  50593. normalMap: !!e.normalMap,
  50594. displacementMap: !!e.displacementMap,
  50595. roughnessMap: !!e.roughnessMap,
  50596. metalnessMap: !!e.metalnessMap,
  50597. specularMap: !!e.specularMap,
  50598. alphaMap: !!e.alphaMap,
  50599. combine: e.combine,
  50600. vertexColors: e.vertexColors,
  50601. fog: i,
  50602. useFog: e.fog,
  50603. fogExp: i instanceof Ci.FogExp2,
  50604. flatShading: e.shading === Ci.FlatShading,
  50605. sizeAttenuation: e.sizeAttenuation,
  50606. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50607. skinning: e.skinning,
  50608. maxBones: o,
  50609. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50610. morphTargets: e.morphTargets,
  50611. morphNormals: e.morphNormals,
  50612. maxMorphTargets: s.maxMorphTargets,
  50613. maxMorphNormals: s.maxMorphNormals,
  50614. numDirLights: t.directional.length,
  50615. numPointLights: t.point.length,
  50616. numSpotLights: t.spot.length,
  50617. numHemiLights: t.hemi.length,
  50618. pointLightShadows: t.shadowsPointLight,
  50619. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50620. shadowMapType: s.shadowMap.type,
  50621. toneMapping: s.toneMapping,
  50622. physicallyCorrectLights: s.physicallyCorrectLights,
  50623. premultipliedAlpha: e.premultipliedAlpha,
  50624. alphaTest: e.alphaTest,
  50625. doubleSided: e.side === Ci.DoubleSide,
  50626. flipSided: e.side === Ci.BackSide
  50627. }
  50628. }
  50629. ,
  50630. this.getProgramCode = function(e, t) {
  50631. var i = [];
  50632. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50633. i.push(e.vertexShader)),
  50634. void 0 !== e.defines)
  50635. for (var n in e.defines)
  50636. i.push(n),
  50637. i.push(e.defines[n]);
  50638. for (var r = 0; r < a.length; r++) {
  50639. var o = a[r];
  50640. i.push(o),
  50641. i.push(t[o])
  50642. }
  50643. return i.join()
  50644. }
  50645. ,
  50646. this.acquireProgram = function(e, t, i) {
  50647. for (var n, r = 0, o = h.length; r < o; r++) {
  50648. var a = h[r];
  50649. if (a.code === i) {
  50650. ++(n = a).usedTimes;
  50651. break
  50652. }
  50653. }
  50654. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50655. h.push(n)),
  50656. n
  50657. }
  50658. ,
  50659. this.releaseProgram = function(e) {
  50660. if (0 == --e.usedTimes) {
  50661. var t = h.indexOf(e);
  50662. h[t] = h[h.length - 1],
  50663. h.pop(),
  50664. e.destroy()
  50665. }
  50666. }
  50667. ,
  50668. this.programs = h
  50669. }
  50670. ,
  50671. Ci.WebGLProperties = function() {
  50672. var n = {};
  50673. this.get = function(e) {
  50674. var t = e.uuid
  50675. , i = n[t];
  50676. return void 0 === i && (i = {},
  50677. n[t] = i),
  50678. i
  50679. }
  50680. ,
  50681. this.delete = function(e) {
  50682. delete n[e.uuid]
  50683. }
  50684. ,
  50685. this.clear = function() {
  50686. n = {}
  50687. }
  50688. }
  50689. ,
  50690. Ci.WebGLShader = function(e, t, i) {
  50691. var n = e.createShader(t);
  50692. return e.shaderSource(n, i),
  50693. e.compileShader(n),
  50694. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50695. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50696. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50697. t[i] = i + 1 + ": " + t[i];
  50698. return t.join("\n")
  50699. }(i)),
  50700. n
  50701. }
  50702. ,
  50703. Ci.WebGLShadowMap = function(P, O, L) {
  50704. function D(e, t, i, n) {
  50705. var r = e.geometry
  50706. , o = null
  50707. , a = p
  50708. , s = e.customDepthMaterial;
  50709. if (i && (a = f,
  50710. s = e.customDistanceMaterial),
  50711. s)
  50712. o = s;
  50713. else {
  50714. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50715. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50716. , h = 0;
  50717. l && (h |= u),
  50718. c && (h |= d),
  50719. o = a[h]
  50720. }
  50721. return o.visible = t.visible,
  50722. o.wireframe = t.wireframe,
  50723. o.wireframeLinewidth = t.wireframeLinewidth,
  50724. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50725. o
  50726. }
  50727. function N(e, t, i) {
  50728. if (!1 !== e.visible) {
  50729. 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)))
  50730. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50731. G.push(e));
  50732. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50733. N(n[r], t, i)
  50734. }
  50735. }
  50736. 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) {
  50737. var a = 0 != (o & u)
  50738. , s = 0 != (o & d)
  50739. , l = new Ci.ShaderMaterial({
  50740. uniforms: i,
  50741. vertexShader: t.vertexShader,
  50742. fragmentShader: t.fragmentShader,
  50743. morphTargets: a,
  50744. skinning: s
  50745. });
  50746. p[o] = l;
  50747. var c = new Ci.ShaderMaterial({
  50748. defines: {
  50749. USE_SHADOWMAP: ""
  50750. },
  50751. uniforms: r,
  50752. vertexShader: n.vertexShader,
  50753. fragmentShader: n.fragmentShader,
  50754. morphTargets: a,
  50755. skinning: s
  50756. });
  50757. f[o] = c
  50758. }
  50759. var q = this;
  50760. this.enabled = !1,
  50761. this.autoUpdate = !0,
  50762. this.needsUpdate = !1,
  50763. this.type = Ci.PCFShadowMap,
  50764. this.cullFace = Ci.CullFaceFront,
  50765. this.render = function(e, t) {
  50766. var i, n, r = O.shadows;
  50767. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50768. B.clearColor(1, 1, 1, 1),
  50769. B.disable(F.BLEND),
  50770. B.enable(F.CULL_FACE),
  50771. F.frontFace(F.CCW),
  50772. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50773. B.setDepthTest(!0),
  50774. B.setScissorTest(!1);
  50775. for (var o = 0, a = r.length; o < a; o++) {
  50776. var s = r[o]
  50777. , l = s.shadow
  50778. , c = l.camera;
  50779. if (U.copy(l.mapSize),
  50780. s instanceof Ci.PointLight) {
  50781. i = 6,
  50782. n = !0;
  50783. var h = U.x
  50784. , u = U.y;
  50785. Y[0].set(2 * h, u, h, u),
  50786. Y[1].set(0, u, h, u),
  50787. Y[2].set(3 * h, u, h, u),
  50788. Y[3].set(h, u, h, u),
  50789. Y[4].set(3 * h, 0, h, u),
  50790. Y[5].set(h, 0, h, u),
  50791. U.x *= 4,
  50792. U.y *= 2
  50793. } else
  50794. n = !(i = 1);
  50795. if (null === l.map) {
  50796. var d = {
  50797. minFilter: Ci.NearestFilter,
  50798. magFilter: Ci.NearestFilter,
  50799. format: Ci.RGBAFormat
  50800. };
  50801. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50802. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50803. c.updateProjectionMatrix()
  50804. }
  50805. var p = l.map
  50806. , f = l.matrix;
  50807. z.setFromMatrixPosition(s.matrixWorld),
  50808. c.position.copy(z),
  50809. P.setRenderTarget(p),
  50810. P.clear();
  50811. for (var g = 0; g < i; g++) {
  50812. if (n) {
  50813. H.copy(c.position),
  50814. H.add(W[g]),
  50815. c.up.copy(j[g]),
  50816. c.lookAt(H);
  50817. var m = Y[g];
  50818. B.viewport(m)
  50819. } else
  50820. H.setFromMatrixPosition(s.target.matrixWorld),
  50821. c.lookAt(H);
  50822. c.updateMatrixWorld(),
  50823. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50824. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50825. f.multiply(c.projectionMatrix),
  50826. f.multiply(c.matrixWorldInverse),
  50827. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50828. V.setFromMatrix(k),
  50829. G.length = 0,
  50830. N(e, t, c);
  50831. for (var v = 0, y = G.length; v < y; v++) {
  50832. var A = G[v]
  50833. , C = L.update(A)
  50834. , I = A.material;
  50835. if (I instanceof Ci.MultiMaterial)
  50836. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50837. var T = E[b]
  50838. , x = _[T.materialIndex];
  50839. if (!0 === x.visible) {
  50840. var S = D(A, x, n, z);
  50841. P.renderBufferDirect(c, null, C, S, A, T)
  50842. }
  50843. }
  50844. else {
  50845. S = D(A, I, n, z);
  50846. P.renderBufferDirect(c, null, C, S, A, null)
  50847. }
  50848. }
  50849. }
  50850. }
  50851. var M = P.getClearColor()
  50852. , R = P.getClearAlpha();
  50853. P.setClearColor(M, R),
  50854. B.enable(F.BLEND),
  50855. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50856. q.needsUpdate = !1
  50857. }
  50858. }
  50859. }
  50860. ,
  50861. Ci.WebGLState = function(l, i, c) {
  50862. var n = this
  50863. , r = new Ci.Vector4
  50864. , o = new Uint8Array(16)
  50865. , a = new Uint8Array(16)
  50866. , s = new Uint8Array(16)
  50867. , t = {}
  50868. , h = null
  50869. , u = null
  50870. , d = null
  50871. , p = null
  50872. , f = null
  50873. , g = null
  50874. , m = null
  50875. , v = null
  50876. , y = !1
  50877. , A = null
  50878. , C = null
  50879. , I = null
  50880. , E = null
  50881. , _ = null
  50882. , b = null
  50883. , w = null
  50884. , T = null
  50885. , x = null
  50886. , S = null
  50887. , M = null
  50888. , R = null
  50889. , P = null
  50890. , O = null
  50891. , L = null
  50892. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50893. , N = void 0
  50894. , F = {}
  50895. , B = new Ci.Vector4
  50896. , V = null
  50897. , k = null
  50898. , U = new Ci.Vector4
  50899. , H = new Ci.Vector4
  50900. , z = l.createTexture();
  50901. l.bindTexture(l.TEXTURE_2D, z),
  50902. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50903. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50904. this.init = function() {
  50905. this.clearColor(0, 0, 0, 1),
  50906. this.clearDepth(1),
  50907. this.clearStencil(0),
  50908. this.enable(l.DEPTH_TEST),
  50909. l.depthFunc(l.LEQUAL),
  50910. l.frontFace(l.CCW),
  50911. l.cullFace(l.BACK),
  50912. this.enable(l.CULL_FACE),
  50913. this.enable(l.BLEND),
  50914. l.blendEquation(l.FUNC_ADD),
  50915. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50916. }
  50917. ,
  50918. this.initAttributes = function() {
  50919. for (var e = 0, t = o.length; e < t; e++)
  50920. o[e] = 0
  50921. }
  50922. ,
  50923. this.enableAttribute = function(e) {
  50924. o[e] = 1,
  50925. 0 === a[e] && (l.enableVertexAttribArray(e),
  50926. a[e] = 1),
  50927. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50928. s[e] = 0)
  50929. }
  50930. ,
  50931. this.enableAttributeAndDivisor = function(e, t, i) {
  50932. o[e] = 1,
  50933. 0 === a[e] && (l.enableVertexAttribArray(e),
  50934. a[e] = 1),
  50935. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50936. s[e] = t)
  50937. }
  50938. ,
  50939. this.disableUnusedAttributes = function() {
  50940. for (var e = 0, t = a.length; e < t; e++)
  50941. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50942. a[e] = 0)
  50943. }
  50944. ,
  50945. this.enable = function(e) {
  50946. !0 !== t[e] && (l.enable(e),
  50947. t[e] = !0)
  50948. }
  50949. ,
  50950. this.disable = function(e) {
  50951. !1 !== t[e] && (l.disable(e),
  50952. t[e] = !1)
  50953. }
  50954. ,
  50955. this.getCompressedTextureFormats = function() {
  50956. if (null === h && (h = [],
  50957. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50958. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50959. h.push(e[t]);
  50960. return h
  50961. }
  50962. ,
  50963. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50964. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50965. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50966. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50967. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50968. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50969. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50970. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50971. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50972. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50973. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50974. u = e,
  50975. y = s),
  50976. e === Ci.CustomBlending ? (r = r || t,
  50977. o = o || i,
  50978. a = a || n,
  50979. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50980. d = t,
  50981. g = r),
  50982. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50983. p = i,
  50984. f = n,
  50985. m = o,
  50986. v = a)) : v = m = g = f = p = d = null
  50987. }
  50988. ,
  50989. this.setDepthFunc = function(e) {
  50990. if (A !== e) {
  50991. if (e)
  50992. switch (e) {
  50993. case Ci.NeverDepth:
  50994. l.depthFunc(l.NEVER);
  50995. break;
  50996. case Ci.AlwaysDepth:
  50997. l.depthFunc(l.ALWAYS);
  50998. break;
  50999. case Ci.LessDepth:
  51000. l.depthFunc(l.LESS);
  51001. break;
  51002. case Ci.LessEqualDepth:
  51003. l.depthFunc(l.LEQUAL);
  51004. break;
  51005. case Ci.EqualDepth:
  51006. l.depthFunc(l.EQUAL);
  51007. break;
  51008. case Ci.GreaterEqualDepth:
  51009. l.depthFunc(l.GEQUAL);
  51010. break;
  51011. case Ci.GreaterDepth:
  51012. l.depthFunc(l.GREATER);
  51013. break;
  51014. case Ci.NotEqualDepth:
  51015. l.depthFunc(l.NOTEQUAL);
  51016. break;
  51017. default:
  51018. l.depthFunc(l.LEQUAL)
  51019. }
  51020. else
  51021. l.depthFunc(l.LEQUAL);
  51022. A = e
  51023. }
  51024. }
  51025. ,
  51026. this.setDepthTest = function(e) {
  51027. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  51028. }
  51029. ,
  51030. this.setDepthWrite = function(e) {
  51031. C !== e && (l.depthMask(e),
  51032. C = e)
  51033. }
  51034. ,
  51035. this.setColorWrite = function(e) {
  51036. I !== e && (l.colorMask(e, e, e, e),
  51037. I = e)
  51038. }
  51039. ,
  51040. this.setStencilFunc = function(e, t, i) {
  51041. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  51042. _ = e,
  51043. b = t,
  51044. w = i)
  51045. }
  51046. ,
  51047. this.setStencilOp = function(e, t, i) {
  51048. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  51049. T = e,
  51050. x = t,
  51051. S = i)
  51052. }
  51053. ,
  51054. this.setStencilTest = function(e) {
  51055. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  51056. }
  51057. ,
  51058. this.setStencilWrite = function(e) {
  51059. E !== e && (l.stencilMask(e),
  51060. E = e)
  51061. }
  51062. ,
  51063. this.setFlipSided = function(e) {
  51064. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  51065. M = e)
  51066. }
  51067. ,
  51068. this.setLineWidth = function(e) {
  51069. e !== R && (l.lineWidth(e),
  51070. R = e)
  51071. }
  51072. ,
  51073. this.setPolygonOffset = function(e, t, i) {
  51074. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  51075. !e || P === t && O === i || (l.polygonOffset(t, i),
  51076. P = t,
  51077. O = i)
  51078. }
  51079. ,
  51080. this.getScissorTest = function() {
  51081. return L
  51082. }
  51083. ,
  51084. this.setScissorTest = function(e) {
  51085. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  51086. }
  51087. ,
  51088. this.activeTexture = function(e) {
  51089. void 0 === e && (e = l.TEXTURE0 + D - 1),
  51090. N !== e && (l.activeTexture(e),
  51091. N = e)
  51092. }
  51093. ,
  51094. this.bindTexture = function(e, t) {
  51095. void 0 === N && n.activeTexture();
  51096. var i = F[N];
  51097. void 0 === i && (i = {
  51098. type: void 0,
  51099. texture: void 0
  51100. },
  51101. F[N] = i),
  51102. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  51103. i.type = e,
  51104. i.texture = t)
  51105. }
  51106. ,
  51107. this.compressedTexImage2D = function() {
  51108. try {
  51109. l.compressedTexImage2D.apply(l, arguments)
  51110. } catch (e) {
  51111. console.error(e)
  51112. }
  51113. }
  51114. ,
  51115. this.texImage2D = function() {
  51116. try {
  51117. l.texImage2D.apply(l, arguments)
  51118. } catch (e) {
  51119. console.error(e)
  51120. }
  51121. }
  51122. ,
  51123. this.clearColor = function(e, t, i, n) {
  51124. r.set(e, t, i, n),
  51125. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  51126. B.copy(r))
  51127. }
  51128. ,
  51129. this.clearDepth = function(e) {
  51130. V !== e && (l.clearDepth(e),
  51131. V = e)
  51132. }
  51133. ,
  51134. this.clearStencil = function(e) {
  51135. k !== e && (l.clearStencil(e),
  51136. k = e)
  51137. }
  51138. ,
  51139. this.scissor = function(e) {
  51140. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  51141. U.copy(e))
  51142. }
  51143. ,
  51144. this.viewport = function(e) {
  51145. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  51146. H.copy(e))
  51147. }
  51148. ,
  51149. this.reset = function() {
  51150. for (var e = 0; e < a.length; e++)
  51151. 1 === a[e] && (l.disableVertexAttribArray(e),
  51152. a[e] = 0);
  51153. t = {},
  51154. N = void 0,
  51155. F = {},
  51156. M = E = C = I = u = h = null
  51157. }
  51158. }
  51159. ,
  51160. Ci.LensFlarePlugin = function(v, y) {
  51161. function A() {
  51162. 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]);
  51163. C = S.createBuffer(),
  51164. I = S.createBuffer(),
  51165. S.bindBuffer(S.ARRAY_BUFFER, C),
  51166. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  51167. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51168. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  51169. T = S.createTexture(),
  51170. x = S.createTexture(),
  51171. M.bindTexture(S.TEXTURE_2D, T),
  51172. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  51173. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51174. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51175. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51176. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51177. M.bindTexture(S.TEXTURE_2D, x),
  51178. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  51179. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51180. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51181. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51182. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51183. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  51184. 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"),
  51185. 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")
  51186. } : {
  51187. 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"),
  51188. 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")
  51189. },
  51190. E = function(e) {
  51191. var t = S.createProgram()
  51192. , i = S.createShader(S.FRAGMENT_SHADER)
  51193. , n = S.createShader(S.VERTEX_SHADER)
  51194. , r = "precision " + v.getPrecision() + " float;\n";
  51195. return S.shaderSource(i, r + e.fragmentShader),
  51196. S.shaderSource(n, r + e.vertexShader),
  51197. S.compileShader(i),
  51198. S.compileShader(n),
  51199. S.attachShader(t, i),
  51200. S.attachShader(t, n),
  51201. S.linkProgram(t),
  51202. t
  51203. }(e),
  51204. _ = {
  51205. vertex: S.getAttribLocation(E, "position"),
  51206. uv: S.getAttribLocation(E, "uv")
  51207. },
  51208. b = {
  51209. renderType: S.getUniformLocation(E, "renderType"),
  51210. map: S.getUniformLocation(E, "map"),
  51211. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51212. opacity: S.getUniformLocation(E, "opacity"),
  51213. color: S.getUniformLocation(E, "color"),
  51214. scale: S.getUniformLocation(E, "scale"),
  51215. rotation: S.getUniformLocation(E, "rotation"),
  51216. screenPosition: S.getUniformLocation(E, "screenPosition")
  51217. }
  51218. }
  51219. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51220. this.render = function(e, t, i) {
  51221. if (0 !== y.length) {
  51222. var n = new Ci.Vector3
  51223. , r = i.w / i.z
  51224. , o = .5 * i.z
  51225. , a = .5 * i.w
  51226. , s = 16 / i.w
  51227. , l = new Ci.Vector2(s * r,s)
  51228. , c = new Ci.Vector3(1,1,0)
  51229. , h = new Ci.Vector2(1,1);
  51230. void 0 === E && A(),
  51231. S.useProgram(E),
  51232. M.initAttributes(),
  51233. M.enableAttribute(_.vertex),
  51234. M.enableAttribute(_.uv),
  51235. M.disableUnusedAttributes(),
  51236. S.uniform1i(b.occlusionMap, 0),
  51237. S.uniform1i(b.map, 1),
  51238. S.bindBuffer(S.ARRAY_BUFFER, C),
  51239. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51240. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51241. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51242. M.disable(S.CULL_FACE),
  51243. M.setDepthWrite(!1);
  51244. for (var u = 0, d = y.length; u < d; u++) {
  51245. s = 16 / i.w,
  51246. l.set(s * r, s);
  51247. var p = y[u];
  51248. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51249. n.applyMatrix4(t.matrixWorldInverse),
  51250. n.applyProjection(t.projectionMatrix),
  51251. c.copy(n),
  51252. h.x = c.x * o + o,
  51253. h.y = c.y * a + a,
  51254. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51255. M.activeTexture(S.TEXTURE0),
  51256. M.bindTexture(S.TEXTURE_2D, null),
  51257. M.activeTexture(S.TEXTURE1),
  51258. M.bindTexture(S.TEXTURE_2D, T),
  51259. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51260. S.uniform1i(b.renderType, 0),
  51261. S.uniform2f(b.scale, l.x, l.y),
  51262. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51263. M.disable(S.BLEND),
  51264. M.enable(S.DEPTH_TEST),
  51265. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51266. M.activeTexture(S.TEXTURE0),
  51267. M.bindTexture(S.TEXTURE_2D, x),
  51268. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51269. S.uniform1i(b.renderType, 1),
  51270. M.disable(S.DEPTH_TEST),
  51271. M.activeTexture(S.TEXTURE1),
  51272. M.bindTexture(S.TEXTURE_2D, T),
  51273. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51274. p.positionScreen.copy(c),
  51275. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51276. S.uniform1i(b.renderType, 2),
  51277. M.enable(S.BLEND);
  51278. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51279. var m = p.lensFlares[f];
  51280. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51281. c.y = m.y,
  51282. c.z = m.z,
  51283. s = m.size * m.scale / i.w,
  51284. l.x = s * r,
  51285. l.y = s,
  51286. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51287. S.uniform2f(b.scale, l.x, l.y),
  51288. S.uniform1f(b.rotation, m.rotation),
  51289. S.uniform1f(b.opacity, m.opacity),
  51290. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51291. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51292. v.setTexture(m.texture, 1),
  51293. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51294. }
  51295. }
  51296. }
  51297. M.enable(S.CULL_FACE),
  51298. M.enable(S.DEPTH_TEST),
  51299. M.setDepthWrite(!0),
  51300. v.resetGLState()
  51301. }
  51302. }
  51303. }
  51304. ,
  51305. Ci.SpritePlugin = function(u, d) {
  51306. function p() {
  51307. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51308. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51309. g = I.createBuffer(),
  51310. m = I.createBuffer(),
  51311. I.bindBuffer(I.ARRAY_BUFFER, g),
  51312. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51313. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51314. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51315. v = function() {
  51316. var e = I.createProgram()
  51317. , t = I.createShader(I.VERTEX_SHADER)
  51318. , i = I.createShader(I.FRAGMENT_SHADER);
  51319. 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")),
  51320. 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")),
  51321. I.compileShader(t),
  51322. I.compileShader(i),
  51323. I.attachShader(e, t),
  51324. I.attachShader(e, i),
  51325. I.linkProgram(e),
  51326. e
  51327. }(),
  51328. y = {
  51329. position: I.getAttribLocation(v, "position"),
  51330. uv: I.getAttribLocation(v, "uv")
  51331. },
  51332. A = {
  51333. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51334. uvScale: I.getUniformLocation(v, "uvScale"),
  51335. rotation: I.getUniformLocation(v, "rotation"),
  51336. scale: I.getUniformLocation(v, "scale"),
  51337. color: I.getUniformLocation(v, "color"),
  51338. map: I.getUniformLocation(v, "map"),
  51339. opacity: I.getUniformLocation(v, "opacity"),
  51340. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51341. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51342. fogType: I.getUniformLocation(v, "fogType"),
  51343. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51344. fogNear: I.getUniformLocation(v, "fogNear"),
  51345. fogFar: I.getUniformLocation(v, "fogFar"),
  51346. fogColor: I.getUniformLocation(v, "fogColor"),
  51347. alphaTest: I.getUniformLocation(v, "alphaTest")
  51348. };
  51349. var i = document.createElement("canvas");
  51350. i.width = 8,
  51351. i.height = 8;
  51352. var n = i.getContext("2d");
  51353. n.fillStyle = "white",
  51354. n.fillRect(0, 0, 8, 8),
  51355. (C = new Ci.Texture(i)).needsUpdate = !0
  51356. }
  51357. function f(e, t) {
  51358. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51359. }
  51360. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51361. this.render = function(e, t) {
  51362. if (0 !== d.length) {
  51363. void 0 === v && p(),
  51364. I.useProgram(v),
  51365. E.initAttributes(),
  51366. E.enableAttribute(y.position),
  51367. E.enableAttribute(y.uv),
  51368. E.disableUnusedAttributes(),
  51369. E.disable(I.CULL_FACE),
  51370. E.enable(I.BLEND),
  51371. I.bindBuffer(I.ARRAY_BUFFER, g),
  51372. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51373. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51374. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51375. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51376. E.activeTexture(I.TEXTURE0),
  51377. I.uniform1i(A.map, 0);
  51378. var i = 0
  51379. , n = 0
  51380. , r = e.fog;
  51381. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51382. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51383. I.uniform1f(A.fogFar, r.far),
  51384. I.uniform1i(A.fogType, 1),
  51385. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51386. I.uniform1i(A.fogType, 2),
  51387. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51388. n = i = 0);
  51389. for (var o = 0, a = d.length; o < a; o++) {
  51390. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51391. l.z = -l.modelViewMatrix.elements[14]
  51392. }
  51393. d.sort(f);
  51394. var s = [];
  51395. for (o = 0,
  51396. a = d.length; o < a; o++) {
  51397. var l, c = (l = d[o]).material;
  51398. I.uniform1f(A.alphaTest, c.alphaTest),
  51399. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51400. l.matrixWorld.decompose(_, b, w),
  51401. s[0] = w.x,
  51402. s[1] = w.y;
  51403. var h = 0;
  51404. e.fog && c.fog && (h = n),
  51405. i !== h && (I.uniform1i(A.fogType, h),
  51406. i = h),
  51407. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51408. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51409. I.uniform2f(A.uvScale, 1, 1)),
  51410. I.uniform1f(A.opacity, c.opacity),
  51411. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51412. I.uniform1f(A.rotation, c.rotation),
  51413. I.uniform2fv(A.scale, s),
  51414. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51415. E.setDepthTest(c.depthTest),
  51416. E.setDepthWrite(c.depthWrite),
  51417. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51418. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51419. }
  51420. E.enable(I.CULL_FACE),
  51421. u.resetGLState()
  51422. }
  51423. }
  51424. }
  51425. ,
  51426. Object.defineProperties(Ci.Box2.prototype, {
  51427. empty: {
  51428. value: function() {
  51429. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51430. this.isEmpty()
  51431. }
  51432. },
  51433. isIntersectionBox: {
  51434. value: function(e) {
  51435. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51436. this.intersectsBox(e)
  51437. }
  51438. }
  51439. }),
  51440. Object.defineProperties(Ci.Box3.prototype, {
  51441. empty: {
  51442. value: function() {
  51443. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51444. this.isEmpty()
  51445. }
  51446. },
  51447. isIntersectionBox: {
  51448. value: function(e) {
  51449. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51450. this.intersectsBox(e)
  51451. }
  51452. },
  51453. isIntersectionSphere: {
  51454. value: function(e) {
  51455. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51456. this.intersectsSphere(e)
  51457. }
  51458. }
  51459. }),
  51460. Object.defineProperties(Ci.Matrix3.prototype, {
  51461. multiplyVector3: {
  51462. value: function(e) {
  51463. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51464. e.applyMatrix3(this)
  51465. }
  51466. },
  51467. multiplyVector3Array: {
  51468. value: function(e) {
  51469. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51470. this.applyToVector3Array(e)
  51471. }
  51472. }
  51473. }),
  51474. Object.defineProperties(Ci.Matrix4.prototype, {
  51475. extractPosition: {
  51476. value: function(e) {
  51477. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51478. this.copyPosition(e)
  51479. }
  51480. },
  51481. setRotationFromQuaternion: {
  51482. value: function(e) {
  51483. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51484. this.makeRotationFromQuaternion(e)
  51485. }
  51486. },
  51487. multiplyVector3: {
  51488. value: function(e) {
  51489. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51490. e.applyProjection(this)
  51491. }
  51492. },
  51493. multiplyVector4: {
  51494. value: function(e) {
  51495. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51496. e.applyMatrix4(this)
  51497. }
  51498. },
  51499. multiplyVector3Array: {
  51500. value: function(e) {
  51501. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51502. this.applyToVector3Array(e)
  51503. }
  51504. },
  51505. rotateAxis: {
  51506. value: function(e) {
  51507. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51508. e.transformDirection(this)
  51509. }
  51510. },
  51511. crossVector: {
  51512. value: function(e) {
  51513. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51514. e.applyMatrix4(this)
  51515. }
  51516. },
  51517. translate: {
  51518. value: function(e) {
  51519. console.error("THREE.Matrix4: .translate() has been removed.")
  51520. }
  51521. },
  51522. rotateX: {
  51523. value: function(e) {
  51524. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51525. }
  51526. },
  51527. rotateY: {
  51528. value: function(e) {
  51529. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51530. }
  51531. },
  51532. rotateZ: {
  51533. value: function(e) {
  51534. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51535. }
  51536. },
  51537. rotateByAxis: {
  51538. value: function(e, t) {
  51539. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51540. }
  51541. }
  51542. }),
  51543. Object.defineProperties(Ci.Plane.prototype, {
  51544. isIntersectionLine: {
  51545. value: function(e) {
  51546. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51547. this.intersectsLine(e)
  51548. }
  51549. }
  51550. }),
  51551. Object.defineProperties(Ci.Quaternion.prototype, {
  51552. multiplyVector3: {
  51553. value: function(e) {
  51554. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51555. e.applyQuaternion(this)
  51556. }
  51557. }
  51558. }),
  51559. Object.defineProperties(Ci.Ray.prototype, {
  51560. isIntersectionBox: {
  51561. value: function(e) {
  51562. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51563. this.intersectsBox(e)
  51564. }
  51565. },
  51566. isIntersectionPlane: {
  51567. value: function(e) {
  51568. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51569. this.intersectsPlane(e)
  51570. }
  51571. },
  51572. isIntersectionSphere: {
  51573. value: function(e) {
  51574. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51575. this.intersectsSphere(e)
  51576. }
  51577. }
  51578. }),
  51579. Object.defineProperties(Ci.Vector3.prototype, {
  51580. setEulerFromRotationMatrix: {
  51581. value: function() {
  51582. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51583. }
  51584. },
  51585. setEulerFromQuaternion: {
  51586. value: function() {
  51587. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51588. }
  51589. },
  51590. getPositionFromMatrix: {
  51591. value: function(e) {
  51592. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51593. this.setFromMatrixPosition(e)
  51594. }
  51595. },
  51596. getScaleFromMatrix: {
  51597. value: function(e) {
  51598. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51599. this.setFromMatrixScale(e)
  51600. }
  51601. },
  51602. getColumnFromMatrix: {
  51603. value: function(e, t) {
  51604. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51605. this.setFromMatrixColumn(e, t)
  51606. }
  51607. }
  51608. }),
  51609. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51610. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51611. new Ci.Face3(e,t,i,r,o,a)
  51612. }
  51613. ,
  51614. Ci.Vertex = function(e, t, i) {
  51615. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51616. new Ci.Vector3(e,t,i)
  51617. }
  51618. ,
  51619. Object.defineProperties(Ci.Object3D.prototype, {
  51620. eulerOrder: {
  51621. get: function() {
  51622. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51623. this.rotation.order
  51624. },
  51625. set: function(e) {
  51626. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51627. this.rotation.order = e
  51628. }
  51629. },
  51630. getChildByName: {
  51631. value: function(e) {
  51632. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51633. this.getObjectByName(e)
  51634. }
  51635. },
  51636. renderDepth: {
  51637. set: function(e) {
  51638. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51639. }
  51640. },
  51641. translate: {
  51642. value: function(e, t) {
  51643. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51644. this.translateOnAxis(t, e)
  51645. }
  51646. },
  51647. useQuaternion: {
  51648. get: function() {
  51649. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51650. },
  51651. set: function(e) {
  51652. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51653. }
  51654. }
  51655. }),
  51656. Object.defineProperties(Ci, {
  51657. PointCloud: {
  51658. value: function(e, t) {
  51659. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51660. new Ci.Points(e,t)
  51661. }
  51662. },
  51663. ParticleSystem: {
  51664. value: function(e, t) {
  51665. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51666. new Ci.Points(e,t)
  51667. }
  51668. }
  51669. }),
  51670. Object.defineProperties(Ci.Light.prototype, {
  51671. onlyShadow: {
  51672. set: function(e) {
  51673. console.warn("THREE.Light: .onlyShadow has been removed.")
  51674. }
  51675. },
  51676. shadowCameraFov: {
  51677. set: function(e) {
  51678. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51679. this.shadow.camera.fov = e
  51680. }
  51681. },
  51682. shadowCameraLeft: {
  51683. set: function(e) {
  51684. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51685. this.shadow.camera.left = e
  51686. }
  51687. },
  51688. shadowCameraRight: {
  51689. set: function(e) {
  51690. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51691. this.shadow.camera.right = e
  51692. }
  51693. },
  51694. shadowCameraTop: {
  51695. set: function(e) {
  51696. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51697. this.shadow.camera.top = e
  51698. }
  51699. },
  51700. shadowCameraBottom: {
  51701. set: function(e) {
  51702. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51703. this.shadow.camera.bottom = e
  51704. }
  51705. },
  51706. shadowCameraNear: {
  51707. set: function(e) {
  51708. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51709. this.shadow.camera.near = e
  51710. }
  51711. },
  51712. shadowCameraFar: {
  51713. set: function(e) {
  51714. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51715. this.shadow.camera.far = e
  51716. }
  51717. },
  51718. shadowCameraVisible: {
  51719. set: function(e) {
  51720. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51721. }
  51722. },
  51723. shadowBias: {
  51724. set: function(e) {
  51725. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51726. this.shadow.bias = e
  51727. }
  51728. },
  51729. shadowDarkness: {
  51730. set: function(e) {
  51731. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51732. }
  51733. },
  51734. shadowMapWidth: {
  51735. set: function(e) {
  51736. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51737. this.shadow.mapSize.width = e
  51738. }
  51739. },
  51740. shadowMapHeight: {
  51741. set: function(e) {
  51742. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51743. this.shadow.mapSize.height = e
  51744. }
  51745. }
  51746. }),
  51747. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51748. length: {
  51749. get: function() {
  51750. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51751. this.array.length
  51752. }
  51753. }
  51754. }),
  51755. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51756. drawcalls: {
  51757. get: function() {
  51758. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51759. this.groups
  51760. }
  51761. },
  51762. offsets: {
  51763. get: function() {
  51764. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51765. this.groups
  51766. }
  51767. },
  51768. addIndex: {
  51769. value: function(e) {
  51770. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51771. this.setIndex(e)
  51772. }
  51773. },
  51774. addDrawCall: {
  51775. value: function(e, t, i) {
  51776. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51777. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51778. this.addGroup(e, t)
  51779. }
  51780. },
  51781. clearDrawCalls: {
  51782. value: function() {
  51783. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51784. this.clearGroups()
  51785. }
  51786. },
  51787. computeTangents: {
  51788. value: function() {
  51789. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51790. }
  51791. },
  51792. computeOffsets: {
  51793. value: function() {
  51794. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51795. }
  51796. }
  51797. }),
  51798. Object.defineProperties(Ci.Material.prototype, {
  51799. wrapAround: {
  51800. get: function() {
  51801. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51802. },
  51803. set: function(e) {
  51804. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51805. }
  51806. },
  51807. wrapRGB: {
  51808. get: function() {
  51809. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51810. new Ci.Color
  51811. }
  51812. }
  51813. }),
  51814. Object.defineProperties(Ci, {
  51815. PointCloudMaterial: {
  51816. value: function(e) {
  51817. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51818. new Ci.PointsMaterial(e)
  51819. }
  51820. },
  51821. ParticleBasicMaterial: {
  51822. value: function(e) {
  51823. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51824. new Ci.PointsMaterial(e)
  51825. }
  51826. },
  51827. ParticleSystemMaterial: {
  51828. value: function(e) {
  51829. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51830. new Ci.PointsMaterial(e)
  51831. }
  51832. }
  51833. }),
  51834. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51835. metal: {
  51836. get: function() {
  51837. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51838. !1
  51839. },
  51840. set: function(e) {
  51841. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51842. }
  51843. }
  51844. }),
  51845. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51846. derivatives: {
  51847. get: function() {
  51848. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51849. this.extensions.derivatives
  51850. },
  51851. set: function(e) {
  51852. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51853. this.extensions.derivatives = e
  51854. }
  51855. }
  51856. }),
  51857. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51858. supportsFloatTextures: {
  51859. value: function() {
  51860. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51861. this.extensions.get("OES_texture_float")
  51862. }
  51863. },
  51864. supportsHalfFloatTextures: {
  51865. value: function() {
  51866. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51867. this.extensions.get("OES_texture_half_float")
  51868. }
  51869. },
  51870. supportsStandardDerivatives: {
  51871. value: function() {
  51872. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51873. this.extensions.get("OES_standard_derivatives")
  51874. }
  51875. },
  51876. supportsCompressedTextureS3TC: {
  51877. value: function() {
  51878. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51879. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51880. }
  51881. },
  51882. supportsCompressedTexturePVRTC: {
  51883. value: function() {
  51884. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51885. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51886. }
  51887. },
  51888. supportsBlendMinMax: {
  51889. value: function() {
  51890. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51891. this.extensions.get("EXT_blend_minmax")
  51892. }
  51893. },
  51894. supportsVertexTextures: {
  51895. value: function() {
  51896. return this.capabilities.vertexTextures
  51897. }
  51898. },
  51899. supportsInstancedArrays: {
  51900. value: function() {
  51901. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51902. this.extensions.get("ANGLE_instanced_arrays")
  51903. }
  51904. },
  51905. enableScissorTest: {
  51906. value: function(e) {
  51907. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51908. this.setScissorTest(e)
  51909. }
  51910. },
  51911. initMaterial: {
  51912. value: function() {
  51913. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51914. }
  51915. },
  51916. addPrePlugin: {
  51917. value: function() {
  51918. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51919. }
  51920. },
  51921. addPostPlugin: {
  51922. value: function() {
  51923. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51924. }
  51925. },
  51926. updateShadowMap: {
  51927. value: function() {
  51928. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51929. }
  51930. },
  51931. shadowMapEnabled: {
  51932. get: function() {
  51933. return this.shadowMap.enabled
  51934. },
  51935. set: function(e) {
  51936. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51937. this.shadowMap.enabled = e
  51938. }
  51939. },
  51940. shadowMapType: {
  51941. get: function() {
  51942. return this.shadowMap.type
  51943. },
  51944. set: function(e) {
  51945. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51946. this.shadowMap.type = e
  51947. }
  51948. },
  51949. shadowMapCullFace: {
  51950. get: function() {
  51951. return this.shadowMap.cullFace
  51952. },
  51953. set: function(e) {
  51954. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51955. this.shadowMap.cullFace = e
  51956. }
  51957. }
  51958. }),
  51959. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51960. wrapS: {
  51961. get: function() {
  51962. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51963. this.texture.wrapS
  51964. },
  51965. set: function(e) {
  51966. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51967. this.texture.wrapS = e
  51968. }
  51969. },
  51970. wrapT: {
  51971. get: function() {
  51972. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51973. this.texture.wrapT
  51974. },
  51975. set: function(e) {
  51976. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51977. this.texture.wrapT = e
  51978. }
  51979. },
  51980. magFilter: {
  51981. get: function() {
  51982. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51983. this.texture.magFilter
  51984. },
  51985. set: function(e) {
  51986. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51987. this.texture.magFilter = e
  51988. }
  51989. },
  51990. minFilter: {
  51991. get: function() {
  51992. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51993. this.texture.minFilter
  51994. },
  51995. set: function(e) {
  51996. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51997. this.texture.minFilter = e
  51998. }
  51999. },
  52000. anisotropy: {
  52001. get: function() {
  52002. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52003. this.texture.anisotropy
  52004. },
  52005. set: function(e) {
  52006. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52007. this.texture.anisotropy = e
  52008. }
  52009. },
  52010. offset: {
  52011. get: function() {
  52012. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52013. this.texture.offset
  52014. },
  52015. set: function(e) {
  52016. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52017. this.texture.offset = e
  52018. }
  52019. },
  52020. repeat: {
  52021. get: function() {
  52022. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52023. this.texture.repeat
  52024. },
  52025. set: function(e) {
  52026. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52027. this.texture.repeat = e
  52028. }
  52029. },
  52030. format: {
  52031. get: function() {
  52032. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52033. this.texture.format
  52034. },
  52035. set: function(e) {
  52036. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52037. this.texture.format = e
  52038. }
  52039. },
  52040. type: {
  52041. get: function() {
  52042. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52043. this.texture.type
  52044. },
  52045. set: function(e) {
  52046. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52047. this.texture.type = e
  52048. }
  52049. },
  52050. generateMipmaps: {
  52051. get: function() {
  52052. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52053. this.texture.generateMipmaps
  52054. },
  52055. set: function(e) {
  52056. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52057. this.texture.generateMipmaps = e
  52058. }
  52059. }
  52060. }),
  52061. Ci.GeometryUtils = {
  52062. merge: function(e, t, i) {
  52063. var n;
  52064. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  52065. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52066. n = t.matrix,
  52067. t = t.geometry),
  52068. e.merge(t, n, i)
  52069. },
  52070. center: function(e) {
  52071. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52072. e.center()
  52073. }
  52074. },
  52075. Ci.ImageUtils = {
  52076. crossOrigin: void 0,
  52077. loadTexture: function(e, t, i, n) {
  52078. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52079. var r = new Ci.TextureLoader;
  52080. r.setCrossOrigin(this.crossOrigin);
  52081. var o = r.load(e, i, void 0, n);
  52082. return t && (o.mapping = t),
  52083. o
  52084. },
  52085. loadTextureCube: function(e, t, i, n) {
  52086. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52087. var r = new Ci.CubeTextureLoader;
  52088. r.setCrossOrigin(this.crossOrigin);
  52089. var o = r.load(e, i, void 0, n);
  52090. return t && (o.mapping = t),
  52091. o
  52092. },
  52093. loadCompressedTexture: function() {
  52094. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52095. },
  52096. loadCompressedTextureCube: function() {
  52097. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52098. }
  52099. },
  52100. Ci.Projector = function() {
  52101. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52102. this.projectVector = function(e, t) {
  52103. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52104. e.project(t)
  52105. }
  52106. ,
  52107. this.unprojectVector = function(e, t) {
  52108. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52109. e.unproject(t)
  52110. }
  52111. ,
  52112. this.pickingRay = function(e, t) {
  52113. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52114. }
  52115. }
  52116. ,
  52117. Ci.CanvasRenderer = function() {
  52118. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52119. this.domElement = document.createElement("canvas"),
  52120. this.clear = function() {}
  52121. ,
  52122. this.render = function() {}
  52123. ,
  52124. this.setClearColor = function() {}
  52125. ,
  52126. this.setSize = function() {}
  52127. }
  52128. ,
  52129. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  52130. Ci.CurveUtils = {
  52131. tangentQuadraticBezier: function(e, t, i, n) {
  52132. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52133. },
  52134. tangentCubicBezier: function(e, t, i, n, r) {
  52135. 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
  52136. },
  52137. tangentSpline: function(e, t, i, n, r) {
  52138. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  52139. },
  52140. interpolate: function(e, t, i, n, r) {
  52141. var o = .5 * (i - e)
  52142. , a = .5 * (n - t)
  52143. , s = r * r;
  52144. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52145. }
  52146. },
  52147. Ci.SceneUtils = {
  52148. createMultiMaterialObject: function(e, t) {
  52149. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  52150. i.add(new Ci.Mesh(e,t[n]));
  52151. return i
  52152. },
  52153. detach: function(e, t, i) {
  52154. e.applyMatrix(t.matrixWorld),
  52155. t.remove(e),
  52156. i.add(e)
  52157. },
  52158. attach: function(e, t, i) {
  52159. var n = new Ci.Matrix4;
  52160. n.getInverse(i.matrixWorld),
  52161. e.applyMatrix(n),
  52162. t.remove(e),
  52163. i.add(e)
  52164. }
  52165. },
  52166. Ci.ShapeUtils = {
  52167. area: function(e) {
  52168. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52169. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52170. return .5 * i
  52171. },
  52172. triangulate: function(e, t) {
  52173. var i = e.length;
  52174. if (i < 3)
  52175. return null;
  52176. var n, r, o, a = [], s = [], l = [];
  52177. if (0 < Ci.ShapeUtils.area(e))
  52178. for (r = 0; r < i; r++)
  52179. s[r] = r;
  52180. else
  52181. for (r = 0; r < i; r++)
  52182. s[r] = i - 1 - r;
  52183. var c = i
  52184. , h = 2 * c;
  52185. for (r = c - 1; 2 < c; ) {
  52186. if (h-- <= 0)
  52187. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52188. t ? l : a;
  52189. if (c <= (n = r) && (n = 0),
  52190. c <= (r = n + 1) && (r = 0),
  52191. c <= (o = r + 1) && (o = 0),
  52192. Si(e, n, r, o, c, s)) {
  52193. var u, d, p, f, g;
  52194. for (u = s[n],
  52195. d = s[r],
  52196. p = s[o],
  52197. a.push([e[u], e[d], e[p]]),
  52198. l.push([s[n], s[r], s[o]]),
  52199. g = (f = r) + 1; g < c; f++,
  52200. g++)
  52201. s[f] = s[g];
  52202. h = 2 * --c
  52203. }
  52204. }
  52205. return t ? l : a
  52206. },
  52207. triangulateShape: function(e, t) {
  52208. function w(e, t, i) {
  52209. 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
  52210. }
  52211. function b(e, t, i, n, r) {
  52212. var o = t.x - e.x
  52213. , a = t.y - e.y
  52214. , s = n.x - i.x
  52215. , l = n.y - i.y
  52216. , c = e.x - i.x
  52217. , h = e.y - i.y
  52218. , u = a * s - o * l
  52219. , d = a * c - o * h;
  52220. if (Math.abs(u) > Number.EPSILON) {
  52221. var p;
  52222. if (0 < u) {
  52223. if (d < 0 || u < d)
  52224. return [];
  52225. if ((p = l * c - s * h) < 0 || u < p)
  52226. return []
  52227. } else {
  52228. if (0 < d || d < u)
  52229. return [];
  52230. if (0 < (p = l * c - s * h) || p < u)
  52231. return []
  52232. }
  52233. if (0 === p)
  52234. return !r || 0 != d && d != u ? [e] : [];
  52235. if (p === u)
  52236. return !r || 0 != d && d != u ? [t] : [];
  52237. if (0 == d)
  52238. return [i];
  52239. if (d == u)
  52240. return [n];
  52241. var f = p / u;
  52242. return [{
  52243. x: e.x + f * o,
  52244. y: e.y + f * a
  52245. }]
  52246. }
  52247. if (0 != d || l * c != s * h)
  52248. return [];
  52249. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52250. 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,
  52251. (m = t).x) : (v = (g = t).x,
  52252. (m = e).x),
  52253. i.x < n.x ? (I = (A = i).x,
  52254. (C = n).x) : (I = (A = n).x,
  52255. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52256. (m = t).y) : (v = (g = t).y,
  52257. (m = e).y),
  52258. i.y < n.y ? (I = (A = i).y,
  52259. (C = n).y) : (I = (A = n).y,
  52260. (C = i).y)),
  52261. 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])
  52262. }
  52263. function T(e, t, i, n) {
  52264. var r = t.x - e.x
  52265. , o = t.y - e.y
  52266. , a = i.x - e.x
  52267. , s = i.y - e.y
  52268. , l = n.x - e.x
  52269. , c = n.y - e.y
  52270. , h = r * s - o * a
  52271. , u = r * c - o * l;
  52272. if (Math.abs(h) > Number.EPSILON) {
  52273. var d = l * s - c * a;
  52274. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52275. }
  52276. return 0 < u
  52277. }
  52278. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52279. Array.prototype.push.apply(c, t[h]);
  52280. for (i = 0,
  52281. n = c.length; i < n; i++)
  52282. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52283. l[a] = i;
  52284. var d = function(e, a) {
  52285. function t(e, t) {
  52286. var i = m.length - 1
  52287. , n = e - 1;
  52288. n < 0 && (n = i);
  52289. var r = e + 1;
  52290. i < r && (r = 0);
  52291. var o = T(m[e], m[n], m[r], c[t]);
  52292. if (!o)
  52293. return !1;
  52294. var a = c.length - 1
  52295. , s = t - 1;
  52296. s < 0 && (s = a);
  52297. var l = t + 1;
  52298. return a < l && (l = 0),
  52299. !!(o = T(c[t], c[s], c[l], m[e]))
  52300. }
  52301. function i(e, t) {
  52302. var i, n;
  52303. for (i = 0; i < m.length; i++)
  52304. if (n = i + 1,
  52305. n %= m.length,
  52306. 0 < b(e, t, m[i], m[n], !0).length)
  52307. return !0;
  52308. return !1
  52309. }
  52310. function n(e, t) {
  52311. var i, n, r, o;
  52312. for (i = 0; i < v.length; i++)
  52313. for (n = a[v[i]],
  52314. r = 0; r < n.length; r++)
  52315. if (o = r + 1,
  52316. o %= n.length,
  52317. 0 < b(e, t, n[r], n[o], !0).length)
  52318. return !0;
  52319. return !1
  52320. }
  52321. 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++)
  52322. v.push(A);
  52323. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52324. if (--E < 0) {
  52325. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52326. break
  52327. }
  52328. for (o = I; o < m.length; o++) {
  52329. s = m[o],
  52330. r = -1;
  52331. for (A = 0; A < v.length; A++)
  52332. if (h = v[A],
  52333. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52334. c = a[h];
  52335. for (var _ = 0; _ < c.length; _++)
  52336. if (l = c[_],
  52337. t(o, _) && !i(s, l) && !n(s, l)) {
  52338. r = _,
  52339. v.splice(A, 1),
  52340. d = m.slice(0, o + 1),
  52341. p = m.slice(o),
  52342. f = c.slice(r),
  52343. g = c.slice(0, r + 1),
  52344. m = d.concat(f).concat(g).concat(p),
  52345. I = o;
  52346. break
  52347. }
  52348. if (0 <= r)
  52349. break;
  52350. y[u] = !0
  52351. }
  52352. if (0 <= r)
  52353. break
  52354. }
  52355. }
  52356. return m
  52357. }(e, t)
  52358. , p = Ci.ShapeUtils.triangulate(d, !1);
  52359. for (i = 0,
  52360. n = p.length; i < n; i++)
  52361. for (o = p[i],
  52362. r = 0; r < 3; r++)
  52363. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52364. return p.concat()
  52365. },
  52366. isClockWise: function(e) {
  52367. return Ci.ShapeUtils.area(e) < 0
  52368. },
  52369. b2: function(e, t, i, n) {
  52370. return function(e, t) {
  52371. var i = 1 - e;
  52372. return i * i * t
  52373. }(e, t) + function(e, t) {
  52374. return 2 * (1 - e) * e * t
  52375. }(e, i) + function(e, t) {
  52376. return e * e * t
  52377. }(e, n)
  52378. },
  52379. b3: function(e, t, i, n, r) {
  52380. return function(e, t) {
  52381. var i = 1 - e;
  52382. return i * i * i * t
  52383. }(e, t) + function(e, t) {
  52384. var i = 1 - e;
  52385. return 3 * i * i * e * t
  52386. }(e, i) + function(e, t) {
  52387. return 3 * (1 - e) * e * e * t
  52388. }(e, n) + function(e, t) {
  52389. return e * e * e * t
  52390. }(e, r)
  52391. }
  52392. },
  52393. Ci.Curve = function() {}
  52394. ,
  52395. Ci.Curve.prototype = {
  52396. constructor: Ci.Curve,
  52397. getPoint: function(e) {
  52398. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52399. null
  52400. },
  52401. getPointAt: function(e) {
  52402. var t = this.getUtoTmapping(e);
  52403. return this.getPoint(t)
  52404. },
  52405. getPoints: function(e) {
  52406. e = e || 5;
  52407. var t, i = [];
  52408. for (t = 0; t <= e; t++)
  52409. i.push(this.getPoint(t / e));
  52410. return i
  52411. },
  52412. getSpacedPoints: function(e) {
  52413. e = e || 5;
  52414. var t, i = [];
  52415. for (t = 0; t <= e; t++)
  52416. i.push(this.getPointAt(t / e));
  52417. return i
  52418. },
  52419. getLength: function() {
  52420. var e = this.getLengths();
  52421. return e[e.length - 1]
  52422. },
  52423. getLengths: function(e) {
  52424. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52425. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52426. return this.cacheArcLengths;
  52427. this.needsUpdate = !1;
  52428. var t, i, n = [], r = this.getPoint(0), o = 0;
  52429. for (n.push(0),
  52430. i = 1; i <= e; i++)
  52431. o += (t = this.getPoint(i / e)).distanceTo(r),
  52432. n.push(o),
  52433. r = t;
  52434. return this.cacheArcLengths = n
  52435. },
  52436. updateArcLengths: function() {
  52437. this.needsUpdate = !0,
  52438. this.getLengths()
  52439. },
  52440. getUtoTmapping: function(e, t) {
  52441. var i, n = this.getLengths(), r = 0, o = n.length;
  52442. i = t || e * n[o - 1];
  52443. for (var a, s = 0, l = o - 1; s <= l; )
  52444. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52445. s = r + 1;
  52446. else {
  52447. if (!(0 < a)) {
  52448. l = r;
  52449. break
  52450. }
  52451. l = r - 1
  52452. }
  52453. if (n[r = l] === i)
  52454. return r / (o - 1);
  52455. var c = n[r];
  52456. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52457. },
  52458. getTangent: function(e) {
  52459. var t = e - 1e-4
  52460. , i = e + 1e-4;
  52461. t < 0 && (t = 0),
  52462. 1 < i && (i = 1);
  52463. var n = this.getPoint(t);
  52464. return this.getPoint(i).clone().sub(n).normalize()
  52465. },
  52466. getTangentAt: function(e) {
  52467. var t = this.getUtoTmapping(e);
  52468. return this.getTangent(t)
  52469. }
  52470. },
  52471. Ci.Curve.create = function(e, t) {
  52472. return e.prototype = Object.create(Ci.Curve.prototype),
  52473. (e.prototype.constructor = e).prototype.getPoint = t,
  52474. e
  52475. }
  52476. ,
  52477. Ci.CurvePath = function() {
  52478. this.curves = [],
  52479. this.autoClose = !1
  52480. }
  52481. ,
  52482. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52483. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52484. Ci.CurvePath.prototype.add = function(e) {
  52485. this.curves.push(e)
  52486. }
  52487. ,
  52488. Ci.CurvePath.prototype.closePath = function() {
  52489. var e = this.curves[0].getPoint(0)
  52490. , t = this.curves[this.curves.length - 1].getPoint(1);
  52491. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52492. }
  52493. ,
  52494. Ci.CurvePath.prototype.getPoint = function(e) {
  52495. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52496. if (i[n] >= t) {
  52497. var r = i[n] - t
  52498. , o = this.curves[n]
  52499. , a = 1 - r / o.getLength();
  52500. return o.getPointAt(a)
  52501. }
  52502. n++
  52503. }
  52504. return null
  52505. }
  52506. ,
  52507. Ci.CurvePath.prototype.getLength = function() {
  52508. var e = this.getCurveLengths();
  52509. return e[e.length - 1]
  52510. }
  52511. ,
  52512. Ci.CurvePath.prototype.getCurveLengths = function() {
  52513. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52514. return this.cacheLengths;
  52515. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52516. t += this.curves[i].getLength(),
  52517. e.push(t);
  52518. return this.cacheLengths = e
  52519. }
  52520. ,
  52521. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52522. var t = this.getPoints(e);
  52523. return this.createGeometry(t)
  52524. }
  52525. ,
  52526. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52527. var t = this.getSpacedPoints(e);
  52528. return this.createGeometry(t)
  52529. }
  52530. ,
  52531. Ci.CurvePath.prototype.createGeometry = function(e) {
  52532. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52533. var r = e[i];
  52534. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52535. }
  52536. return t
  52537. }
  52538. ,
  52539. Ci.Font = function(e) {
  52540. this.data = e
  52541. }
  52542. ,
  52543. Ci.Font.prototype = {
  52544. constructor: Ci.Font,
  52545. generateShapes: function(e, s, b) {
  52546. function l(e, t, i) {
  52547. var n = w.glyphs[e] || w.glyphs["?"];
  52548. if (n) {
  52549. 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;
  52550. if (n.o)
  52551. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52552. switch (A[C++]) {
  52553. case "m":
  52554. r = A[C++] * t + i,
  52555. o = A[C++] * t,
  52556. g.moveTo(r, o);
  52557. break;
  52558. case "l":
  52559. r = A[C++] * t + i,
  52560. o = A[C++] * t,
  52561. g.lineTo(r, o);
  52562. break;
  52563. case "q":
  52564. if (a = A[C++] * t + i,
  52565. s = A[C++] * t,
  52566. h = A[C++] * t + i,
  52567. u = A[C++] * t,
  52568. g.quadraticCurveTo(h, u, a, s),
  52569. f = m[m.length - 1]) {
  52570. l = f.x,
  52571. c = f.y;
  52572. for (var E = 1; E <= b; E++) {
  52573. v(_ = E / b, l, h, a),
  52574. v(_, c, u, s)
  52575. }
  52576. }
  52577. break;
  52578. case "b":
  52579. if (a = A[C++] * t + i,
  52580. s = A[C++] * t,
  52581. h = A[C++] * t + i,
  52582. u = A[C++] * t,
  52583. d = A[C++] * t + i,
  52584. p = A[C++] * t,
  52585. g.bezierCurveTo(h, u, d, p, a, s),
  52586. f = m[m.length - 1]) {
  52587. l = f.x,
  52588. c = f.y;
  52589. for (E = 1; E <= b; E++) {
  52590. var _;
  52591. y(_ = E / b, l, h, d, a),
  52592. y(_, c, u, p, s)
  52593. }
  52594. }
  52595. }
  52596. }
  52597. return {
  52598. offset: n.ha * t,
  52599. path: g
  52600. }
  52601. }
  52602. }
  52603. void 0 === s && (s = 100),
  52604. void 0 === b && (b = 4);
  52605. for (var w = this.data, t = function(e) {
  52606. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52607. var a = l(t[o], i, n);
  52608. n += a.offset,
  52609. r.push(a.path)
  52610. }
  52611. return r
  52612. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52613. Array.prototype.push.apply(i, t[n].toShapes());
  52614. return i
  52615. }
  52616. },
  52617. Ci.Path = function(e) {
  52618. Ci.CurvePath.call(this),
  52619. this.actions = [],
  52620. e && this.fromPoints(e)
  52621. }
  52622. ,
  52623. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52624. Ci.Path.prototype.constructor = Ci.Path,
  52625. Ci.Path.prototype.fromPoints = function(e) {
  52626. this.moveTo(e[0].x, e[0].y);
  52627. for (var t = 1, i = e.length; t < i; t++)
  52628. this.lineTo(e[t].x, e[t].y)
  52629. }
  52630. ,
  52631. Ci.Path.prototype.moveTo = function(e, t) {
  52632. this.actions.push({
  52633. action: "moveTo",
  52634. args: [e, t]
  52635. })
  52636. }
  52637. ,
  52638. Ci.Path.prototype.lineTo = function(e, t) {
  52639. var i = this.actions[this.actions.length - 1].args
  52640. , n = i[i.length - 2]
  52641. , r = i[i.length - 1]
  52642. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52643. this.curves.push(o),
  52644. this.actions.push({
  52645. action: "lineTo",
  52646. args: [e, t]
  52647. })
  52648. }
  52649. ,
  52650. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52651. var r = this.actions[this.actions.length - 1].args
  52652. , o = r[r.length - 2]
  52653. , a = r[r.length - 1]
  52654. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52655. this.curves.push(s),
  52656. this.actions.push({
  52657. action: "quadraticCurveTo",
  52658. args: [e, t, i, n]
  52659. })
  52660. }
  52661. ,
  52662. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52663. var a = this.actions[this.actions.length - 1].args
  52664. , s = a[a.length - 2]
  52665. , l = a[a.length - 1]
  52666. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52667. this.curves.push(c),
  52668. this.actions.push({
  52669. action: "bezierCurveTo",
  52670. args: [e, t, i, n, r, o]
  52671. })
  52672. }
  52673. ,
  52674. Ci.Path.prototype.splineThru = function(e) {
  52675. var t = Array.prototype.slice.call(arguments)
  52676. , i = this.actions[this.actions.length - 1].args
  52677. , n = i[i.length - 2]
  52678. , r = i[i.length - 1]
  52679. , o = [new Ci.Vector2(n,r)];
  52680. Array.prototype.push.apply(o, e);
  52681. var a = new Ci.SplineCurve(o);
  52682. this.curves.push(a),
  52683. this.actions.push({
  52684. action: "splineThru",
  52685. args: t
  52686. })
  52687. }
  52688. ,
  52689. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52690. var a = this.actions[this.actions.length - 1].args
  52691. , s = a[a.length - 2]
  52692. , l = a[a.length - 1];
  52693. this.absarc(e + s, t + l, i, n, r, o)
  52694. }
  52695. ,
  52696. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52697. this.absellipse(e, t, i, i, n, r, o)
  52698. }
  52699. ,
  52700. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52701. var l = this.actions[this.actions.length - 1].args
  52702. , c = l[l.length - 2]
  52703. , h = l[l.length - 1];
  52704. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52705. }
  52706. ,
  52707. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52708. var l = [e, t, i, n, r, o, a, s || 0]
  52709. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52710. this.curves.push(c);
  52711. var h = c.getPoint(1);
  52712. l.push(h.x),
  52713. l.push(h.y),
  52714. this.actions.push({
  52715. action: "ellipse",
  52716. args: l
  52717. })
  52718. }
  52719. ,
  52720. Ci.Path.prototype.getSpacedPoints = function(e) {
  52721. e = e || 40;
  52722. for (var t = [], i = 0; i < e; i++)
  52723. t.push(this.getPoint(i / e));
  52724. return this.autoClose && t.push(t[0]),
  52725. t
  52726. }
  52727. ,
  52728. Ci.Path.prototype.getPoints = function(e) {
  52729. e = e || 12;
  52730. 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++) {
  52731. var v = this.actions[g]
  52732. , y = v.action
  52733. , A = v.args;
  52734. switch (y) {
  52735. case "moveTo":
  52736. case "lineTo":
  52737. f.push(new Ci.Vector2(A[0],A[1]));
  52738. break;
  52739. case "quadraticCurveTo":
  52740. t = A[2],
  52741. i = A[3],
  52742. o = A[0],
  52743. a = A[1],
  52744. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52745. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52746. c[c.length - 1]);
  52747. for (var C = 1; C <= e; C++) {
  52748. h = d(O = C / e, s, o, t),
  52749. u = d(O, l, a, i),
  52750. f.push(new Ci.Vector2(h,u))
  52751. }
  52752. break;
  52753. case "bezierCurveTo":
  52754. t = A[4],
  52755. i = A[5],
  52756. o = A[0],
  52757. a = A[1],
  52758. n = A[2],
  52759. r = A[3],
  52760. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52761. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52762. c[c.length - 1]);
  52763. for (C = 1; C <= e; C++) {
  52764. h = p(O = C / e, s, o, n, t),
  52765. u = p(O, l, a, r, i),
  52766. f.push(new Ci.Vector2(h,u))
  52767. }
  52768. break;
  52769. case "splineThru":
  52770. c = this.actions[g - 1].args;
  52771. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52772. , E = e * A[0].length;
  52773. I = I.concat(A[0]);
  52774. var _ = new Ci.SplineCurve(I);
  52775. for (C = 1; C <= E; C++)
  52776. f.push(_.getPointAt(C / E));
  52777. break;
  52778. case "arc":
  52779. var b = A[0]
  52780. , w = A[1]
  52781. , T = A[2]
  52782. , x = A[3]
  52783. , S = A[4]
  52784. , M = !!A[5]
  52785. , R = S - x
  52786. , P = 2 * e;
  52787. for (C = 1; C <= P; C++) {
  52788. var O = C / P;
  52789. M || (O = 1 - O),
  52790. L = x + O * R,
  52791. h = b + T * Math.cos(L),
  52792. u = w + T * Math.sin(L),
  52793. f.push(new Ci.Vector2(h,u))
  52794. }
  52795. break;
  52796. case "ellipse":
  52797. b = A[0],
  52798. w = A[1];
  52799. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52800. S = A[5],
  52801. M = !!A[6],
  52802. A[7]);
  52803. R = S - x,
  52804. P = 2 * e;
  52805. 0 !== V && (D = Math.cos(V),
  52806. N = Math.sin(V));
  52807. for (C = 1; C <= P; C++) {
  52808. O = C / P;
  52809. if (M || (O = 1 - O),
  52810. L = x + O * R,
  52811. h = b + F * Math.cos(L),
  52812. u = w + B * Math.sin(L),
  52813. 0 !== V) {
  52814. var k = h;
  52815. h = (k - b) * D - (u - w) * N + b,
  52816. u = (k - b) * N + (u - w) * D + w
  52817. }
  52818. f.push(new Ci.Vector2(h,u))
  52819. }
  52820. }
  52821. }
  52822. var U = f[f.length - 1];
  52823. 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),
  52824. this.autoClose && f.push(f[0]),
  52825. f
  52826. }
  52827. ,
  52828. Ci.Path.prototype.toShapes = function(e, t) {
  52829. function i(e) {
  52830. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52831. var r = e[i]
  52832. , o = new Ci.Shape;
  52833. o.actions = r.actions,
  52834. o.curves = r.curves,
  52835. t.push(o)
  52836. }
  52837. return t
  52838. }
  52839. function n(e, t) {
  52840. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52841. var a = t[r]
  52842. , s = t[o]
  52843. , l = s.x - a.x
  52844. , c = s.y - a.y;
  52845. if (Math.abs(c) > Number.EPSILON) {
  52846. if (c < 0 && (a = t[o],
  52847. l = -l,
  52848. s = t[r],
  52849. c = -c),
  52850. e.y < a.y || e.y > s.y)
  52851. continue;
  52852. if (e.y === a.y) {
  52853. if (e.x === a.x)
  52854. return !0
  52855. } else {
  52856. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52857. if (0 == h)
  52858. return !0;
  52859. if (h < 0)
  52860. continue;
  52861. n = !n
  52862. }
  52863. } else {
  52864. if (e.y !== a.y)
  52865. continue;
  52866. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52867. return !0
  52868. }
  52869. }
  52870. return n
  52871. }
  52872. var r = Ci.ShapeUtils.isClockWise
  52873. , o = function(e) {
  52874. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52875. var o = e[n]
  52876. , a = o.args
  52877. , s = o.action;
  52878. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52879. i = new Ci.Path),
  52880. i[s].apply(i, a)
  52881. }
  52882. return 0 !== i.actions.length && t.push(i),
  52883. t
  52884. }(this.actions);
  52885. if (0 === o.length)
  52886. return [];
  52887. if (!0 === t)
  52888. return i(o);
  52889. var a, s, l, c = [];
  52890. if (1 === o.length)
  52891. return s = o[0],
  52892. (l = new Ci.Shape).actions = s.actions,
  52893. l.curves = s.curves,
  52894. c.push(l),
  52895. c;
  52896. var h = !r(o[0].getPoints());
  52897. h = e ? !h : h;
  52898. var u, d = [], p = [], f = [], g = 0;
  52899. p[g] = void 0,
  52900. f[g] = [];
  52901. for (var m = 0, v = o.length; m < v; m++)
  52902. a = r(u = (s = o[m]).getPoints()),
  52903. (a = e ? !a : a) ? (!h && p[g] && g++,
  52904. p[g] = {
  52905. s: new Ci.Shape,
  52906. p: u
  52907. },
  52908. p[g].s.actions = s.actions,
  52909. p[g].s.curves = s.curves,
  52910. h && g++,
  52911. f[g] = []) : f[g].push({
  52912. h: s,
  52913. p: u[0]
  52914. });
  52915. if (!p[0])
  52916. return i(o);
  52917. if (1 < p.length) {
  52918. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52919. d[C] = [];
  52920. for (C = 0,
  52921. I = p.length; C < I; C++)
  52922. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52923. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52924. n(b.p, p[T].p) && (C !== T && A.push({
  52925. froms: C,
  52926. tos: T,
  52927. hole: _
  52928. }),
  52929. w ? (w = !1,
  52930. d[T].push(b)) : y = !0);
  52931. w && d[C].push(b)
  52932. }
  52933. 0 < A.length && (y || (f = d))
  52934. }
  52935. m = 0;
  52936. for (var x, S = p.length; m < S; m++) {
  52937. l = p[m].s,
  52938. c.push(l);
  52939. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52940. l.holes.push(x[M].h)
  52941. }
  52942. return c
  52943. }
  52944. ,
  52945. Ci.Shape = function() {
  52946. Ci.Path.apply(this, arguments),
  52947. this.holes = []
  52948. }
  52949. ,
  52950. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52951. Ci.Shape.prototype.constructor = Ci.Shape,
  52952. Ci.Shape.prototype.extrude = function(e) {
  52953. return new Ci.ExtrudeGeometry(this,e)
  52954. }
  52955. ,
  52956. Ci.Shape.prototype.makeGeometry = function(e) {
  52957. return new Ci.ShapeGeometry(this,e)
  52958. }
  52959. ,
  52960. Ci.Shape.prototype.getPointsHoles = function(e) {
  52961. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52962. t[i] = this.holes[i].getPoints(e);
  52963. return t
  52964. }
  52965. ,
  52966. Ci.Shape.prototype.extractAllPoints = function(e) {
  52967. return {
  52968. shape: this.getPoints(e),
  52969. holes: this.getPointsHoles(e)
  52970. }
  52971. }
  52972. ,
  52973. Ci.Shape.prototype.extractPoints = function(e) {
  52974. return this.extractAllPoints(e)
  52975. }
  52976. ,
  52977. Ci.LineCurve = function(e, t) {
  52978. this.v1 = e,
  52979. this.v2 = t
  52980. }
  52981. ,
  52982. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52983. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52984. Ci.LineCurve.prototype.getPoint = function(e) {
  52985. var t = this.v2.clone().sub(this.v1);
  52986. return t.multiplyScalar(e).add(this.v1),
  52987. t
  52988. }
  52989. ,
  52990. Ci.LineCurve.prototype.getPointAt = function(e) {
  52991. return this.getPoint(e)
  52992. }
  52993. ,
  52994. Ci.LineCurve.prototype.getTangent = function(e) {
  52995. return this.v2.clone().sub(this.v1).normalize()
  52996. }
  52997. ,
  52998. Ci.QuadraticBezierCurve = function(e, t, i) {
  52999. this.v0 = e,
  53000. this.v1 = t,
  53001. this.v2 = i
  53002. }
  53003. ,
  53004. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53005. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  53006. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53007. var t = Ci.ShapeUtils.b2;
  53008. 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))
  53009. }
  53010. ,
  53011. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53012. var t = Ci.CurveUtils.tangentQuadraticBezier;
  53013. 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()
  53014. }
  53015. ,
  53016. Ci.CubicBezierCurve = function(e, t, i, n) {
  53017. this.v0 = e,
  53018. this.v1 = t,
  53019. this.v2 = i,
  53020. this.v3 = n
  53021. }
  53022. ,
  53023. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53024. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  53025. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  53026. var t = Ci.ShapeUtils.b3;
  53027. 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))
  53028. }
  53029. ,
  53030. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  53031. var t = Ci.CurveUtils.tangentCubicBezier;
  53032. 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()
  53033. }
  53034. ,
  53035. Ci.SplineCurve = function(e) {
  53036. this.points = null == e ? [] : e
  53037. }
  53038. ,
  53039. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  53040. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  53041. Ci.SplineCurve.prototype.getPoint = function(e) {
  53042. var t = this.points
  53043. , i = (t.length - 1) * e
  53044. , n = Math.floor(i)
  53045. , r = i - n
  53046. , o = t[0 === n ? n : n - 1]
  53047. , a = t[n]
  53048. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53049. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53050. , c = Ci.CurveUtils.interpolate;
  53051. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  53052. }
  53053. ,
  53054. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53055. this.aX = e,
  53056. this.aY = t,
  53057. this.xRadius = i,
  53058. this.yRadius = n,
  53059. this.aStartAngle = r,
  53060. this.aEndAngle = o,
  53061. this.aClockwise = a,
  53062. this.aRotation = s || 0
  53063. }
  53064. ,
  53065. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  53066. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  53067. Ci.EllipseCurve.prototype.getPoint = function(e) {
  53068. var t, i = this.aEndAngle - this.aStartAngle;
  53069. i < 0 && (i += 2 * Math.PI),
  53070. i > 2 * Math.PI && (i -= 2 * Math.PI),
  53071. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  53072. var n = this.aX + this.xRadius * Math.cos(t)
  53073. , r = this.aY + this.yRadius * Math.sin(t);
  53074. if (0 !== this.aRotation) {
  53075. var o = Math.cos(this.aRotation)
  53076. , a = Math.sin(this.aRotation)
  53077. , s = n
  53078. , l = r;
  53079. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  53080. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  53081. }
  53082. return new Ci.Vector2(n,r)
  53083. }
  53084. ,
  53085. Ci.ArcCurve = function(e, t, i, n, r, o) {
  53086. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  53087. }
  53088. ,
  53089. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  53090. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  53091. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  53092. this.v1 = e,
  53093. this.v2 = t
  53094. }, function(e) {
  53095. var t = new Ci.Vector3;
  53096. return t.subVectors(this.v2, this.v1),
  53097. t.multiplyScalar(e),
  53098. t.add(this.v1),
  53099. t
  53100. }),
  53101. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  53102. this.v0 = e,
  53103. this.v1 = t,
  53104. this.v2 = i
  53105. }, function(e) {
  53106. var t = Ci.ShapeUtils.b2;
  53107. 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))
  53108. }),
  53109. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  53110. this.v0 = e,
  53111. this.v1 = t,
  53112. this.v2 = i,
  53113. this.v3 = n
  53114. }, function(e) {
  53115. var t = Ci.ShapeUtils.b3;
  53116. 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))
  53117. }),
  53118. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  53119. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53120. this.points = null == e ? [] : e
  53121. }, function(e) {
  53122. var t = this.points
  53123. , i = (t.length - 1) * e
  53124. , n = Math.floor(i)
  53125. , r = i - n
  53126. , o = t[0 == n ? n : n - 1]
  53127. , a = t[n]
  53128. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53129. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53130. , c = Ci.CurveUtils.interpolate;
  53131. 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))
  53132. }),
  53133. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  53134. Xt = new xi,
  53135. Zt = new xi,
  53136. Kt = new xi,
  53137. xi.prototype.init = function(e, t, i, n) {
  53138. this.c0 = e,
  53139. this.c1 = i,
  53140. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53141. this.c3 = 2 * e - 2 * t + i + n
  53142. }
  53143. ,
  53144. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53145. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53146. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53147. s *= o,
  53148. l *= o,
  53149. this.init(t, i, s, l)
  53150. }
  53151. ,
  53152. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  53153. this.init(t, i, r * (i - e), r * (n - t))
  53154. }
  53155. ,
  53156. xi.prototype.calc = function(e) {
  53157. var t = e * e
  53158. , i = t * e;
  53159. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53160. }
  53161. ,
  53162. Ci.Curve.create(function(e) {
  53163. this.points = e || [],
  53164. this.closed = !1
  53165. }, function(e) {
  53166. var t, i, n, r, o, a, s, l, c = this.points;
  53167. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  53168. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  53169. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  53170. n = 1),
  53171. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  53172. qt),
  53173. a = c[i % r],
  53174. s = c[(i + 1) % r],
  53175. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  53176. qt),
  53177. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53178. var h = "chordal" === this.type ? .5 : .25
  53179. , u = Math.pow(o.distanceToSquared(a), h)
  53180. , d = Math.pow(a.distanceToSquared(s), h)
  53181. , p = Math.pow(s.distanceToSquared(l), h);
  53182. d < 1e-4 && (d = 1),
  53183. u < 1e-4 && (u = d),
  53184. p < 1e-4 && (p = d),
  53185. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  53186. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  53187. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  53188. } else if ("catmullrom" === this.type) {
  53189. var f = void 0 !== this.tension ? this.tension : .5;
  53190. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  53191. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  53192. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  53193. }
  53194. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  53195. })),
  53196. Ci.ClosedSplineCurve3 = function(e) {
  53197. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53198. Ci.CatmullRomCurve3.call(this, e),
  53199. this.type = "catmullrom",
  53200. this.closed = !0
  53201. }
  53202. ,
  53203. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  53204. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  53205. Ci.Geometry.call(this),
  53206. this.type = "BoxGeometry",
  53207. this.parameters = {
  53208. width: e,
  53209. height: t,
  53210. depth: i,
  53211. widthSegments: n,
  53212. heightSegments: r,
  53213. depthSegments: o
  53214. },
  53215. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53216. this.mergeVertices()
  53217. }
  53218. ,
  53219. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53220. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53221. Ci.CubeGeometry = Ci.BoxGeometry,
  53222. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53223. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53224. 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++)
  53225. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53226. var b = _ * u - p;
  53227. C[e] = b * n,
  53228. C[t] = E * r,
  53229. C[i] = g,
  53230. P[D] = C.x,
  53231. P[D + 1] = C.y,
  53232. P[D + 2] = C.z,
  53233. C[e] = 0,
  53234. C[t] = 0,
  53235. C[i] = 0 < s ? 1 : -1,
  53236. O[D] = C.x,
  53237. O[D + 1] = C.y,
  53238. O[D + 2] = C.z,
  53239. L[N] = _ / l,
  53240. L[N + 1] = 1 - I / c,
  53241. D += 3,
  53242. N += 2,
  53243. y += 1
  53244. }
  53245. for (I = 0; I < c; I++)
  53246. for (_ = 0; _ < l; _++) {
  53247. var w = B + _ + m * I
  53248. , T = B + _ + m * (I + 1)
  53249. , x = B + (_ + 1) + m * (I + 1)
  53250. , S = B + (_ + 1) + m * I;
  53251. R[F] = w,
  53252. R[F + 1] = T,
  53253. R[F + 2] = S,
  53254. R[F + 3] = T,
  53255. R[F + 4] = x,
  53256. R[F + 5] = S,
  53257. F += 6,
  53258. A += 6
  53259. }
  53260. M.addGroup(V, A, h),
  53261. V += A,
  53262. B += y
  53263. }
  53264. Ci.BufferGeometry.call(this),
  53265. this.type = "BoxBufferGeometry",
  53266. this.parameters = {
  53267. width: e,
  53268. height: t,
  53269. depth: i,
  53270. widthSegments: n,
  53271. heightSegments: r,
  53272. depthSegments: o
  53273. };
  53274. var M = this;
  53275. n = Math.floor(n) || 1,
  53276. r = Math.floor(r) || 1,
  53277. o = Math.floor(o) || 1;
  53278. var s, l, c, h, u = (h = 0,
  53279. h += (s = n) * (l = r) * 2,
  53280. h += s * (c = o) * 2,
  53281. 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;
  53282. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53283. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53284. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53285. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53286. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53287. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53288. this.setIndex(new Ci.BufferAttribute(R,1)),
  53289. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53290. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53291. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53292. }
  53293. ,
  53294. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53295. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53296. Ci.CircleGeometry = function(e, t, i, n) {
  53297. Ci.Geometry.call(this),
  53298. this.type = "CircleGeometry",
  53299. this.parameters = {
  53300. radius: e,
  53301. segments: t,
  53302. thetaStart: i,
  53303. thetaLength: n
  53304. },
  53305. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53306. }
  53307. ,
  53308. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53309. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53310. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53311. Ci.BufferGeometry.call(this),
  53312. this.type = "CircleBufferGeometry",
  53313. this.parameters = {
  53314. radius: e,
  53315. segments: t,
  53316. thetaStart: i,
  53317. thetaLength: n
  53318. },
  53319. e = e || 50,
  53320. t = void 0 !== t ? Math.max(3, t) : 8,
  53321. i = void 0 !== i ? i : 0,
  53322. n = void 0 !== n ? n : 2 * Math.PI;
  53323. var r = t + 2
  53324. , o = new Float32Array(3 * r)
  53325. , a = new Float32Array(3 * r)
  53326. , s = new Float32Array(2 * r);
  53327. a[2] = 1,
  53328. s[0] = .5,
  53329. s[1] = .5;
  53330. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53331. c += 3,
  53332. h += 2) {
  53333. var u = i + l / t * n;
  53334. o[c] = e * Math.cos(u),
  53335. o[c + 1] = e * Math.sin(u),
  53336. a[c + 2] = 1,
  53337. s[h] = (o[c] / e + 1) / 2,
  53338. s[h + 1] = (o[c + 1] / e + 1) / 2
  53339. }
  53340. var d = [];
  53341. for (c = 1; c <= t; c++)
  53342. d.push(c, c + 1, 0);
  53343. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53344. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53345. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53346. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53347. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53348. }
  53349. ,
  53350. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53351. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53352. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53353. function t(e) {
  53354. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53355. for (i = b,
  53356. t = 1; t <= m; t++)
  53357. I.setXYZ(b, 0, x * s, 0),
  53358. E.setXYZ(b, 0, s, 0),
  53359. !0 === e ? (r.x = t / m,
  53360. r.y = 0) : (r.x = (t - 1) / m,
  53361. r.y = 1),
  53362. _.setXY(b, r.x, r.y),
  53363. b++;
  53364. for (n = b,
  53365. t = 0; t <= m; t++) {
  53366. var l = t / m;
  53367. o.x = a * Math.sin(l * A + y),
  53368. o.y = x * s,
  53369. o.z = a * Math.cos(l * A + y),
  53370. I.setXYZ(b, o.x, o.y, o.z),
  53371. E.setXYZ(b, 0, s, 0),
  53372. _.setXY(b, l, !0 === e ? 1 : 0),
  53373. b++
  53374. }
  53375. for (t = 0; t < m; t++) {
  53376. var c = i + t
  53377. , h = n + t;
  53378. !0 === e ? (C.setX(w, h),
  53379. w++,
  53380. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53381. w++,
  53382. C.setX(w, h)),
  53383. w++,
  53384. C.setX(w, c),
  53385. w++
  53386. }
  53387. }
  53388. Ci.BufferGeometry.call(this),
  53389. this.type = "CylinderBufferGeometry",
  53390. this.parameters = {
  53391. radiusTop: p,
  53392. radiusBottom: f,
  53393. height: g,
  53394. radialSegments: m,
  53395. heightSegments: v,
  53396. openEnded: e,
  53397. thetaStart: y,
  53398. thetaLength: A
  53399. },
  53400. p = void 0 !== p ? p : 20,
  53401. f = void 0 !== f ? f : 20,
  53402. g = void 0 !== g ? g : 100,
  53403. m = Math.floor(m) || 8,
  53404. v = Math.floor(v) || 1,
  53405. e = void 0 !== e && e,
  53406. y = void 0 !== y ? y : 0,
  53407. A = void 0 !== A ? A : 2 * Math.PI;
  53408. var i, n, r = (n = (m + 1) * (v + 1),
  53409. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53410. n), o = (i = m * v * 2 * 3,
  53411. !1 === e && (i += 2 * m * 3),
  53412. 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;
  53413. (function() {
  53414. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53415. for (t = 0; t <= v; t++) {
  53416. var o = []
  53417. , a = t / v
  53418. , s = a * (f - p) + p;
  53419. for (e = 0; e <= m; e++) {
  53420. var l = e / m;
  53421. n.x = s * Math.sin(l * A + y),
  53422. n.y = -a * g + x,
  53423. n.z = s * Math.cos(l * A + y),
  53424. I.setXYZ(b, n.x, n.y, n.z),
  53425. i.copy(n),
  53426. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53427. i.z = Math.cos(l * A + y)),
  53428. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53429. E.setXYZ(b, i.x, i.y, i.z),
  53430. _.setXY(b, l, 1 - a),
  53431. o.push(b),
  53432. b++
  53433. }
  53434. T.push(o)
  53435. }
  53436. for (e = 0; e < m; e++)
  53437. for (t = 0; t < v; t++) {
  53438. var c = T[t][e]
  53439. , h = T[t + 1][e]
  53440. , u = T[t + 1][e + 1]
  53441. , d = T[t][e + 1];
  53442. C.setX(w, c),
  53443. w++,
  53444. C.setX(w, h),
  53445. w++,
  53446. C.setX(w, d),
  53447. w++,
  53448. C.setX(w, h),
  53449. w++,
  53450. C.setX(w, u),
  53451. w++,
  53452. C.setX(w, d),
  53453. w++
  53454. }
  53455. }
  53456. )(),
  53457. !1 === e && (0 < p && t(!0),
  53458. 0 < f && t(!1)),
  53459. this.setIndex(C),
  53460. this.addAttribute("position", I),
  53461. this.addAttribute("normal", E),
  53462. this.addAttribute("uv", _)
  53463. }
  53464. ,
  53465. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53466. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53467. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53468. Ci.Geometry.call(this),
  53469. this.type = "CylinderGeometry",
  53470. this.parameters = {
  53471. radiusTop: e,
  53472. radiusBottom: t,
  53473. height: i,
  53474. radialSegments: n,
  53475. heightSegments: r,
  53476. openEnded: o,
  53477. thetaStart: a,
  53478. thetaLength: s
  53479. },
  53480. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53481. this.mergeVertices()
  53482. }
  53483. ,
  53484. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53485. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53486. Ci.EdgesGeometry = function(e, t) {
  53487. function i(e, t) {
  53488. return e - t
  53489. }
  53490. Ci.BufferGeometry.call(this),
  53491. t = void 0 !== t ? t : 1;
  53492. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53493. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53494. n.mergeVertices(),
  53495. n.computeFaceNormals();
  53496. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53497. for (var d = c[h], p = 0; p < 3; p++) {
  53498. o[0] = d[s[p]],
  53499. o[1] = d[s[(p + 1) % 3]],
  53500. o.sort(i),
  53501. void 0 === a[g = o.toString()] ? a[g] = {
  53502. vert1: o[0],
  53503. vert2: o[1],
  53504. face1: h,
  53505. face2: void 0
  53506. } : a[g].face2 = h
  53507. }
  53508. var f = [];
  53509. for (var g in a) {
  53510. var m = a[g];
  53511. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53512. var v = l[m.vert1];
  53513. f.push(v.x),
  53514. f.push(v.y),
  53515. f.push(v.z),
  53516. v = l[m.vert2],
  53517. f.push(v.x),
  53518. f.push(v.y),
  53519. f.push(v.z)
  53520. }
  53521. }
  53522. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53523. }
  53524. ,
  53525. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53526. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53527. Ci.ExtrudeGeometry = function(e, t) {
  53528. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53529. this.type = "ExtrudeGeometry",
  53530. e = Array.isArray(e) ? e : [e],
  53531. this.addShapeList(e, t),
  53532. void this.computeFaceNormals())
  53533. }
  53534. ;
  53535. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53536. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53537. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53538. for (var i = e.length, n = 0; n < i; n++) {
  53539. var r = e[n];
  53540. this.addShape(r, t)
  53541. }
  53542. }
  53543. ,
  53544. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53545. function i(e, t, i) {
  53546. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53547. t.clone().multiplyScalar(i).add(e)
  53548. }
  53549. function n(e, t, i) {
  53550. 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;
  53551. if (Math.abs(u) > Number.EPSILON) {
  53552. var d = Math.sqrt(h)
  53553. , p = Math.sqrt(l * l + c * c)
  53554. , f = t.x - s / d
  53555. , g = t.y + a / d
  53556. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53557. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53558. if (v <= 2)
  53559. return new Ci.Vector2(n,r);
  53560. o = Math.sqrt(v / 2)
  53561. } else {
  53562. var y = !1;
  53563. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53564. o = y ? (n = -s,
  53565. r = a,
  53566. Math.sqrt(h)) : (n = a,
  53567. r = s,
  53568. Math.sqrt(h / 2))
  53569. }
  53570. return new Ci.Vector2(n / o,r / o)
  53571. }
  53572. function r(e, t) {
  53573. var i, n;
  53574. for (G = e.length; 0 <= --G; ) {
  53575. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53576. var r = 0
  53577. , o = A + 2 * m;
  53578. for (r = 0; r < o; r++) {
  53579. var a = U * r
  53580. , s = U * (r + 1);
  53581. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53582. }
  53583. }
  53584. }
  53585. function o(e, t, i) {
  53586. T.vertices.push(new Ci.Vector3(e,t,i))
  53587. }
  53588. function a(e, t, i) {
  53589. e += x,
  53590. t += x,
  53591. i += x,
  53592. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53593. var n = E.generateTopUV(T, e, t, i);
  53594. T.faceVertexUvs[0].push(n)
  53595. }
  53596. function l(e, t, i, n) {
  53597. e += x,
  53598. t += x,
  53599. i += x,
  53600. n += x,
  53601. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53602. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53603. var r = E.generateSideWallUV(T, e, t, i, n);
  53604. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53605. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53606. }
  53607. 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;
  53608. C && (s = C.getSpacedPoints(A),
  53609. v = !(I = !0),
  53610. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53611. h = new Ci.Vector3,
  53612. u = new Ci.Vector3,
  53613. d = new Ci.Vector3),
  53614. v || (g = f = m = 0);
  53615. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53616. if (P) {
  53617. for (M = M.reverse(),
  53618. b = 0,
  53619. w = R.length; b < w; b++)
  53620. _ = R[b],
  53621. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53622. P = !1
  53623. }
  53624. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53625. , L = M;
  53626. for (b = 0,
  53627. w = R.length; b < w; b++)
  53628. _ = R[b],
  53629. M = M.concat(_);
  53630. 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++,
  53631. j++,
  53632. Y++)
  53633. j === W && (j = 0),
  53634. Y === W && (Y = 0),
  53635. z[G] = n(L[G], L[j], L[Y]);
  53636. var q, X, Z = [], K = z.concat();
  53637. for (b = 0,
  53638. w = R.length; b < w; b++) {
  53639. for (_ = R[b],
  53640. q = [],
  53641. G = 0,
  53642. j = (W = _.length) - 1,
  53643. Y = G + 1; G < W; G++,
  53644. j++,
  53645. Y++)
  53646. j === W && (j = 0),
  53647. Y === W && (Y = 0),
  53648. q[G] = n(_[G], _[j], _[Y]);
  53649. Z.push(q),
  53650. K = K.concat(q)
  53651. }
  53652. for (D = 0; D < m; D++) {
  53653. for (B = f * (1 - (F = D / m)),
  53654. N = g * Math.sin(F * Math.PI / 2),
  53655. G = 0,
  53656. W = L.length; G < W; G++)
  53657. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53658. for (b = 0,
  53659. w = R.length; b < w; b++)
  53660. for (_ = R[b],
  53661. q = Z[b],
  53662. G = 0,
  53663. W = _.length; G < W; G++)
  53664. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53665. }
  53666. for (N = g,
  53667. G = 0; G < U; G++)
  53668. V = v ? i(M[G], K[G], N) : M[G],
  53669. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53670. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53671. d.copy(s[0]).add(u).add(h),
  53672. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53673. for (X = 1; X <= A; X++)
  53674. for (G = 0; G < U; G++)
  53675. V = v ? i(M[G], K[G], N) : M[G],
  53676. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53677. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53678. d.copy(s[X]).add(u).add(h),
  53679. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53680. for (D = m - 1; 0 <= D; D--) {
  53681. for (B = f * (1 - (F = D / m)),
  53682. N = g * Math.sin(F * Math.PI / 2),
  53683. G = 0,
  53684. W = L.length; G < W; G++)
  53685. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53686. for (b = 0,
  53687. w = R.length; b < w; b++)
  53688. for (_ = R[b],
  53689. q = Z[b],
  53690. G = 0,
  53691. W = _.length; G < W; G++)
  53692. V = i(_[G], q[G], N),
  53693. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53694. }
  53695. (function() {
  53696. if (v) {
  53697. var e = 0
  53698. , t = U * e;
  53699. for (G = 0; G < H; G++)
  53700. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53701. for (t = U * (e = A + 2 * m),
  53702. G = 0; G < H; G++)
  53703. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53704. } else {
  53705. for (G = 0; G < H; G++)
  53706. a((k = O[G])[2], k[1], k[0]);
  53707. for (G = 0; G < H; G++)
  53708. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53709. }
  53710. }
  53711. )(),
  53712. function() {
  53713. var e = 0;
  53714. for (r(L, e),
  53715. e += L.length,
  53716. b = 0,
  53717. w = R.length; b < w; b++)
  53718. r(_ = R[b], e),
  53719. e += _.length
  53720. }()
  53721. }
  53722. ,
  53723. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53724. generateTopUV: function(e, t, i, n) {
  53725. var r = e.vertices
  53726. , o = r[t]
  53727. , a = r[i]
  53728. , s = r[n];
  53729. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53730. },
  53731. generateSideWallUV: function(e, t, i, n, r) {
  53732. var o = e.vertices
  53733. , a = o[t]
  53734. , s = o[i]
  53735. , l = o[n]
  53736. , c = o[r];
  53737. 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)]
  53738. }
  53739. },
  53740. Ci.ShapeGeometry = function(e, t) {
  53741. Ci.Geometry.call(this),
  53742. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53743. this.addShapeList(e, t),
  53744. this.computeFaceNormals()
  53745. }
  53746. ,
  53747. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53748. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53749. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53750. for (var i = 0, n = e.length; i < n; i++)
  53751. this.addShape(e[i], t);
  53752. return this
  53753. }
  53754. ,
  53755. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53756. void 0 === t && (t = {});
  53757. 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);
  53758. if (d) {
  53759. for (h = h.reverse(),
  53760. i = 0,
  53761. n = u.length; i < n; i++)
  53762. r = u[i],
  53763. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53764. d = !1
  53765. }
  53766. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53767. for (i = 0,
  53768. n = u.length; i < n; i++)
  53769. r = u[i],
  53770. h = h.concat(r);
  53771. var f, g, m = h.length, v = p.length;
  53772. for (i = 0; i < m; i++)
  53773. f = h[i],
  53774. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53775. for (i = 0; i < v; i++) {
  53776. var y = (g = p[i])[0] + l
  53777. , A = g[1] + l
  53778. , C = g[2] + l;
  53779. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53780. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53781. }
  53782. }
  53783. ,
  53784. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53785. Ci.BufferGeometry.call(this),
  53786. this.type = "LatheBufferGeometry",
  53787. this.parameters = {
  53788. points: e,
  53789. segments: t,
  53790. phiStart: i,
  53791. phiLength: n
  53792. },
  53793. t = Math.floor(t) || 12,
  53794. i = i || 0,
  53795. n = n || 2 * Math.PI,
  53796. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53797. 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,
  53798. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53799. for (o = 0; o <= t; o++) {
  53800. var v = i + o * f * n
  53801. , y = Math.sin(v)
  53802. , A = Math.cos(v);
  53803. for (a = 0; a <= e.length - 1; a++)
  53804. g.x = e[a].x * y,
  53805. g.y = e[a].y,
  53806. g.z = e[a].x * A,
  53807. h.setXYZ(d, g.x, g.y, g.z),
  53808. m.x = o / t,
  53809. m.y = a / (e.length - 1),
  53810. u.setXY(d, m.x, m.y),
  53811. d++
  53812. }
  53813. for (o = 0; o < t; o++)
  53814. for (a = 0; a < e.length - 1; a++) {
  53815. var C = r = a + o * e.length
  53816. , I = r + e.length
  53817. , E = r + e.length + 1
  53818. , _ = r + 1;
  53819. c.setX(p, C),
  53820. p++,
  53821. c.setX(p, I),
  53822. p++,
  53823. c.setX(p, _),
  53824. p++,
  53825. c.setX(p, I),
  53826. p++,
  53827. c.setX(p, E),
  53828. p++,
  53829. c.setX(p, _),
  53830. p++
  53831. }
  53832. if (this.setIndex(c),
  53833. this.addAttribute("position", h),
  53834. this.addAttribute("uv", u),
  53835. this.computeVertexNormals(),
  53836. n === 2 * Math.PI) {
  53837. var b = this.attributes.normal.array
  53838. , w = new Ci.Vector3
  53839. , T = new Ci.Vector3
  53840. , x = new Ci.Vector3;
  53841. for (r = t * e.length * 3,
  53842. a = o = 0; o < e.length; o++,
  53843. a += 3)
  53844. w.x = b[a + 0],
  53845. w.y = b[a + 1],
  53846. w.z = b[a + 2],
  53847. T.x = b[r + a + 0],
  53848. T.y = b[r + a + 1],
  53849. T.z = b[r + a + 2],
  53850. x.addVectors(w, T).normalize(),
  53851. b[a + 0] = b[r + a + 0] = x.x,
  53852. b[a + 1] = b[r + a + 1] = x.y,
  53853. b[a + 2] = b[r + a + 2] = x.z
  53854. }
  53855. }
  53856. ,
  53857. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53858. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53859. Ci.LatheGeometry = function(e, t, i, n) {
  53860. Ci.Geometry.call(this),
  53861. this.type = "LatheGeometry",
  53862. this.parameters = {
  53863. points: e,
  53864. segments: t,
  53865. phiStart: i,
  53866. phiLength: n
  53867. },
  53868. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53869. this.mergeVertices()
  53870. }
  53871. ,
  53872. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53873. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53874. Ci.PlaneGeometry = function(e, t, i, n) {
  53875. Ci.Geometry.call(this),
  53876. this.type = "PlaneGeometry",
  53877. this.parameters = {
  53878. width: e,
  53879. height: t,
  53880. widthSegments: i,
  53881. heightSegments: n
  53882. },
  53883. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53884. }
  53885. ,
  53886. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53887. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53888. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53889. Ci.BufferGeometry.call(this),
  53890. this.type = "PlaneBufferGeometry",
  53891. this.parameters = {
  53892. width: e,
  53893. height: t,
  53894. widthSegments: i,
  53895. heightSegments: n
  53896. };
  53897. 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++)
  53898. for (var y = v * u - o, A = 0; A < l; A++) {
  53899. var C = A * h - r;
  53900. d[g] = C,
  53901. d[g + 1] = -y,
  53902. p[g + 2] = 1,
  53903. f[m] = A / a,
  53904. f[m + 1] = 1 - v / s,
  53905. g += 3,
  53906. m += 2
  53907. }
  53908. g = 0;
  53909. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53910. for (v = 0; v < s; v++)
  53911. for (A = 0; A < a; A++) {
  53912. var E = A + l * v
  53913. , _ = A + l * (v + 1)
  53914. , b = A + 1 + l * (v + 1)
  53915. , w = A + 1 + l * v;
  53916. I[g] = E,
  53917. I[g + 1] = _,
  53918. I[g + 2] = w,
  53919. I[g + 3] = _,
  53920. I[g + 4] = b,
  53921. I[g + 5] = w,
  53922. g += 6
  53923. }
  53924. this.setIndex(new Ci.BufferAttribute(I,1)),
  53925. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53926. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53927. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53928. }
  53929. ,
  53930. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53931. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53932. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53933. Ci.BufferGeometry.call(this),
  53934. this.type = "RingBufferGeometry",
  53935. this.parameters = {
  53936. innerRadius: e,
  53937. outerRadius: t,
  53938. thetaSegments: i,
  53939. phiSegments: n,
  53940. thetaStart: r,
  53941. thetaLength: o
  53942. },
  53943. e = e || 20,
  53944. t = t || 50,
  53945. r = void 0 !== r ? r : 0,
  53946. o = void 0 !== o ? o : 2 * Math.PI;
  53947. 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;
  53948. for (s = 0; s <= n; s++) {
  53949. for (l = 0; l <= i; l++)
  53950. a = r + l / i * o,
  53951. A.x = v * Math.cos(a),
  53952. A.y = v * Math.sin(a),
  53953. d.setXYZ(g, A.x, A.y, A.z),
  53954. p.setXYZ(g, 0, 0, 1),
  53955. C.x = (A.x / t + 1) / 2,
  53956. C.y = (A.y / t + 1) / 2,
  53957. f.setXY(g, C.x, C.y),
  53958. g++;
  53959. v += y
  53960. }
  53961. for (s = 0; s < n; s++) {
  53962. var I = s * (i + 1);
  53963. for (l = 0; l < i; l++) {
  53964. var E = a = l + I
  53965. , _ = a + i + 1
  53966. , b = a + i + 2
  53967. , w = a + 1;
  53968. u.setX(m, E),
  53969. m++,
  53970. u.setX(m, _),
  53971. m++,
  53972. u.setX(m, b),
  53973. m++,
  53974. u.setX(m, E),
  53975. m++,
  53976. u.setX(m, b),
  53977. m++,
  53978. u.setX(m, w),
  53979. m++
  53980. }
  53981. }
  53982. this.setIndex(u),
  53983. this.addAttribute("position", d),
  53984. this.addAttribute("normal", p),
  53985. this.addAttribute("uv", f)
  53986. }
  53987. ,
  53988. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53989. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53990. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53991. Ci.Geometry.call(this),
  53992. this.type = "RingGeometry",
  53993. this.parameters = {
  53994. innerRadius: e,
  53995. outerRadius: t,
  53996. thetaSegments: i,
  53997. phiSegments: n,
  53998. thetaStart: r,
  53999. thetaLength: o
  54000. },
  54001. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  54002. }
  54003. ,
  54004. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54005. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  54006. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  54007. Ci.Geometry.call(this),
  54008. this.type = "SphereGeometry",
  54009. this.parameters = {
  54010. radius: e,
  54011. widthSegments: t,
  54012. heightSegments: i,
  54013. phiStart: n,
  54014. phiLength: r,
  54015. thetaStart: o,
  54016. thetaLength: a
  54017. },
  54018. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  54019. }
  54020. ,
  54021. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54022. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  54023. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  54024. Ci.BufferGeometry.call(this),
  54025. this.type = "SphereBufferGeometry",
  54026. this.parameters = {
  54027. radius: e,
  54028. widthSegments: t,
  54029. heightSegments: i,
  54030. phiStart: n,
  54031. phiLength: r,
  54032. thetaStart: o,
  54033. thetaLength: a
  54034. },
  54035. e = e || 50,
  54036. t = Math.max(3, Math.floor(t) || 8),
  54037. i = Math.max(2, Math.floor(i) || 6),
  54038. n = void 0 !== n ? n : 0,
  54039. r = void 0 !== r ? r : 2 * Math.PI;
  54040. 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++) {
  54041. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  54042. var A = y / t
  54043. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  54044. , I = e * Math.cos(o + v * a)
  54045. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  54046. f.set(C, I, E).normalize(),
  54047. c.setXYZ(d, C, I, E),
  54048. h.setXYZ(d, f.x, f.y, f.z),
  54049. u.setXY(d, A, 1 - v),
  54050. m.push(d),
  54051. d++
  54052. }
  54053. p.push(m)
  54054. }
  54055. var _ = [];
  54056. for (g = 0; g < i; g++)
  54057. for (y = 0; y < t; y++) {
  54058. var b = p[g][y + 1]
  54059. , w = p[g][y]
  54060. , T = p[g + 1][y]
  54061. , x = p[g + 1][y + 1];
  54062. (0 !== g || 0 < o) && _.push(b, w, x),
  54063. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  54064. }
  54065. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  54066. this.addAttribute("position", c),
  54067. this.addAttribute("normal", h),
  54068. this.addAttribute("uv", u),
  54069. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  54070. }
  54071. ,
  54072. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54073. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  54074. Ci.TextGeometry = function(e, t) {
  54075. var i = (t = t || {}).font;
  54076. if (i instanceof Ci.Font == 0)
  54077. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54078. new Ci.Geometry;
  54079. var n = i.generateShapes(e, t.size, t.curveSegments);
  54080. t.amount = void 0 !== t.height ? t.height : 50,
  54081. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54082. void 0 === t.bevelSize && (t.bevelSize = 8),
  54083. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54084. Ci.ExtrudeGeometry.call(this, n, t),
  54085. this.type = "TextGeometry"
  54086. }
  54087. ,
  54088. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  54089. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  54090. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  54091. Ci.BufferGeometry.call(this),
  54092. this.type = "TorusBufferGeometry",
  54093. this.parameters = {
  54094. radius: e,
  54095. tube: t,
  54096. radialSegments: i,
  54097. tubularSegments: n,
  54098. arc: r
  54099. },
  54100. e = e || 100,
  54101. t = t || 40,
  54102. i = Math.floor(i) || 8,
  54103. n = Math.floor(n) || 6,
  54104. r = r || 2 * Math.PI;
  54105. 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;
  54106. for (o = 0; o <= i; o++)
  54107. for (a = 0; a <= n; a++) {
  54108. var A = a / n * r
  54109. , C = o / i * Math.PI * 2;
  54110. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  54111. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  54112. v.z = t * Math.sin(C),
  54113. h[p] = v.x,
  54114. h[p + 1] = v.y,
  54115. h[p + 2] = v.z,
  54116. m.x = e * Math.cos(A),
  54117. m.y = e * Math.sin(A),
  54118. y.subVectors(v, m).normalize(),
  54119. u[p] = y.x,
  54120. u[p + 1] = y.y,
  54121. u[p + 2] = y.z,
  54122. d[f] = a / n,
  54123. d[f + 1] = o / i,
  54124. p += 3,
  54125. f += 2
  54126. }
  54127. for (o = 1; o <= i; o++)
  54128. for (a = 1; a <= n; a++) {
  54129. var I = (n + 1) * o + a - 1
  54130. , E = (n + 1) * (o - 1) + a - 1
  54131. , _ = (n + 1) * (o - 1) + a
  54132. , b = (n + 1) * o + a;
  54133. c[g] = I,
  54134. c[g + 1] = E,
  54135. c[g + 2] = b,
  54136. c[g + 3] = E,
  54137. c[g + 4] = _,
  54138. c[g + 5] = b,
  54139. g += 6
  54140. }
  54141. this.setIndex(new Ci.BufferAttribute(c,1)),
  54142. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  54143. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  54144. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  54145. }
  54146. ,
  54147. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54148. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  54149. Ci.TorusGeometry = function(e, t, i, n, r) {
  54150. Ci.Geometry.call(this),
  54151. this.type = "TorusGeometry",
  54152. this.parameters = {
  54153. radius: e,
  54154. tube: t,
  54155. radialSegments: i,
  54156. tubularSegments: n,
  54157. arc: r
  54158. },
  54159. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  54160. }
  54161. ,
  54162. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54163. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  54164. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  54165. function a(e, t, i, n, r) {
  54166. var o = Math.cos(e)
  54167. , a = Math.sin(e)
  54168. , s = i / t * e
  54169. , l = Math.cos(s);
  54170. r.x = n * (2 + l) * .5 * o,
  54171. r.y = n * (2 + l) * a * .5,
  54172. r.z = n * Math.sin(s) * .5
  54173. }
  54174. Ci.BufferGeometry.call(this),
  54175. this.type = "TorusKnotBufferGeometry",
  54176. this.parameters = {
  54177. radius: e,
  54178. tube: t,
  54179. tubularSegments: i,
  54180. radialSegments: n,
  54181. p: r,
  54182. q: o
  54183. },
  54184. e = e || 100,
  54185. t = t || 40,
  54186. i = Math.floor(i) || 64,
  54187. r = r || 2,
  54188. o = o || 3;
  54189. 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;
  54190. for (s = 0; s <= i; ++s) {
  54191. var w = s / i * r * Math.PI * 2;
  54192. for (a(w, r, o, e, C),
  54193. a(.01 + w, r, o, e, I),
  54194. _.subVectors(I, C),
  54195. b.addVectors(I, C),
  54196. E.crossVectors(_, b),
  54197. b.crossVectors(E, _),
  54198. E.normalize(),
  54199. b.normalize(),
  54200. l = 0; l <= n; ++l) {
  54201. var T = l / n * Math.PI * 2
  54202. , x = -t * Math.cos(T)
  54203. , S = t * Math.sin(T);
  54204. v.x = C.x + (x * b.x + S * E.x),
  54205. v.y = C.y + (x * b.y + S * E.y),
  54206. v.z = C.z + (x * b.z + S * E.z),
  54207. d.setXYZ(g, v.x, v.y, v.z),
  54208. y.subVectors(v, C).normalize(),
  54209. p.setXYZ(g, y.x, y.y, y.z),
  54210. A.x = s / i,
  54211. A.y = l / n,
  54212. f.setXY(g, A.x, A.y),
  54213. g++
  54214. }
  54215. }
  54216. for (l = 1; l <= i; l++)
  54217. for (s = 1; s <= n; s++) {
  54218. var M = (n + 1) * (l - 1) + (s - 1)
  54219. , R = (n + 1) * l + (s - 1)
  54220. , P = (n + 1) * l + s
  54221. , O = (n + 1) * (l - 1) + s;
  54222. u.setX(m, M),
  54223. m++,
  54224. u.setX(m, R),
  54225. m++,
  54226. u.setX(m, O),
  54227. m++,
  54228. u.setX(m, R),
  54229. m++,
  54230. u.setX(m, P),
  54231. m++,
  54232. u.setX(m, O),
  54233. m++
  54234. }
  54235. this.setIndex(u),
  54236. this.addAttribute("position", d),
  54237. this.addAttribute("normal", p),
  54238. this.addAttribute("uv", f)
  54239. }
  54240. ,
  54241. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54242. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54243. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54244. Ci.Geometry.call(this),
  54245. this.type = "TorusKnotGeometry",
  54246. this.parameters = {
  54247. radius: e,
  54248. tube: t,
  54249. tubularSegments: i,
  54250. radialSegments: n,
  54251. p: r,
  54252. q: o
  54253. },
  54254. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54255. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54256. this.mergeVertices()
  54257. }
  54258. ,
  54259. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54260. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54261. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54262. Ci.Geometry.call(this),
  54263. this.type = "TubeGeometry",
  54264. this.parameters = {
  54265. path: e,
  54266. segments: t,
  54267. radius: i,
  54268. radialSegments: n,
  54269. closed: r,
  54270. taper: o
  54271. },
  54272. t = t || 64,
  54273. i = i || 1,
  54274. n = n || 8,
  54275. r = r || !1,
  54276. o = o || Ci.TubeGeometry.NoTaper;
  54277. 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;
  54278. for (this.tangents = D,
  54279. this.normals = N,
  54280. this.binormals = F,
  54281. f = 0; f < P; f++)
  54282. for (M[f] = [],
  54283. l = f / (P - 1),
  54284. p = e.getPointAt(l),
  54285. D[f],
  54286. a = N[f],
  54287. s = F[f],
  54288. h = i * o(l),
  54289. g = 0; g < n; g++)
  54290. c = g / n * 2 * Math.PI,
  54291. u = -h * Math.cos(c),
  54292. d = h * Math.sin(c),
  54293. O.copy(p),
  54294. O.x += u * a.x + d * s.x,
  54295. O.y += u * a.y + d * s.y,
  54296. O.z += u * a.z + d * s.z,
  54297. M[f][g] = (T = O.x,
  54298. x = O.y,
  54299. S = O.z,
  54300. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54301. for (f = 0; f < t; f++)
  54302. for (g = 0; g < n; g++)
  54303. m = r ? (f + 1) % t : f + 1,
  54304. v = (g + 1) % n,
  54305. y = M[f][g],
  54306. A = M[m][g],
  54307. C = M[m][v],
  54308. I = M[f][v],
  54309. E = new Ci.Vector2(f / t,g / n),
  54310. _ = new Ci.Vector2((f + 1) / t,g / n),
  54311. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54312. w = new Ci.Vector2(f / t,(g + 1) / n),
  54313. this.faces.push(new Ci.Face3(y,A,I)),
  54314. this.faceVertexUvs[0].push([E, _, w]),
  54315. this.faces.push(new Ci.Face3(A,C,I)),
  54316. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54317. this.computeFaceNormals(),
  54318. this.computeVertexNormals()
  54319. }
  54320. ,
  54321. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54322. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54323. Ci.TubeGeometry.NoTaper = function(e) {
  54324. return 1
  54325. }
  54326. ,
  54327. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54328. return Math.sin(Math.PI * e)
  54329. }
  54330. ,
  54331. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54332. 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;
  54333. for (this.tangents = u,
  54334. this.normals = d,
  54335. this.binormals = p,
  54336. l = 0; l < m; l++)
  54337. c = l / (m - 1),
  54338. u[l] = e.getTangentAt(c),
  54339. u[l].normalize();
  54340. for (d[0] = new Ci.Vector3,
  54341. p[0] = new Ci.Vector3,
  54342. r = Number.MAX_VALUE,
  54343. o = Math.abs(u[0].x),
  54344. a = Math.abs(u[0].y),
  54345. s = Math.abs(u[0].z),
  54346. o <= r && (r = o,
  54347. h.set(1, 0, 0)),
  54348. a <= r && (r = a,
  54349. h.set(0, 1, 0)),
  54350. s <= r && h.set(0, 0, 1),
  54351. f.crossVectors(u[0], h).normalize(),
  54352. d[0].crossVectors(u[0], f),
  54353. p[0].crossVectors(u[0], d[0]),
  54354. l = 1; l < m; l++)
  54355. d[l] = d[l - 1].clone(),
  54356. p[l] = p[l - 1].clone(),
  54357. f.crossVectors(u[l - 1], u[l]),
  54358. f.length() > Number.EPSILON && (f.normalize(),
  54359. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54360. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54361. p[l].crossVectors(u[l], d[l]);
  54362. if (i)
  54363. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54364. n /= m - 1,
  54365. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54366. l = 1; l < m; l++)
  54367. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54368. p[l].crossVectors(u[l], d[l])
  54369. }
  54370. ,
  54371. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54372. function f(e) {
  54373. var t = e.normalize().clone();
  54374. t.index = m.vertices.push(t) - 1;
  54375. var i = a(e) / 2 / Math.PI + .5
  54376. , n = function(e) {
  54377. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54378. }(e) / Math.PI + .5;
  54379. return t.uv = new Ci.Vector2(i,1 - n),
  54380. t
  54381. }
  54382. function g(e, t, i, n) {
  54383. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54384. m.faces.push(r),
  54385. y.copy(e).add(t).add(i).divideScalar(3);
  54386. var o = a(y);
  54387. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54388. }
  54389. function r(e, t) {
  54390. 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++) {
  54391. a[l] = [];
  54392. 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++)
  54393. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54394. }
  54395. for (l = 0; l < i; l++)
  54396. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54397. var p = Math.floor(d / 2);
  54398. 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)
  54399. }
  54400. }
  54401. function a(e) {
  54402. return Math.atan2(e.z, -e.x)
  54403. }
  54404. function s(e, t, i) {
  54405. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54406. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54407. e.clone()
  54408. }
  54409. Ci.Geometry.call(this),
  54410. this.type = "PolyhedronGeometry",
  54411. this.parameters = {
  54412. vertices: e,
  54413. indices: t,
  54414. radius: i,
  54415. detail: n
  54416. },
  54417. i = i || 1,
  54418. n = n || 0;
  54419. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54420. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54421. var c = this.vertices
  54422. , h = []
  54423. , u = (o = 0,
  54424. 0);
  54425. for (l = t.length; o < l; o += 3,
  54426. u++) {
  54427. var d = c[t[o]]
  54428. , p = c[t[o + 1]]
  54429. , v = c[t[o + 2]];
  54430. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54431. }
  54432. var y = new Ci.Vector3;
  54433. for (o = 0,
  54434. l = h.length; o < l; o++)
  54435. r(h[o], n);
  54436. for (o = 0,
  54437. l = this.faceVertexUvs[0].length; o < l; o++) {
  54438. var A = this.faceVertexUvs[0][o]
  54439. , C = A[0].x
  54440. , I = A[1].x
  54441. , E = A[2].x
  54442. , _ = Math.max(C, I, E)
  54443. , b = Math.min(C, I, E);
  54444. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54445. I < .2 && (A[1].x += 1),
  54446. E < .2 && (A[2].x += 1))
  54447. }
  54448. for (o = 0,
  54449. l = this.vertices.length; o < l; o++)
  54450. this.vertices[o].multiplyScalar(i);
  54451. this.mergeVertices(),
  54452. this.computeFaceNormals(),
  54453. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54454. }
  54455. ,
  54456. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54457. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54458. Ci.DodecahedronGeometry = function(e, t) {
  54459. var i = (1 + Math.sqrt(5)) / 2
  54460. , n = 1 / i
  54461. , 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];
  54462. 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),
  54463. this.type = "DodecahedronGeometry",
  54464. this.parameters = {
  54465. radius: e,
  54466. detail: t
  54467. }
  54468. }
  54469. ,
  54470. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54471. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54472. Ci.IcosahedronGeometry = function(e, t) {
  54473. var i = (1 + Math.sqrt(5)) / 2
  54474. , 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];
  54475. 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),
  54476. this.type = "IcosahedronGeometry",
  54477. this.parameters = {
  54478. radius: e,
  54479. detail: t
  54480. }
  54481. }
  54482. ,
  54483. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54484. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54485. Ci.OctahedronGeometry = function(e, t) {
  54486. 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),
  54487. this.type = "OctahedronGeometry",
  54488. this.parameters = {
  54489. radius: e,
  54490. detail: t
  54491. }
  54492. }
  54493. ,
  54494. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54495. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54496. Ci.TetrahedronGeometry = function(e, t) {
  54497. 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),
  54498. this.type = "TetrahedronGeometry",
  54499. this.parameters = {
  54500. radius: e,
  54501. detail: t
  54502. }
  54503. }
  54504. ,
  54505. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54506. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54507. Ci.ParametricGeometry = function(e, t, i) {
  54508. Ci.Geometry.call(this),
  54509. this.type = "ParametricGeometry",
  54510. this.parameters = {
  54511. func: e,
  54512. slices: t,
  54513. stacks: i
  54514. };
  54515. 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;
  54516. for (n = 0; n <= i; n++)
  54517. for (a = n / i,
  54518. r = 0; r <= t; r++)
  54519. o = e(r / t, a),
  54520. g.push(o);
  54521. for (n = 0; n < i; n++)
  54522. for (r = 0; r < t; r++)
  54523. l = (s = n * y + r) + 1,
  54524. c = (n + 1) * y + r + 1,
  54525. h = (n + 1) * y + r,
  54526. u = new Ci.Vector2(r / t,n / i),
  54527. d = new Ci.Vector2((r + 1) / t,n / i),
  54528. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54529. f = new Ci.Vector2(r / t,(n + 1) / i),
  54530. m.push(new Ci.Face3(s,l,h)),
  54531. v.push([u, d, f]),
  54532. m.push(new Ci.Face3(l,c,h)),
  54533. v.push([d.clone(), p, f.clone()]);
  54534. this.computeFaceNormals(),
  54535. this.computeVertexNormals()
  54536. }
  54537. ,
  54538. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54539. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54540. Ci.WireframeGeometry = function(e) {
  54541. function t(e, t) {
  54542. return e - t
  54543. }
  54544. Ci.BufferGeometry.call(this);
  54545. var i = [0, 0]
  54546. , n = {}
  54547. , r = ["a", "b", "c"];
  54548. if (e instanceof Ci.Geometry) {
  54549. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54550. for (var u = a[c], d = 0; d < 3; d++) {
  54551. i[0] = u[r[d]],
  54552. i[1] = u[r[(d + 1) % 3]],
  54553. i.sort(t),
  54554. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54555. l[2 * s + 1] = i[1],
  54556. n[E] = !0,
  54557. s++)
  54558. }
  54559. var p = new Float32Array(2 * s * 3);
  54560. for (c = 0,
  54561. h = s; c < h; c++)
  54562. for (d = 0; d < 2; d++) {
  54563. var f = o[l[2 * c + d]];
  54564. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54565. p[_ + 1] = f.y,
  54566. p[_ + 2] = f.z
  54567. }
  54568. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54569. } else if (e instanceof Ci.BufferGeometry)
  54570. if (null !== e.index) {
  54571. var g = e.index.array
  54572. , m = (o = e.attributes.position,
  54573. e.groups);
  54574. s = 0;
  54575. 0 === m.length && e.addGroup(0, g.length);
  54576. l = new Uint32Array(2 * g.length);
  54577. for (var v = 0, y = m.length; v < y; ++v)
  54578. for (var A = m[v], C = A.start, I = (c = C,
  54579. C + A.count); c < I; c += 3)
  54580. for (d = 0; d < 3; d++) {
  54581. var E;
  54582. i[0] = g[c + d],
  54583. i[1] = g[c + (d + 1) % 3],
  54584. i.sort(t),
  54585. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54586. l[2 * s + 1] = i[1],
  54587. n[E] = !0,
  54588. s++)
  54589. }
  54590. for (p = new Float32Array(2 * s * 3),
  54591. c = 0,
  54592. h = s; c < h; c++)
  54593. for (d = 0; d < 2; d++) {
  54594. var _ = 6 * c + 3 * d
  54595. , b = l[2 * c + d];
  54596. p[_ + 0] = o.getX(b),
  54597. p[_ + 1] = o.getY(b),
  54598. p[_ + 2] = o.getZ(b)
  54599. }
  54600. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54601. } else {
  54602. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54603. for (p = new Float32Array(2 * s * 3),
  54604. c = 0,
  54605. h = w; c < h; c++)
  54606. for (d = 0; d < 3; d++) {
  54607. var T = 9 * c + 3 * d;
  54608. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54609. p[_ + 1] = o[1 + T],
  54610. p[_ + 2] = o[2 + T];
  54611. b = 9 * c + (d + 1) % 3 * 3;
  54612. p[_ + 3] = o[b],
  54613. p[_ + 4] = o[b + 1],
  54614. p[_ + 5] = o[b + 2]
  54615. }
  54616. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54617. }
  54618. }
  54619. ,
  54620. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54621. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54622. Ci.AxisHelper = function(e) {
  54623. e = e || 1;
  54624. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54625. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54626. , n = new Ci.BufferGeometry;
  54627. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54628. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54629. var r = new Ci.LineBasicMaterial({
  54630. vertexColors: Ci.VertexColors
  54631. });
  54632. Ci.LineSegments.call(this, n, r)
  54633. }
  54634. ,
  54635. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54636. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54637. Ci.ArrowHelper = function() {
  54638. var a = new Ci.Geometry;
  54639. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54640. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54641. return s.translate(0, -.5, 0),
  54642. function(e, t, i, n, r, o) {
  54643. Ci.Object3D.call(this),
  54644. void 0 === n && (n = 16776960),
  54645. void 0 === i && (i = 1),
  54646. void 0 === r && (r = .2 * i),
  54647. void 0 === o && (o = .2 * r),
  54648. this.position.copy(t),
  54649. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54650. color: n
  54651. })),
  54652. this.line.matrixAutoUpdate = !1,
  54653. this.add(this.line),
  54654. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54655. color: n
  54656. })),
  54657. this.cone.matrixAutoUpdate = !1,
  54658. this.add(this.cone),
  54659. this.setDirection(e),
  54660. this.setLength(i, r, o)
  54661. }
  54662. }(),
  54663. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54664. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54665. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54666. function(e) {
  54667. .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(),
  54668. yi = Math.acos(e.y),
  54669. this.quaternion.setFromAxisAngle(Ai, yi))
  54670. }
  54671. ),
  54672. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54673. void 0 === t && (t = .2 * e),
  54674. void 0 === i && (i = .2 * t),
  54675. this.line.scale.set(1, Math.max(0, e - t), 1),
  54676. this.line.updateMatrix(),
  54677. this.cone.scale.set(i, t, i),
  54678. this.cone.position.y = e,
  54679. this.cone.updateMatrix()
  54680. }
  54681. ,
  54682. Ci.ArrowHelper.prototype.setColor = function(e) {
  54683. this.line.material.color.set(e),
  54684. this.cone.material.color.set(e)
  54685. }
  54686. ,
  54687. Ci.BoxHelper = function(e) {
  54688. 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])
  54689. , i = new Float32Array(24)
  54690. , n = new Ci.BufferGeometry;
  54691. n.setIndex(new Ci.BufferAttribute(t,1)),
  54692. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54693. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54694. color: 16776960
  54695. })),
  54696. void 0 !== e && this.update(e)
  54697. }
  54698. ,
  54699. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54700. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54701. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54702. function(e) {
  54703. if (vi.setFromObject(e),
  54704. !vi.isEmpty()) {
  54705. var t = vi.min
  54706. , i = vi.max
  54707. , n = this.geometry.attributes.position
  54708. , r = n.array;
  54709. r[0] = i.x,
  54710. r[1] = i.y,
  54711. r[2] = i.z,
  54712. r[3] = t.x,
  54713. r[4] = i.y,
  54714. r[5] = i.z,
  54715. r[6] = t.x,
  54716. r[7] = t.y,
  54717. r[8] = i.z,
  54718. r[9] = i.x,
  54719. r[10] = t.y,
  54720. r[11] = i.z,
  54721. r[12] = i.x,
  54722. r[13] = i.y,
  54723. r[14] = t.z,
  54724. r[15] = t.x,
  54725. r[16] = i.y,
  54726. r[17] = t.z,
  54727. r[18] = t.x,
  54728. r[19] = t.y,
  54729. r[20] = t.z,
  54730. r[21] = i.x,
  54731. r[22] = t.y,
  54732. r[23] = t.z,
  54733. n.needsUpdate = !0,
  54734. this.geometry.computeBoundingSphere()
  54735. }
  54736. }
  54737. ),
  54738. Ci.BoundingBoxHelper = function(e, t) {
  54739. var i = void 0 !== t ? t : 8947848;
  54740. this.object = e,
  54741. this.box = new Ci.Box3,
  54742. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54743. color: i,
  54744. wireframe: !0
  54745. }))
  54746. }
  54747. ,
  54748. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54749. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54750. Ci.BoundingBoxHelper.prototype.update = function() {
  54751. this.box.setFromObject(this.object),
  54752. this.box.size(this.scale),
  54753. this.box.center(this.position)
  54754. }
  54755. ,
  54756. Ci.CameraHelper = function(e) {
  54757. function t(e, t, i) {
  54758. n(e, i),
  54759. n(t, i)
  54760. }
  54761. function n(e, t) {
  54762. i.vertices.push(new Ci.Vector3),
  54763. i.colors.push(new Ci.Color(t)),
  54764. void 0 === o[e] && (o[e] = []),
  54765. o[e].push(i.vertices.length - 1)
  54766. }
  54767. var i = new Ci.Geometry
  54768. , r = new Ci.LineBasicMaterial({
  54769. color: 16777215,
  54770. vertexColors: Ci.FaceColors
  54771. })
  54772. , o = {}
  54773. , a = 16755200
  54774. , s = 16711680
  54775. , l = 3355443;
  54776. t("n1", "n2", a),
  54777. t("n2", "n4", a),
  54778. t("n4", "n3", a),
  54779. t("n3", "n1", a),
  54780. t("f1", "f2", a),
  54781. t("f2", "f4", a),
  54782. t("f4", "f3", a),
  54783. t("f3", "f1", a),
  54784. t("n1", "f1", a),
  54785. t("n2", "f2", a),
  54786. t("n3", "f3", a),
  54787. t("n4", "f4", a),
  54788. t("p", "n1", s),
  54789. t("p", "n2", s),
  54790. t("p", "n3", s),
  54791. t("p", "n4", s),
  54792. t("u1", "u2", 43775),
  54793. t("u2", "u3", 43775),
  54794. t("u3", "u1", 43775),
  54795. t("c", "t", 16777215),
  54796. t("p", "c", l),
  54797. t("cn1", "cn2", l),
  54798. t("cn3", "cn4", l),
  54799. t("cf1", "cf2", l),
  54800. t("cf3", "cf4", l),
  54801. Ci.LineSegments.call(this, i, r),
  54802. this.camera = e,
  54803. this.camera.updateProjectionMatrix(),
  54804. this.matrix = e.matrixWorld,
  54805. this.matrixAutoUpdate = !1,
  54806. this.pointMap = o,
  54807. this.update()
  54808. }
  54809. ,
  54810. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54811. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54812. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54813. mi = new Ci.Camera,
  54814. function() {
  54815. pi = this.geometry,
  54816. fi = this.pointMap,
  54817. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54818. Ni("c", 0, 0, -1),
  54819. Ni("t", 0, 0, 1),
  54820. Ni("n1", -1, -1, -1),
  54821. Ni("n2", 1, -1, -1),
  54822. Ni("n3", -1, 1, -1),
  54823. Ni("n4", 1, 1, -1),
  54824. Ni("f1", -1, -1, 1),
  54825. Ni("f2", 1, -1, 1),
  54826. Ni("f3", -1, 1, 1),
  54827. Ni("f4", 1, 1, 1),
  54828. Ni("u1", .7, 1.1, -1),
  54829. Ni("u2", -.7, 1.1, -1),
  54830. Ni("u3", 0, 2, -1),
  54831. Ni("cf1", -1, 0, 1),
  54832. Ni("cf2", 1, 0, 1),
  54833. Ni("cf3", 0, -1, 1),
  54834. Ni("cf4", 0, 1, 1),
  54835. Ni("cn1", -1, 0, -1),
  54836. Ni("cn2", 1, 0, -1),
  54837. Ni("cn3", 0, -1, -1),
  54838. Ni("cn4", 0, 1, -1),
  54839. pi.verticesNeedUpdate = !0
  54840. }
  54841. ),
  54842. Ci.DirectionalLightHelper = function(e, t) {
  54843. Ci.Object3D.call(this),
  54844. this.light = e,
  54845. this.light.updateMatrixWorld(),
  54846. this.matrix = e.matrixWorld,
  54847. this.matrixAutoUpdate = !1,
  54848. t = t || 1;
  54849. var i = new Ci.Geometry;
  54850. 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));
  54851. var n = new Ci.LineBasicMaterial({
  54852. fog: !1
  54853. });
  54854. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54855. this.lightPlane = new Ci.Line(i,n),
  54856. this.add(this.lightPlane),
  54857. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54858. (n = new Ci.LineBasicMaterial({
  54859. fog: !1
  54860. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54861. this.targetLine = new Ci.Line(i,n),
  54862. this.add(this.targetLine),
  54863. this.update()
  54864. }
  54865. ,
  54866. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54867. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54868. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54869. this.lightPlane.geometry.dispose(),
  54870. this.lightPlane.material.dispose(),
  54871. this.targetLine.geometry.dispose(),
  54872. this.targetLine.material.dispose()
  54873. }
  54874. ,
  54875. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54876. ui = new Ci.Vector3,
  54877. di = new Ci.Vector3,
  54878. function() {
  54879. hi.setFromMatrixPosition(this.light.matrixWorld),
  54880. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54881. di.subVectors(ui, hi),
  54882. this.lightPlane.lookAt(di),
  54883. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54884. this.targetLine.geometry.vertices[1].copy(di),
  54885. this.targetLine.geometry.verticesNeedUpdate = !0,
  54886. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54887. }
  54888. ),
  54889. Ci.EdgesHelper = function(e, t, i) {
  54890. var n = void 0 !== t ? t : 16777215;
  54891. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54892. color: n
  54893. })),
  54894. this.matrix = e.matrixWorld,
  54895. this.matrixAutoUpdate = !1
  54896. }
  54897. ,
  54898. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54899. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54900. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54901. this.object = e,
  54902. this.size = void 0 !== t ? t : 1;
  54903. var r = void 0 !== i ? i : 16776960
  54904. , o = void 0 !== n ? n : 1
  54905. , a = 0
  54906. , s = this.object.geometry;
  54907. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54908. var l = new Ci.BufferGeometry
  54909. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54910. l.addAttribute("position", c),
  54911. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54912. color: r,
  54913. linewidth: o
  54914. })),
  54915. this.matrixAutoUpdate = !1,
  54916. this.update()
  54917. }
  54918. ,
  54919. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54920. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54921. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54922. li = new Ci.Vector3,
  54923. ci = new Ci.Matrix3,
  54924. function() {
  54925. this.object.updateMatrixWorld(!0),
  54926. ci.getNormalMatrix(this.object.matrixWorld);
  54927. 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++) {
  54928. var l = r[a]
  54929. , c = l.normal;
  54930. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54931. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54932. t.setXYZ(o, si.x, si.y, si.z),
  54933. o += 1,
  54934. t.setXYZ(o, li.x, li.y, li.z),
  54935. o += 1
  54936. }
  54937. return t.needsUpdate = !0,
  54938. this
  54939. }
  54940. ),
  54941. Ci.GridHelper = function(e, t) {
  54942. var i = new Ci.Geometry
  54943. , n = new Ci.LineBasicMaterial({
  54944. vertexColors: Ci.VertexColors
  54945. });
  54946. this.color1 = new Ci.Color(4473924),
  54947. this.color2 = new Ci.Color(8947848);
  54948. for (var r = -e; r <= e; r += t) {
  54949. 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));
  54950. var o = 0 === r ? this.color1 : this.color2;
  54951. i.colors.push(o, o, o, o)
  54952. }
  54953. Ci.LineSegments.call(this, i, n)
  54954. }
  54955. ,
  54956. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54957. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54958. Ci.GridHelper.prototype.setColors = function(e, t) {
  54959. this.color1.set(e),
  54960. this.color2.set(t),
  54961. this.geometry.colorsNeedUpdate = !0
  54962. }
  54963. ,
  54964. Ci.HemisphereLightHelper = function(e, t) {
  54965. Ci.Object3D.call(this),
  54966. this.light = e,
  54967. this.light.updateMatrixWorld(),
  54968. this.matrix = e.matrixWorld,
  54969. this.matrixAutoUpdate = !1,
  54970. this.colors = [new Ci.Color, new Ci.Color];
  54971. var i = new Ci.SphereGeometry(t,4,2);
  54972. i.rotateX(-Math.PI / 2);
  54973. for (var n = 0; n < 8; n++)
  54974. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54975. var r = new Ci.MeshBasicMaterial({
  54976. vertexColors: Ci.FaceColors,
  54977. wireframe: !0
  54978. });
  54979. this.lightSphere = new Ci.Mesh(i,r),
  54980. this.add(this.lightSphere),
  54981. this.update()
  54982. }
  54983. ,
  54984. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54985. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54986. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54987. this.lightSphere.geometry.dispose(),
  54988. this.lightSphere.material.dispose()
  54989. }
  54990. ,
  54991. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54992. function() {
  54993. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54994. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54995. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54996. this.lightSphere.geometry.colorsNeedUpdate = !0
  54997. }
  54998. ),
  54999. Ci.PointLightHelper = function(e, t) {
  55000. this.light = e,
  55001. this.light.updateMatrixWorld();
  55002. var i = new Ci.SphereGeometry(t,4,2)
  55003. , n = new Ci.MeshBasicMaterial({
  55004. wireframe: !0,
  55005. fog: !1
  55006. });
  55007. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55008. Ci.Mesh.call(this, i, n),
  55009. this.matrix = this.light.matrixWorld,
  55010. this.matrixAutoUpdate = !1
  55011. }
  55012. ,
  55013. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  55014. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  55015. Ci.PointLightHelper.prototype.dispose = function() {
  55016. this.geometry.dispose(),
  55017. this.material.dispose()
  55018. }
  55019. ,
  55020. Ci.PointLightHelper.prototype.update = function() {
  55021. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55022. }
  55023. ,
  55024. Ci.SkeletonHelper = function(e) {
  55025. this.bones = this.getBoneList(e);
  55026. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  55027. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  55028. t.vertices.push(new Ci.Vector3),
  55029. t.colors.push(new Ci.Color(0,0,1)),
  55030. t.colors.push(new Ci.Color(0,1,0)))
  55031. }
  55032. t.dynamic = !0;
  55033. var n = new Ci.LineBasicMaterial({
  55034. vertexColors: Ci.VertexColors,
  55035. depthTest: !1,
  55036. depthWrite: !1,
  55037. transparent: !0
  55038. });
  55039. Ci.LineSegments.call(this, t, n),
  55040. this.root = e,
  55041. this.matrix = e.matrixWorld,
  55042. this.matrixAutoUpdate = !1,
  55043. this.update()
  55044. }
  55045. ,
  55046. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55047. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  55048. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  55049. var t = [];
  55050. e instanceof Ci.Bone && t.push(e);
  55051. for (var i = 0; i < e.children.length; i++)
  55052. t.push.apply(t, this.getBoneList(e.children[i]));
  55053. return t
  55054. }
  55055. ,
  55056. Ci.SkeletonHelper.prototype.update = function() {
  55057. 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++) {
  55058. var o = this.bones[r];
  55059. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  55060. e.vertices[n].setFromMatrixPosition(i),
  55061. i.multiplyMatrices(t, o.parent.matrixWorld),
  55062. e.vertices[n + 1].setFromMatrixPosition(i),
  55063. n += 2)
  55064. }
  55065. e.verticesNeedUpdate = !0,
  55066. e.computeBoundingSphere()
  55067. }
  55068. ,
  55069. Ci.SpotLightHelper = function(e) {
  55070. Ci.Object3D.call(this),
  55071. this.light = e,
  55072. this.light.updateMatrixWorld(),
  55073. this.matrix = e.matrixWorld,
  55074. this.matrixAutoUpdate = !1;
  55075. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  55076. t.translate(0, -.5, 0),
  55077. t.rotateX(-Math.PI / 2);
  55078. var i = new Ci.MeshBasicMaterial({
  55079. wireframe: !0,
  55080. fog: !1
  55081. });
  55082. this.cone = new Ci.Mesh(t,i),
  55083. this.add(this.cone),
  55084. this.update()
  55085. }
  55086. ,
  55087. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55088. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  55089. Ci.SpotLightHelper.prototype.dispose = function() {
  55090. this.cone.geometry.dispose(),
  55091. this.cone.material.dispose()
  55092. }
  55093. ,
  55094. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  55095. oi = new Ci.Vector3,
  55096. function() {
  55097. var e = this.light.distance ? this.light.distance : 1e4
  55098. , t = e * Math.tan(this.light.angle);
  55099. this.cone.scale.set(t, t, e),
  55100. ri.setFromMatrixPosition(this.light.matrixWorld),
  55101. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  55102. this.cone.lookAt(oi.sub(ri)),
  55103. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55104. }
  55105. ),
  55106. Ci.VertexNormalsHelper = function(e, t, i, n) {
  55107. this.object = e,
  55108. this.size = void 0 !== t ? t : 1;
  55109. var r = void 0 !== i ? i : 16711680
  55110. , o = void 0 !== n ? n : 1
  55111. , a = 0
  55112. , s = this.object.geometry;
  55113. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  55114. var l = new Ci.BufferGeometry
  55115. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55116. l.addAttribute("position", c),
  55117. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55118. color: r,
  55119. linewidth: o
  55120. })),
  55121. this.matrixAutoUpdate = !1,
  55122. this.update()
  55123. }
  55124. ,
  55125. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55126. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  55127. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  55128. ii = new Ci.Vector3,
  55129. ni = new Ci.Matrix3,
  55130. function() {
  55131. var e = ["a", "b", "c"];
  55132. this.object.updateMatrixWorld(!0),
  55133. ni.getNormalMatrix(this.object.matrixWorld);
  55134. var t = this.object.matrixWorld
  55135. , i = this.geometry.attributes.position
  55136. , n = this.object.geometry;
  55137. if (n instanceof Ci.Geometry)
  55138. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  55139. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  55140. var d = r[c[e[h]]]
  55141. , p = c.vertexNormals[h];
  55142. ti.copy(d).applyMatrix4(t),
  55143. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55144. i.setXYZ(a, ti.x, ti.y, ti.z),
  55145. a += 1,
  55146. i.setXYZ(a, ii.x, ii.y, ii.z),
  55147. a += 1
  55148. }
  55149. else if (n instanceof Ci.BufferGeometry) {
  55150. var f = n.attributes.position
  55151. , g = n.attributes.normal;
  55152. for (h = a = 0,
  55153. u = f.count; h < u; h++)
  55154. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  55155. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  55156. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55157. i.setXYZ(a, ti.x, ti.y, ti.z),
  55158. a += 1,
  55159. i.setXYZ(a, ii.x, ii.y, ii.z),
  55160. a += 1
  55161. }
  55162. return i.needsUpdate = !0,
  55163. this
  55164. }
  55165. ),
  55166. Ci.WireframeHelper = function(e, t) {
  55167. var i = void 0 !== t ? t : 16777215;
  55168. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  55169. color: i
  55170. })),
  55171. this.matrix = e.matrixWorld,
  55172. this.matrixAutoUpdate = !1
  55173. }
  55174. ,
  55175. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55176. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  55177. Ci.ImmediateRenderObject = function(e) {
  55178. Ci.Object3D.call(this),
  55179. this.material = e,
  55180. this.render = function(e) {}
  55181. }
  55182. ,
  55183. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  55184. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  55185. Ci.MorphBlendMesh = function(e, t) {
  55186. Ci.Mesh.call(this, e, t),
  55187. this.animationsMap = {},
  55188. this.animationsList = [];
  55189. var i = this.geometry.morphTargets.length
  55190. , n = i - 1
  55191. , r = i / 1;
  55192. this.createAnimation("__default", 0, n, r),
  55193. this.setAnimationWeight("__default", 1)
  55194. }
  55195. ,
  55196. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  55197. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  55198. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55199. var r = {
  55200. start: t,
  55201. end: i,
  55202. length: i - t + 1,
  55203. fps: n,
  55204. duration: (i - t) / n,
  55205. lastFrame: 0,
  55206. currentFrame: 0,
  55207. active: !1,
  55208. time: 0,
  55209. direction: 1,
  55210. weight: 1,
  55211. directionBackwards: !1,
  55212. mirroredLoop: !1
  55213. };
  55214. this.animationsMap[e] = r,
  55215. this.animationsList.push(r)
  55216. }
  55217. ,
  55218. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55219. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55220. var s = r.morphTargets[o].name.match(i);
  55221. if (s && 1 < s.length)
  55222. n[l = s[1]] || (n[l] = {
  55223. start: 1 / 0,
  55224. end: -1 / 0
  55225. }),
  55226. o < (c = n[l]).start && (c.start = o),
  55227. o > c.end && (c.end = o),
  55228. t = t || l
  55229. }
  55230. for (var l in n) {
  55231. var c = n[l];
  55232. this.createAnimation(l, c.start, c.end, e)
  55233. }
  55234. this.firstAnimation = t
  55235. }
  55236. ,
  55237. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55238. var t = this.animationsMap[e];
  55239. t && (t.direction = 1,
  55240. t.directionBackwards = !1)
  55241. }
  55242. ,
  55243. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55244. var t = this.animationsMap[e];
  55245. t && (t.direction = -1,
  55246. t.directionBackwards = !0)
  55247. }
  55248. ,
  55249. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55250. var i = this.animationsMap[e];
  55251. i && (i.fps = t,
  55252. i.duration = (i.end - i.start) / i.fps)
  55253. }
  55254. ,
  55255. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55256. var i = this.animationsMap[e];
  55257. i && (i.duration = t,
  55258. i.fps = (i.end - i.start) / i.duration)
  55259. }
  55260. ,
  55261. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55262. var i = this.animationsMap[e];
  55263. i && (i.weight = t)
  55264. }
  55265. ,
  55266. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55267. var i = this.animationsMap[e];
  55268. i && (i.time = t)
  55269. }
  55270. ,
  55271. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55272. var t = 0
  55273. , i = this.animationsMap[e];
  55274. return i && (t = i.time),
  55275. t
  55276. }
  55277. ,
  55278. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55279. var t = -1
  55280. , i = this.animationsMap[e];
  55281. return i && (t = i.duration),
  55282. t
  55283. }
  55284. ,
  55285. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55286. var t = this.animationsMap[e];
  55287. t ? (t.time = 0,
  55288. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55289. }
  55290. ,
  55291. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55292. var t = this.animationsMap[e];
  55293. t && (t.active = !1)
  55294. }
  55295. ,
  55296. Ci.MorphBlendMesh.prototype.update = function(e) {
  55297. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55298. var n = this.animationsList[t];
  55299. if (n.active) {
  55300. var r = n.duration / n.length;
  55301. n.time += n.direction * e,
  55302. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55303. n.time > n.duration && (n.time = n.duration,
  55304. n.directionBackwards = !0),
  55305. n.time < 0 && (n.time = 0,
  55306. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55307. n.time < 0 && (n.time += n.duration));
  55308. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55309. , a = n.weight;
  55310. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55311. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55312. this.morphTargetInfluences[o] = 0,
  55313. n.lastFrame = n.currentFrame,
  55314. n.currentFrame = o);
  55315. var s = n.time % r / r;
  55316. n.directionBackwards && (s = 1 - s),
  55317. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55318. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55319. }
  55320. }
  55321. }
  55322. ,
  55323. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55324. i.THREE = Ci) : this.THREE = Ci
  55325. window.THREE = Ci
  55326. getObjLoader()
  55327. initByTHREE(THREE)
  55328. }
  55329. , {}]
  55330. }, {}, [116]);