main_2020_edit.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658
  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. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3298. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3299. var screenSize = Math.min($("#player").width(), $("#player").height())
  3300. var maxSize = 800;//模型最大占据像素
  3301. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3302. absoluteScale = n / 2 / l.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3303. }else{
  3304. var t = Math.max(modelSize.x, modelSize.z)
  3305. , i = Math.min(modelSize.x, modelSize.z)
  3306. , n = Math.max(t, i * this.camera.aspect)
  3307. , r = Math.max(i, t * this.camera.aspect);
  3308. absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * defaultRatio
  3309. }
  3310. return absoluteScale
  3311. },
  3312. n.prototype.rotateToView = function(modelSize, direction) {
  3313. let i = 0, n = p.aspectRatio() < 1 //是否模型尺寸显“细长”
  3314. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3315. i = parseFloat(_settings.floorPlanAngle)
  3316. }else{
  3317. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3318. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3319. {
  3320. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3321. {
  3322. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3323. }
  3324. //(第二种情况) 不做处理
  3325. }
  3326. else if(direction.x > 0)
  3327. {
  3328. i = Math.PI / 2;
  3329. }
  3330. else
  3331. {
  3332. i = -Math.PI / 2;
  3333. }
  3334. }
  3335. this.rotateLeft(i);
  3336. this.update(0);
  3337. }
  3338. ,
  3339. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3340. this.rotateLeft(angle + this.lon);
  3341. this.update(0);
  3342. }
  3343. ,
  3344. n.prototype.pan = function(e, t) {
  3345. this.camera.updateMatrix(),
  3346. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3347. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3348. }
  3349. ,
  3350. n.prototype.updateZoom = function() {
  3351. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3352. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3353. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3354. this.camera.left = -l.orthoBase * this.currentScale,
  3355. this.camera.right = l.orthoBase * this.currentScale,
  3356. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3357. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3358. this.camera.updateProjectionMatrix(),
  3359. this.offset.length()
  3360. }
  3361. ,
  3362. n.prototype.toJSON = (r = new s.Quaternion,
  3363. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3364. a = new s.Quaternion,
  3365. function() {
  3366. var e = c.prototype.toJSON.call(this);
  3367. return r.copy(e.camera_quaternion),
  3368. a.copy(o),
  3369. a.multiply(r),
  3370. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3371. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3372. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3373. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3374. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3375. e
  3376. }
  3377. ),
  3378. t.exports = n
  3379. }
  3380. , {
  3381. "../enum/ControlActions": 20,
  3382. "../enum/MouseButton": 34,
  3383. "../settings": 166,
  3384. "../util/browser": 182,
  3385. "../util/math": 190,
  3386. "./OutsideControls": 12,
  3387. three: 217
  3388. }],
  3389. 12: [function(e, t, i) {
  3390. "use strict";
  3391. function n(e) {
  3392. this.camera = e,
  3393. (this.camera.controls = this).enabled = !1,
  3394. this.target = new a.Vector3,
  3395. this.targetBounds = new a.Box3,
  3396. this.zoomSpeed = 2,//编辑时缩放快一些
  3397. this.minDistance = 0,
  3398. this.maxDistance = 1 / 0,
  3399. this.noRotateUpDown = !1,
  3400. this.rotateSpeed = 1,
  3401. this.keyboardZoomSpeed = 0,
  3402. this.keyPanSpeed = 7,
  3403. this.autoRotate = !1,
  3404. this.autoRotateSpeed = 2,
  3405. this.autoPan = !1,
  3406. this.autoPanPosition = new a.Vector3,
  3407. this.minPolarAngle = a.Math.degToRad(25),
  3408. this.maxPolarAngle = a.Math.degToRad(65),
  3409. this.rotationAcceleration = new a.Vector2,
  3410. this.rotationSpeed = new a.Vector2,
  3411. this.panAcceleration = new a.Vector2,
  3412. this.panSpeed = new a.Vector2,
  3413. this.rotateStart = new a.Vector2,
  3414. this.rotateEnd = new a.Vector2,
  3415. this.rotateDelta = new a.Vector2,
  3416. this.panStart = new a.Vector2,
  3417. this.panEnd = new a.Vector2,
  3418. this.panDelta = new a.Vector2,
  3419. this.panOffset = new a.Vector3,
  3420. this.offset = new a.Vector3,
  3421. this.dollyStart = new a.Vector2,
  3422. this.dollyEnd = new a.Vector2,
  3423. this.dollyDelta = new a.Vector2,
  3424. this.phiDelta = 0,
  3425. this.thetaDelta = 0,
  3426. this.scale = 1,
  3427. this.panVector = new a.Vector3,
  3428. this.lastPosition = new a.Vector3,
  3429. this.state = u.NONE,
  3430. this.mouseActions = {},
  3431. this.mouseActions[d.LEFT] = u.ROTATE,
  3432. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3433. this.mouseActions[d.RIGHT] = u.PAN,
  3434. this.touchActions = {},
  3435. this.touchActions[1] = u.ROTATE,
  3436. this.touchActions[2] = u.PAN_DOLLY,
  3437. this.lastMoveTime = 0,
  3438. this.pointersLimit = 2,
  3439. this.pointers = []
  3440. }
  3441. 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;
  3442. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3443. this.targetBounds = e
  3444. }
  3445. ,
  3446. n.prototype.isEngaged = function() {
  3447. return this.state !== u.NONE
  3448. }
  3449. ,
  3450. n.prototype.rotateLeft = function(e) {
  3451. void 0 === e && (e = this.getAutoRotationAngle()),
  3452. this.thetaDelta -= e
  3453. }
  3454. ,
  3455. n.prototype.rotateUp = function(e) {
  3456. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3457. this.phiDelta -= e)
  3458. }
  3459. ,
  3460. n.prototype.panLeft = function(e) {
  3461. var t = this.camera.matrix.elements;
  3462. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3463. this.panOffset.multiplyScalar(-e),
  3464. this.panVector.add(this.panOffset)
  3465. }
  3466. ,
  3467. n.prototype.panUp = function(e) {
  3468. var t = this.camera.matrix.elements;
  3469. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3470. this.panOffset.multiplyScalar(-e),
  3471. this.panVector.add(this.panOffset)
  3472. }
  3473. ,
  3474. n.prototype.startRotating = function(e, t) {
  3475. e && this.navRotationAcc("x", e),
  3476. t && this.navRotationAcc("y", t)
  3477. }
  3478. ,
  3479. n.prototype.stopRotating = function(e) {
  3480. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3481. this.navRotationAcc("x", 0),
  3482. this.navRotationAcc("y", 0)
  3483. }
  3484. ,
  3485. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3486. o = new a.Vector3,
  3487. function(e, t) {
  3488. r.copy(this.camera.position),
  3489. void 0 === e && null === e || r.setX(e),
  3490. void 0 === t && null === t || r.setZ(t);
  3491. var i = this.camera.position.distanceTo(this.target)
  3492. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3493. this.targetClamped = !1,
  3494. o.copy(r).addScaledVector(n, i),
  3495. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3496. r.copy(o).addScaledVector(n, -i),
  3497. this.targetClamped = !0),
  3498. this.autoPanPosition.x = r.x,
  3499. this.autoPanPosition.z = r.z,
  3500. this.autoPan && this.stopAutoPanning()
  3501. }
  3502. ),
  3503. n.prototype.stopAutoPanning = function() {
  3504. var e = this.autoPan;
  3505. this.autoPan = !1,
  3506. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3507. }
  3508. ,
  3509. n.prototype.dollyIn = function(e) {
  3510. void 0 === e && (e = this.getZoomScale()),
  3511. this.scale /= e
  3512. }
  3513. ,
  3514. n.prototype.dollyOut = function(e) {
  3515. void 0 === e && (e = this.getZoomScale()),
  3516. this.scale *= e
  3517. }
  3518. ,
  3519. n.prototype.updatePan = function(e) {
  3520. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3521. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3522. this.autoPan) {
  3523. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3524. t.setY(0).clampLength(0, 50 * e),
  3525. this.target.add(t),
  3526. this.camera.position.add(t),
  3527. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3528. this.stopAutoPanning())
  3529. }
  3530. }
  3531. ,
  3532. n.prototype.update = function(e) {
  3533. e = e || 1 / 60,
  3534. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3535. this.rotateLeft(-this.rotationSpeed.x),
  3536. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3537. this.updatePan(e);
  3538. var t = this.camera.position;
  3539. this.offset.copy(t).sub(this.target);
  3540. var i = Math.atan2(this.offset.x, this.offset.z)
  3541. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3542. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3543. i += this.thetaDelta,
  3544. n += this.phiDelta,
  3545. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3546. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3547. this.lon = i, this.lat = n//add
  3548. var r = this.updateZoom();
  3549. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3550. this.target.add(this.panVector),
  3551. this.targetBounds.clampPoint(this.target, this.target),
  3552. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3553. this.offset.y = r * Math.cos(n),
  3554. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3555. t.copy(this.target).add(this.offset),
  3556. this.camera.lookAt(this.target),
  3557. this.thetaDelta = 0,
  3558. this.phiDelta = 0,
  3559. this.scale = 1,
  3560. this.panVector.set(0, 0, 0),
  3561. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3562. }
  3563. ,
  3564. n.prototype.getAutoRotationAngle = function() {
  3565. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3566. }
  3567. ,
  3568. n.prototype.getZoomScale = function() {
  3569. return Math.pow(.95, this.zoomSpeed)
  3570. }
  3571. ,
  3572. n.prototype.onMouseDown = function(e) {
  3573. if (this.enabled) {
  3574. switch (e.preventDefault(),
  3575. this.stopAutoPanning(),
  3576. this.mouseDown = !0,
  3577. this.state = this.mouseActions[e.button],
  3578. this.state) {
  3579. case u.ROTATE:
  3580. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3581. this.rotationSpeed.set(0, 0);
  3582. break;
  3583. case u.DOLLY:
  3584. this.dollyStart.set(e.clientX, e.clientY);
  3585. break;
  3586. case u.PAN:
  3587. this.panStart.set(e.clientX, e.clientY)
  3588. }
  3589. this.emit(f.InputStart, "mouse")
  3590. }
  3591. }
  3592. ,
  3593. n.prototype.onMouseMove = function(e) {
  3594. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3595. switch (e.preventDefault(),
  3596. this.state) {
  3597. case u.ROTATE:
  3598. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3599. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3600. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3601. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3602. this.rotateStart.copy(this.rotateEnd);
  3603. break;
  3604. case u.DOLLY:
  3605. this.dollyEnd.set(e.clientX, e.clientY),
  3606. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3607. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3608. this.dollyStart.copy(this.dollyEnd);
  3609. break;
  3610. case u.PAN:
  3611. this.panEnd.set(e.clientX, e.clientY),
  3612. this.panDelta.subVectors(this.panEnd, this.panStart),
  3613. this.pan(this.panDelta.x, this.panDelta.y),
  3614. this.panStart.copy(this.panEnd)
  3615. }
  3616. this.emit(f.Move, "mouse"),
  3617. this.lastMoveTime = e.timeStamp,
  3618. this.update()
  3619. }
  3620. }
  3621. ,
  3622. n.prototype.onMouseUp = function(e) {
  3623. this.enabled && (this.mouseDown = !1,
  3624. this.state = u.NONE,
  3625. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3626. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3627. this.update(),
  3628. this.rotationAcceleration.set(0, 0),
  3629. this.rotateDelta.set(0, 0)))
  3630. }
  3631. ,
  3632. n.prototype.onMouseOver = function(e) {
  3633. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3634. }
  3635. ,
  3636. n.prototype.onMouseWheel = function(e) {
  3637. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3638. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3639. this.update())
  3640. }
  3641. ,
  3642. n.prototype.onKeyDown = function(e) {
  3643. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3644. this.handleKeyDown(e.which)))
  3645. }
  3646. ,
  3647. n.prototype.navRotationAcc = function(e, t) {
  3648. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3649. }
  3650. ,
  3651. n.prototype.navPanAcc = function(e, t) {
  3652. this.stopAutoPanning(),
  3653. this.panAcceleration[e] = t
  3654. }
  3655. ,
  3656. n.prototype.handleKeyDown = function(e) {
  3657. var t = !0;
  3658. switch (e) {
  3659. case p.UPARROW:
  3660. case p.I:
  3661. this.navRotationAcc("y", 1);
  3662. break;
  3663. case p.DOWNARROW:
  3664. case p.K:
  3665. this.navRotationAcc("y", -1);
  3666. break;
  3667. case p.LEFTARROW:
  3668. case p.J:
  3669. this.navRotationAcc("x", -1);
  3670. break;
  3671. case p.RIGHTARROW:
  3672. case p.L:
  3673. this.navRotationAcc("x", 1);
  3674. break;
  3675. case p.W:
  3676. this.navPanAcc("y", 1);
  3677. break;
  3678. case p.S:
  3679. this.navPanAcc("y", -1);
  3680. break;
  3681. case p.A:
  3682. this.navPanAcc("x", -1);
  3683. break;
  3684. case p.D:
  3685. this.navPanAcc("x", 1);
  3686. break;
  3687. default:
  3688. t = !1
  3689. }
  3690. t && this.emit(f.Move, "key")
  3691. }
  3692. ,
  3693. n.prototype.onKeyUp = function(e) {
  3694. this.enabled && (e.preventDefault(),
  3695. e.stopPropagation(),
  3696. this.handleKeyUp(e.which))
  3697. }
  3698. ,
  3699. n.prototype.handleKeyUp = function(e) {
  3700. switch (e) {
  3701. case p.I:
  3702. case p.K:
  3703. case p.UPARROW:
  3704. case p.DOWNARROW:
  3705. this.keyboardZoomSpeed = 0,
  3706. this.rotationAcceleration.y = 0;
  3707. break;
  3708. case p.J:
  3709. case p.L:
  3710. case p.LEFTARROW:
  3711. case p.RIGHTARROW:
  3712. this.rotationAcceleration.x = 0;
  3713. break;
  3714. case p.S:
  3715. case p.W:
  3716. this.panAcceleration.y = 0;
  3717. break;
  3718. case p.A:
  3719. case p.D:
  3720. this.panAcceleration.x = 0
  3721. }
  3722. }
  3723. ,
  3724. n.prototype.onTouchStart = function(i) {
  3725. if (this.enabled || this.state === u.NONE) {
  3726. i.preventDefault(),
  3727. i.stopPropagation(),
  3728. this.stopAutoPanning();
  3729. var e = function() {
  3730. if (2 === i.touches.length) {
  3731. var e = i.touches[0].pageX - i.touches[1].pageX
  3732. , t = i.touches[0].pageY - i.touches[1].pageY;
  3733. this.dollyStart.set(e, t)
  3734. }
  3735. }
  3736. .bind(this)
  3737. , t = function() {
  3738. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3739. }
  3740. .bind(this)
  3741. , n = function() {
  3742. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3743. }
  3744. .bind(this);
  3745. switch (this.state = this.touchActions[i.touches.length],
  3746. this.state) {
  3747. case u.PAN_DOLLY:
  3748. e();
  3749. case u.PAN:
  3750. t();
  3751. break;
  3752. case u.ROTATE_DOLLY:
  3753. e();
  3754. case u.ROTATE:
  3755. n()
  3756. }
  3757. this.rotationSpeed.set(0, 0),
  3758. this.emit(f.InputStart, "touch")
  3759. }
  3760. }
  3761. ,
  3762. n.prototype.onTouchMove = function(a) {
  3763. if (this.enabled && this.state !== u.NONE) {
  3764. a.preventDefault(),
  3765. a.stopPropagation();
  3766. var s = function() {
  3767. var e = a.touches[0].pageX - a.touches[1].pageX
  3768. , t = a.touches[0].pageY - a.touches[1].pageY;
  3769. this.dollyEnd.set(e, t);
  3770. var i = this.dollyStart.length() - this.dollyEnd.length();
  3771. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3772. this.dollyStart.copy(this.dollyEnd)
  3773. }
  3774. .bind(this)
  3775. , e = function() {
  3776. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3777. this.panDelta.subVectors(this.panEnd, this.panStart),
  3778. this.pan(this.panDelta.x, this.panDelta.y),
  3779. this.panStart.copy(this.panEnd),
  3780. this.rotateDelta.set(0, 0)
  3781. }
  3782. .bind(this)
  3783. , l = function() {
  3784. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3785. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3786. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3787. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3788. this.rotateStart.copy(this.rotateEnd)
  3789. }
  3790. .bind(this)
  3791. , t = function() {
  3792. if (2 === a.touches.length) {
  3793. var e = window.devicePixelRatio || 1
  3794. , t = a.touches[1].pageX - a.touches[0].pageX
  3795. , i = a.touches[1].pageY - a.touches[0].pageY
  3796. , n = Math.sqrt(t * t + i * i);
  3797. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3798. this.state = u.DOLLY,
  3799. s();
  3800. else {
  3801. var r = h.average(a.touches, "pageX")
  3802. , o = h.average(a.touches, "pageY");
  3803. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3804. this.rotateStart.set(r, o),
  3805. l())
  3806. }
  3807. }
  3808. }
  3809. .bind(this);
  3810. switch (this.state) {
  3811. case u.PAN_DOLLY:
  3812. s();
  3813. case u.PAN:
  3814. e();
  3815. break;
  3816. case u.ROTATE_DOLLY:
  3817. t();
  3818. break;
  3819. case u.DOLLY:
  3820. s();
  3821. break;
  3822. case u.ROTATE:
  3823. l();
  3824. break;
  3825. default:
  3826. this.state = u.NONE
  3827. }
  3828. this.lastMoveTime = a.timeStamp,
  3829. this.emit(f.Move, "touch")
  3830. }
  3831. }
  3832. ,
  3833. n.prototype.onTouchEnd = function(e) {
  3834. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3835. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3836. this.state = u.NONE,
  3837. this.update(),
  3838. this.rotationAcceleration.set(0, 0),
  3839. this.rotateDelta.set(0, 0))
  3840. }
  3841. ,
  3842. n.prototype.onPointerDown = function(e) {
  3843. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3844. id: e.pointerId,
  3845. pageX: e.pageX,
  3846. pageY: e.pageY
  3847. }),
  3848. e.touches = this.pointers,
  3849. this.onTouchStart(e)),
  3850. this.emit(f.InputStart, "pointer"))
  3851. }
  3852. ,
  3853. n.prototype.onPointerMove = function(t) {
  3854. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3855. t.pointerId === e.id && (e.pageX = t.pageX,
  3856. e.pageY = t.pageY)
  3857. }),
  3858. t.touches = this.pointers,
  3859. this.onTouchMove(t))
  3860. }
  3861. ,
  3862. n.prototype.onPointerUp = function(i) {
  3863. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3864. i.pointerId === e.id && this.pointers.splice(t, 1)
  3865. }
  3866. .bind(this)),
  3867. i.touches = this.pointers,
  3868. this.onTouchEnd(i))
  3869. }
  3870. ,
  3871. n.prototype.reset = function() {
  3872. this.state = u.NONE,
  3873. this.stopAutoPanning(),
  3874. this.rotationSpeed.set(0, 0),
  3875. this.rotationAcceleration.set(0, 0),
  3876. this.panSpeed.set(0, 0),
  3877. this.panAcceleration.set(0, 0)
  3878. }
  3879. ,
  3880. n.prototype.toJSON = function() {
  3881. return {
  3882. camera_position: {
  3883. x: s.toPrecision(this.camera.position.x, 4),
  3884. y: s.toPrecision(this.camera.position.y, 4),
  3885. z: s.toPrecision(this.camera.position.z, 4)
  3886. },
  3887. camera_quaternion: {
  3888. x: s.toPrecision(this.camera.quaternion.x, 4),
  3889. y: s.toPrecision(this.camera.quaternion.y, 4),
  3890. z: s.toPrecision(this.camera.quaternion.z, 4),
  3891. w: s.toPrecision(this.camera.quaternion.w, 4)
  3892. }
  3893. }
  3894. }
  3895. ,
  3896. t.exports = n
  3897. }
  3898. , {
  3899. "../enum/ControlActions": 20,
  3900. "../enum/ControlEvents": 21,
  3901. "../enum/Keys": 30,
  3902. "../enum/MouseButton": 34,
  3903. "../enum/Vectors": 50,
  3904. "../settings": 166,
  3905. "../util/common": 185,
  3906. "../util/math": 190,
  3907. events: 202,
  3908. three: 217
  3909. }],
  3910. 13: [function(u, d, e) {
  3911. (function(e) {
  3912. "use strict";
  3913. function t(e) {
  3914. this.camera = e,
  3915. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3916. this.lookVector = new s.Vector3,
  3917. this.lookSpeed = .05,
  3918. this.rotationAcc = new s.Vector2,
  3919. this.rotationSpeed = new s.Vector2,
  3920. this.lat = 0,
  3921. this.lon = 0,
  3922. this.phi = 0,
  3923. this.theta = 0,
  3924. this.enabled = !1,
  3925. this.locked = !1,
  3926. this.pointer = new s.Vector2(0,0),
  3927. this.rotationHistory = [],
  3928. this.rotationDifference = new s.Vector2,
  3929. this.pointerDragOn = !1,
  3930. this.pointerDragStart = new s.Vector2(0,0),
  3931. this.pinchDistance = 0,
  3932. this.moveStart = new s.Vector2,
  3933. this.moveTolerance = .01,
  3934. this.pointersLimit = 2,
  3935. this.pointers = []
  3936. //watch(this, 'enabled', this.enabled)
  3937. }
  3938. var s = u("three")
  3939. , i = u("../util/logger")
  3940. , n = u("../settings")
  3941. , r = u("../util/common")
  3942. , o = u("../util/math")
  3943. , a = (u("../enum/Vectors"),
  3944. u("../enum/MouseButton"))
  3945. , l = u("../enum/Keys")
  3946. , c = u("../enum/ControlEvents")
  3947. , h = u("events").EventEmitter;
  3948. new i(e),
  3949. (t.prototype = Object.create(h.prototype)).usable = function() {
  3950. return this.enabled && !this.locked
  3951. }
  3952. ,
  3953. /* t.prototype.lookAt = function(e) {
  3954. var t = this.camera.position.clone().sub(e)
  3955. , i = Math.atan(t.z / t.x);
  3956. i += t.x < 0 ? Math.PI : 0,
  3957. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3958. this.lon = s.Math.radToDeg(i) + 180;
  3959. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3960. , r = Math.atan(t.y / n);
  3961. this.lat = -s.Math.radToDeg(r)
  3962. } */
  3963. t.prototype.lookAt = function(aim, dir) {
  3964. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  3965. var i = Math.atan(t.z / t.x);
  3966. i += t.x < 0 ? Math.PI : 0;
  3967. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  3968. this.lon = s.Math.radToDeg(i) + 180;
  3969. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  3970. o = Math.atan(t.y / n);
  3971. this.lat = -s.Math.radToDeg(o);
  3972. }
  3973. ,
  3974. t.prototype.startRotationFrom = function(e, t) {
  3975. o.convertScreenPositionToNDC(e, t, this.pointer),
  3976. this.pointerDragOn = !0,
  3977. this.pointerDragStart.copy(this.pointer),
  3978. this.moveStart.copy(this.pointer),
  3979. this.rotationHistory = [],
  3980. this.rotationSpeed.set(0, 0)
  3981. }
  3982. ,
  3983. t.prototype.onMouseOver = function(e) {
  3984. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3985. }
  3986. ,
  3987. t.prototype.onTouchStart = function(e) {
  3988. if (this.usable()) {
  3989. switch (e.preventDefault(),
  3990. e.stopPropagation(),
  3991. e.touches.length) {
  3992. case 1:
  3993. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3994. break;
  3995. case 2:
  3996. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3997. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3998. this.pinchDistance = Math.sqrt(t * t + i * i)
  3999. }
  4000. this.emit(c.InputStart, "touch")
  4001. }
  4002. }
  4003. ,
  4004. t.prototype.onPointerDown = function(e) {
  4005. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4006. id: e.pointerId,
  4007. clientX: e.clientX,
  4008. clientY: e.clientY
  4009. }),
  4010. e.touches = this.pointers,
  4011. this.onTouchStart(e),
  4012. this.emit(c.InputStart, "pointer"))
  4013. }
  4014. ,
  4015. t.prototype.onMouseDown = function(e) {
  4016. if (this.usable()) {
  4017. switch (e.preventDefault(),
  4018. e.stopPropagation(),
  4019. e.button) {
  4020. case a.LEFT:
  4021. this.startRotationFrom(e.clientX, e.clientY)
  4022. }
  4023. this.emit(c.InputStart, "mouse")
  4024. }
  4025. }
  4026. ,
  4027. t.prototype.updateRotation = function() {
  4028. if (this.usable() && this.pointerDragOn) {
  4029. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4030. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4031. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4032. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4033. , r = Math.atan2(e.y, i)
  4034. , o = Math.atan2(t.y, n);
  4035. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4036. e.y = 0,
  4037. t.y = 0;
  4038. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4039. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4040. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4041. this.pointerDragStart.copy(this.pointer)
  4042. }
  4043. }
  4044. ,
  4045. t.prototype.onMouseMove = function(e) {
  4046. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4047. 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"))
  4048. }
  4049. ,
  4050. t.prototype.onTouchMove = function(e) {
  4051. if (this.usable())
  4052. switch (this.emit(c.Move, "touch"),
  4053. e.touches.length) {
  4054. case 1:
  4055. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4056. break;
  4057. case 2:
  4058. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4059. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4060. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4061. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4062. this.emit(c.Pinch, n),
  4063. this.pinchDistance -= n)
  4064. }
  4065. }
  4066. ,
  4067. t.prototype.onPointerMove = function(t) {
  4068. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4069. t.pointerId === e.id && (e.clientX = t.clientX,
  4070. e.clientY = t.clientY)
  4071. }),
  4072. t.touches = this.pointers,
  4073. this.onTouchMove(t))
  4074. }
  4075. ,
  4076. t.prototype.endRotation = function() {
  4077. this.pointerDragOn = !1;
  4078. var e = r.averageVectors(this.rotationHistory);
  4079. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4080. }
  4081. ,
  4082. t.prototype.onTouchEnd = function(e) {
  4083. this.usable() && (e.preventDefault(),
  4084. e.stopPropagation(),
  4085. this.endRotation())
  4086. }
  4087. ,
  4088. t.prototype.onMouseUp = function(e) {
  4089. this.usable() && (e.preventDefault(),
  4090. e.stopPropagation(),
  4091. this.endRotation())
  4092. }
  4093. ,
  4094. t.prototype.onPointerUp = function(i) {
  4095. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4096. i.pointerId === e.id && this.pointers.splice(t, 1)
  4097. }
  4098. .bind(this)),
  4099. i.touches = this.pointers,
  4100. this.onTouchEnd(i))
  4101. }
  4102. ,
  4103. t.prototype.update = function(e) {
  4104. for (this.lon,
  4105. this.lat,
  4106. this.updateRotation(),
  4107. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4108. this.rotationHistory.shift();
  4109. this.lon += this.rotationDifference.x,
  4110. this.lat += this.rotationDifference.y,
  4111. this.rotationDifference.set(0, 0),
  4112. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4113. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4114. this.lon += this.rotationSpeed.x * e,
  4115. this.lat += this.rotationSpeed.y * e
  4116. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4117. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4118. 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 );
  4119. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4120. this.phi = s.Math.degToRad(90 - this.lat),
  4121. this.theta = s.Math.degToRad(this.lon),
  4122. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4123. this.lookVector.y = Math.cos(this.phi),
  4124. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4125. this.target.copy(this.lookVector).add(this.camera.position),
  4126. this.camera.lookAt(this.target)
  4127. }
  4128. ,
  4129. t.prototype.onMouseWheel = function(e) {
  4130. if (this.usable()) {
  4131. var t = e.wheelDelta || -e.detail;
  4132. this.emit(c.InteractionDirect),
  4133. this.emit(c.Scroll, t)
  4134. }
  4135. }
  4136. ,
  4137. t.prototype.onKeyDown = function(e) {
  4138. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4139. this.handleKeyDown(e.which)))
  4140. }
  4141. ,
  4142. t.prototype.handleKeyDown = function(e) {
  4143. var t = function(e, t) {
  4144. this.rotationAcc[e] = t
  4145. }
  4146. .bind(this);
  4147. this.emit(c.InteractionKey);
  4148. var i = !0;
  4149. switch (e) {
  4150. case l.LEFTARROW:
  4151. case l.J:
  4152. t("x", -1);
  4153. break;
  4154. case l.RIGHTARROW:
  4155. case l.L:
  4156. t("x", 1);
  4157. break;
  4158. case l.I:
  4159. t("y", 1);
  4160. break;
  4161. case l.K:
  4162. t("y", -1);
  4163. break;
  4164. default:
  4165. i = !1
  4166. }
  4167. i && this.emit(c.Move, "key")
  4168. }
  4169. ,
  4170. t.prototype.onKeyUp = function(e) {
  4171. this.usable() && (e.preventDefault(),
  4172. e.stopPropagation(),
  4173. this.handleKeyUp(e.which))
  4174. }
  4175. ,
  4176. t.prototype.handleKeyUp = function(e) {
  4177. switch (e) {
  4178. case l.LEFTARROW:
  4179. case l.J:
  4180. case l.RIGHTARROW:
  4181. case l.L:
  4182. this.rotationAcc.x = 0;
  4183. break;
  4184. case l.I:
  4185. case l.K:
  4186. this.rotationAcc.y = 0
  4187. }
  4188. }
  4189. ,
  4190. t.prototype.startRotating = function(e, t) {
  4191. e && (this.rotationAcc.x = e),
  4192. t && (this.rotationAcc.y = t)
  4193. }
  4194. ,
  4195. t.prototype.stopRotating = function(e) {
  4196. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4197. this.rotationAcc.set(0, 0)
  4198. }
  4199. ,
  4200. t.prototype.reset = function() {
  4201. this.pointerDragOn = !1,
  4202. this.rotationAcc.set(0, 0),
  4203. this.rotationSpeed.set(0, 0),
  4204. this.pointers = []
  4205. }
  4206. ,
  4207. t.prototype.toJSON = function() {
  4208. return {
  4209. camera_position: {
  4210. x: o.toPrecision(this.camera.position.x, 4),
  4211. y: o.toPrecision(this.camera.position.y, 4),
  4212. z: o.toPrecision(this.camera.position.z, 4)
  4213. },
  4214. camera_quaternion: {
  4215. x: o.toPrecision(this.camera.quaternion.x, 4),
  4216. y: o.toPrecision(this.camera.quaternion.y, 4),
  4217. z: o.toPrecision(this.camera.quaternion.z, 4),
  4218. w: o.toPrecision(this.camera.quaternion.w, 4)
  4219. }
  4220. }
  4221. }
  4222. ,
  4223. t.prototype.setStateFromJSON = function(e) {
  4224. this.camera.position.copy(e.camera_position),
  4225. this.camera.quaternion.copy(e.camera_quaternion)
  4226. }
  4227. ,
  4228. d.exports = t
  4229. }
  4230. ).call(this, "/js/controls/PanoramaControls.js")
  4231. }
  4232. , {
  4233. "../enum/ControlEvents": 21,
  4234. "../enum/Keys": 30,
  4235. "../enum/MouseButton": 34,
  4236. "../enum/Vectors": 50,
  4237. "../settings": 166,
  4238. "../util/common": 185,
  4239. "../util/logger": 189,
  4240. "../util/math": 190,
  4241. events: 202,
  4242. three: 217
  4243. }],
  4244. 14: [function(t, i, e) {
  4245. (function(e) {
  4246. "use strict";
  4247. var c = t("three")
  4248. , h = t("../enum/Viewmode")
  4249. , u = new (t("../util/logger"))(e);
  4250. i.exports = {
  4251. serialize: function(e) {
  4252. return encodeURI(JSON.stringify(e))
  4253. },
  4254. deserialize: function(e) {
  4255. function t(e) {
  4256. return e.reduce(function(e, t) {
  4257. return e && "number" == typeof t && !isNaN(t)
  4258. }, !0)
  4259. }
  4260. try {
  4261. var i = JSON.parse(decodeURI(e))
  4262. , n = {
  4263. mode: h.fromInt(i.camera_mode),
  4264. panoId: i.scan_id,
  4265. position: (new c.Vector3).copy(i.camera_position),
  4266. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4267. zoom: i.ortho_zoom,
  4268. floorVisibility: i.floor_visibility
  4269. }
  4270. , r = n.position;
  4271. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4272. var o = n.quaternion;
  4273. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4274. n
  4275. } catch (i) {
  4276. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4277. try {
  4278. var a = e.split(",")
  4279. , s = {
  4280. x: parseFloat(a[2]),
  4281. y: parseFloat(a[3]),
  4282. z: parseFloat(a[4])
  4283. }
  4284. , l = {
  4285. x: parseFloat(a[5]),
  4286. y: parseFloat(a[6]),
  4287. z: parseFloat(a[7]),
  4288. w: parseFloat(a[8])
  4289. };
  4290. return t([s.x, s.y, s.z]) || (s.x = 0,
  4291. s.y = 0,
  4292. s.z = 0),
  4293. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4294. l.y = 0,
  4295. l.z = 0,
  4296. l.w = 1),
  4297. {
  4298. mode: h.fromInt(a[0]),
  4299. panoId: a[1],
  4300. position: (new c.Vector3).copy(s),
  4301. quaternion: (new c.Quaternion).copy(l)
  4302. }
  4303. } catch (t) {
  4304. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4305. }
  4306. }
  4307. return null
  4308. }
  4309. }
  4310. }
  4311. ).call(this, "/js/controls/serializer.js")
  4312. }
  4313. , {
  4314. "../enum/Viewmode": 51,
  4315. "../util/logger": 189,
  4316. three: 217
  4317. }],
  4318. 15: [function(C, I, e) {
  4319. (function(e) {
  4320. "use strict";
  4321. function t() {
  4322. this.endlessLoop = r.warp.loop,
  4323. this.clock = new i.Clock(!0),
  4324. this.model = null,
  4325. this.player = null,
  4326. this.currentItem = null,
  4327. this.destinationItem = null,
  4328. this.tourIsPlaying = !1,
  4329. this.transitionStage = v.None,
  4330. this.nextFunc = null,
  4331. this.onTheBus = !1,
  4332. this.tourInProgress = !1,
  4333. this.reachSource = null,
  4334. this.interrupted = !1,
  4335. this.nItems = 0,
  4336. this.walkingSectionPaused = !1
  4337. }
  4338. var i = C("three")
  4339. , n = C("./util/logger")
  4340. , r = C("./settings")
  4341. , o = C("./util/transitions")
  4342. , a = C("events").EventEmitter
  4343. , s = C("./enum/Viewmode")
  4344. , l = C("./analytics")
  4345. , c = C("./enum/WarpStyle")
  4346. , h = (o = C("./util/transitions"),
  4347. C("./model/ModelManager"),
  4348. C("./enum/ModelManagerEvents"))
  4349. , u = C("./enum/DirectorEvents")
  4350. , d = C("./enum/PlayerEvents")
  4351. , p = (C("./enum/ControlEvents"),
  4352. C("./enum/BlackoutStyle"))
  4353. , f = C("./enum/PathDiscardMode")
  4354. , g = C("./enum/PathDisplayMode")
  4355. , m = (C("./player"),
  4356. new n(e))
  4357. , v = Object.freeze({
  4358. None: 0,
  4359. Moving: 1,
  4360. Aiming: 2,
  4361. Interlude: 3
  4362. })
  4363. , y = Object.freeze({
  4364. Forward: 1,
  4365. NoChange: 0,
  4366. Backwards: -1
  4367. })
  4368. , A = o.getUniqueId();
  4369. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4370. this.player = e,
  4371. this.modelManager = t,
  4372. this.updateModel(),
  4373. this.resetAll(),
  4374. this.bindEvents()
  4375. }
  4376. ,
  4377. t.prototype.resetAll = function() {
  4378. if (this.currentItem = null,
  4379. this.destinationItem = null,
  4380. this.tourIsPlaying = !1,
  4381. //this.bgmReplay(),
  4382. this.transitionStage = v.None,
  4383. this.nextFunc = null,
  4384. this.onTheBus = !1,
  4385. this.reachSource = null,
  4386. this.interrupted = !1,
  4387. this.model) {
  4388. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4389. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4390. } else
  4391. this.defaultWarpStyle = c.BLACK,
  4392. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4393. this.resetSpecialTransition()
  4394. }
  4395. ,
  4396. t.prototype.updateModel = function() {
  4397. this.model = this.modelManager.getActiveModel(),
  4398. this.nItems = this.model.heroLocations.length
  4399. }
  4400. ,
  4401. t.prototype.bindEvents = function() {
  4402. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4403. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4404. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4405. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4406. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4407. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4408. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4409. this.player.once(d.Move, function() {
  4410. o.cancelById(A)
  4411. })
  4412. }
  4413. ,
  4414. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4415. return /* e === c.WALK && ( */this.interrupt(p.NONE),
  4416. this.pauseWalkingSection(),
  4417. this.player.fastForwardActivePanoFlight(),
  4418. !0/* ) */
  4419. }
  4420. ,
  4421. t.prototype.handlePlayerMove = function(e) {
  4422. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4423. this.emit("update.controls")
  4424. }
  4425. ,
  4426. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4427. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4428. this.emit("update.controls"))
  4429. }
  4430. ,
  4431. t.prototype.handlePlayerModeChanged = function(e, t) {
  4432. this.intermediateState() || e === t || (this.onTheBus = !1,
  4433. this.emit("update.controls"))
  4434. }
  4435. ,
  4436. t.prototype.handlePlayerInputStart = function(e) {
  4437. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4438. }
  4439. ,
  4440. t.prototype.handlePlayerFlyingStarted = function() {
  4441. this.clearWalkingSectionPaused()
  4442. }
  4443. ,
  4444. t.prototype.describe = function() {
  4445. return {
  4446. nItems: this.nItems,
  4447. currentItem: this.currentItem,
  4448. destinationItem: this.destinationItem,
  4449. tourIsPlaying: this.tourIsPlaying,
  4450. onTheBus: this.onTheBus,
  4451. endlessLoop: this.endlessLoop,
  4452. viewMode: this.player.mode,
  4453. inTransition: this._inTransition(),
  4454. transitionStage: this.transitionStage,
  4455. tourInProgress: this.tourInProgress
  4456. }
  4457. }
  4458. ,
  4459. t.prototype._inTransition = function() {
  4460. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4461. }
  4462. ,
  4463. t.prototype.bounceable = function() {
  4464. var e = this.clock.getDelta();
  4465. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4466. }
  4467. ,
  4468. t.prototype.itemCompare = function(item1, item2, type){//add
  4469. if(type == 'equal'){//==
  4470. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4471. }else if(type == 'less'){//<
  4472. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4473. }
  4474. }
  4475. t.prototype.currentMoveDirection = function() {
  4476. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4477. 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
  4478. }
  4479. ,
  4480. t.prototype.clearPath = function() {
  4481. this._inTransition() || this.player.path.discardPathObject()
  4482. }
  4483. ,
  4484. t.prototype.allFloors = function() {
  4485. this.model.toggleAllFloors()
  4486. }
  4487. ,
  4488. t.prototype.actionComplete = function(e) {
  4489. if (this.interrupted = !1,
  4490. this.transitionStage = v.None,
  4491. this.resetSpecialTransition(),
  4492. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4493. this.tourIsPlaying || (this.player.disablePreRendering(),
  4494. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4495. this.emit("update.controls"),
  4496. this.nextFunc) {
  4497. var t = this.nextFunc;
  4498. this.nextFunc = null,
  4499. t()
  4500. }
  4501. }
  4502. ,
  4503. t.prototype.awaitCompletion = function(e, t) {
  4504. this.nextFunc = t,
  4505. e()
  4506. }
  4507. ,
  4508. t.prototype.updateSuccessFunction = function(e) {
  4509. this.nextFunc = e
  4510. }
  4511. ,
  4512. t.prototype.interrupt = function(e, t) {
  4513. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4514. this.tourIsPlaying = !1,
  4515. //this.bgmReplay(),
  4516. this.interrupted = !0,
  4517. this.nextFunc = null,
  4518. this.emit(u.ActionInterrupted),
  4519. null != e || (e = p.BEGINNING),
  4520. this.player.interruptAndFastForward(e, t),
  4521. !0)
  4522. }
  4523. ,
  4524. t.prototype.wouldInterrupt = function() {
  4525. return this.transitionStage !== v.None
  4526. }
  4527. ,
  4528. t.prototype.intermediateState = function() {
  4529. return this.transitionStage !== v.None
  4530. }
  4531. ,
  4532. t.prototype.isInterrupted = function() {
  4533. return this.interrupted
  4534. }
  4535. ,
  4536. t.prototype.pauseWalkingSection = function() {
  4537. this.walkingSectionPaused = !0
  4538. }
  4539. ,
  4540. t.prototype.clearWalkingSectionPaused = function() {
  4541. this.walkingSectionPaused = !1
  4542. }
  4543. ,
  4544. t.prototype.autoTour = function() {
  4545. var i = Date.now();
  4546. this.model.auxDataPromise.then(function() {
  4547. i = Date.now() - i;
  4548. var e = r.warp.auto
  4549. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4550. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4551. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4552. done: function() {
  4553. this.playTour()
  4554. }
  4555. .bind(this),
  4556. name: "_atr",
  4557. id: A
  4558. })
  4559. }
  4560. .bind(this))
  4561. }
  4562. ,
  4563. t.prototype.atDestinationPano = function() {
  4564. if (!this.player.currentPano || null === this.destinationItem)
  4565. return !1;
  4566. var e = this.player.currentPano.id;
  4567. if (void 0 === e)
  4568. return !1;
  4569. var t = this.model.heroLocations;
  4570. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4571. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4572. return destination && destination.panoId == e
  4573. }
  4574. ,
  4575. t.prototype.redirectToItem = function(e, t) {
  4576. if (null != e)
  4577. if (this.wouldInterrupt())
  4578. if (this.player.mode !== s.TRANSITIONING) {
  4579. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4580. var i = function() {
  4581. o.setTimeout(function() {
  4582. this.setDestinationItem(e),
  4583. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4584. }
  4585. .bind(this), 0)
  4586. }
  4587. .bind(this);
  4588. this.interrupt(p.END, 0),
  4589. this.updateSuccessFunction(i)
  4590. } else
  4591. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4592. else
  4593. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4594. else
  4595. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4596. }
  4597. ,
  4598. t.prototype.useSpecialTransition = function(e) {
  4599. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4600. this.nextWarpStyle = c.BLACK
  4601. }
  4602. ,
  4603. t.prototype.resetSpecialTransition = function() {
  4604. this.nextWarpStyle = this.defaultWarpStyle
  4605. }
  4606. ,
  4607. t.prototype.arrivedAtDestination = function(e) {
  4608. if (this.player.flying || this.player.isWarping())
  4609. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4610. else {
  4611. this.transitionStage = v.Aiming;
  4612. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4613. this.player.model.fadePanoMarkers(0),
  4614. this.awaitCompletion(function() {
  4615. this.resetSpecialTransition(),
  4616. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4617. }
  4618. .bind(this), t)
  4619. }
  4620. }
  4621. ,
  4622. t.prototype.goToDestination = function(e, t, i, n) {
  4623. //音频
  4624. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo //只有外层有音乐
  4625. if(musicInfo && musicInfo.music){
  4626. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4627. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4628. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4629. let audioSrc2 = common.getFileNameFromUrl(src)
  4630. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4631. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4632. SoundManager.play('tour',null,0) // currentTime = 0;
  4633. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4634. SoundManager.play('tour')//继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4635. }
  4636. }else{//很可能是该folder的起始
  4637. SoundManager.play('tour', manage.dealURL(src))
  4638. }
  4639. }
  4640. if (this.onTheBus = !0,
  4641. this.emit("update.controls"),
  4642. this.player.updateLastView(),
  4643. n || !this.atDestinationPano()){
  4644. if (this.player.flying || this.player.isWarping())
  4645. m.warn("Cannot go to new destination while player is flying or warping.");
  4646. else {
  4647. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4648. , s = null
  4649. , l = null;
  4650. if (a.isPano()) {
  4651. var o1 = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4652. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4653. s = this.arrivedAtDestination.bind(this, !0)
  4654. //add
  4655. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4656. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4657. }
  4658. } else{
  4659. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4660. s = this.arrivedAtDestination.bind(this, !1);
  4661. }
  4662. this.transitionStage = v.Moving,
  4663. this.model.fadePanoMarkers(0),
  4664. this.awaitCompletion(function() {
  4665. l()
  4666. }
  4667. .bind(this), s),
  4668. this.emit("update.controls")
  4669. }
  4670. }else{
  4671. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4672. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4673. if(a.zoom && a.zoom != this.player.zoomLevel){
  4674. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4675. } */
  4676. this.arrivedAtDestination(!0)
  4677. }
  4678. }
  4679. ,
  4680. t.prototype.tourInterlude = function() {
  4681. if (l.trackAlways("reach_highlight", {
  4682. reach_source: this.reachSource
  4683. }),
  4684. this.model.fadePanoMarkers(0),
  4685. this.emit("update.controls"),
  4686. this.tourIsPlaying)
  4687. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4688. this.stopTour(),
  4689. this.emit(u.TourEnd),
  4690. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4691. this.transitionStage = v.Interlude,
  4692. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4693. }
  4694. .bind(this), this.goNext.bind(this))
  4695. }
  4696. ,
  4697. t.prototype.playTour = function() {
  4698. if (!this.bounceable())
  4699. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4700. this.tourInProgress = !0,
  4701. this.reachSource = "play",
  4702. this.tourIsPlaying = !0,
  4703. this.wasZoomEnabled = this.player.zoomEnabled,
  4704. this.player.zoomEnabled = !1,
  4705. this.resetSpecialTransition(),
  4706. this.emit("update.controls"),
  4707. this.emit(u.TourStart),
  4708. this.player.enablePreRendering(),
  4709. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4710. this.goToDestination()) : this.goNext()))
  4711. }
  4712. ,
  4713. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4714. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4715. this.tourIsPlaying = !1,
  4716. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4717. this.interrupt(),
  4718. this.clearWalkingSectionPaused(),
  4719. this.resetSpecialTransition(),
  4720. this.emit("update.controls"))
  4721. }
  4722. ,
  4723. t.prototype.endTourProgress = function() {
  4724. this.tourInProgress = !1,
  4725. this.emit("update.controls"),
  4726. this.emit(u.TourEnd)
  4727. }
  4728. ,
  4729. t.prototype.goToHighlight = function(e) {
  4730. if (this.wouldInterrupt())
  4731. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4732. else {
  4733. if (m.debug("<tour.goto " + e + ">"),
  4734. this.isInterrupted())
  4735. return;
  4736. this.clearWalkingSectionPaused(),
  4737. this.setDestinationItem(e),
  4738. this.useSpecialTransition("Hilight"),
  4739. this.goToDestination(true),//add true
  4740. l.trackAlways("reach_highlight", {
  4741. reach_source: "thumb"
  4742. })
  4743. }
  4744. }
  4745. ,
  4746. t.prototype.prevHighlight = function() {
  4747. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4748. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4749. this.reachSource = "prev",
  4750. this.goPrev()))
  4751. }
  4752. ,
  4753. t.prototype.nextHighlight = function() {
  4754. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4755. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4756. this.reachSource = "next",
  4757. this.goNext()))
  4758. }
  4759. ,
  4760. t.prototype.changeMode = function(e) {
  4761. var t = $.Deferred()
  4762. , i = t.resolve.bind(t)
  4763. , n = t.reject.bind(t);
  4764. if (this.emit(u.StartModeChange),
  4765. !function() {
  4766. return this.clearWalkingSectionPaused(),
  4767. !!this.wouldInterrupt() && (this.interrupt(),
  4768. !0)
  4769. }
  4770. .bind(this)()) {
  4771. switch (e) {
  4772. case s.PANORAMA:
  4773. 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);
  4774. break;
  4775. case s.DOLLHOUSE:
  4776. case s.FLOORPLAN:
  4777. this.player.flyToNewMode({
  4778. mode: e
  4779. }).done(i).fail(n);
  4780. break;
  4781. case s.OUTDOOR:
  4782. 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)
  4783. }
  4784. return t.promise()
  4785. }
  4786. }
  4787. ,
  4788. t.prototype.atEndOfTour = function(item) {
  4789. //return this.currentItem >= this.nItems - 1
  4790. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4791. if(end){
  4792. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4793. if(heroLocations){
  4794. end = this.currentItem[1] >= heroLocations.length - 1
  4795. }
  4796. }
  4797. return end;
  4798. }
  4799. ,
  4800. t.prototype.firstDestination = function() {
  4801. //return 0 < this.nItems ? 0 : null
  4802. return 0 < this.nItems ? [0,0]: null
  4803. }
  4804. ,
  4805. t.prototype.finalDestination = function() {
  4806. //return 0 < this.nItems ? this.nItems - 1 : null
  4807. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4808. }
  4809. ,
  4810. t.prototype.goPrev = function() {
  4811. this.tourAdvance(-1)
  4812. }
  4813. ,
  4814. t.prototype.goNext = function() {
  4815. this.tourAdvance(1)
  4816. }
  4817. ,
  4818. t.prototype.setDestinationItem = function(e) {
  4819. this.destinationItem = e,
  4820. this.emit("update.controls")
  4821. }
  4822. ,
  4823. t.prototype.setCurrentItem = function(e) {
  4824. this.currentItem = e,
  4825. this.emit("update.controls")
  4826. }
  4827. ,
  4828. t.prototype.nextItem = function(currentItem) {
  4829. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4830. if(currentItem == void 0)return this.firstDestination()
  4831. var currentLocation = this.model.heroLocations[currentItem[0]];
  4832. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4833. var item;
  4834. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4835. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4836. }else{
  4837. item = [currentItem[0] , currentItem[1]+1]
  4838. }
  4839. if(item[0] >= this.nItems ){
  4840. item = this.firstDestination()
  4841. }
  4842. return item;
  4843. //暂时不理会endlessLoop,默认为false
  4844. }
  4845. ,
  4846. t.prototype.prevItem = function(currentItem) {
  4847. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4848. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4849. var item;
  4850. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4851. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4852. else{
  4853. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4854. if(this.currentItem[1] == 0){//子目录中第一个
  4855. return [currentItem[0] - 1, lastChildNum-1]
  4856. }else{
  4857. return [currentItem[0], currentItem[1]-1]
  4858. }
  4859. }
  4860. }
  4861. ,
  4862. t.prototype.tourAdvance = function(e) {//e是1或-1
  4863. m.debug("tourAdvance(" + e + ")")
  4864. if(null === this.currentItem || void 0 === this.currentItem){
  4865. this.setDestinationItem(this.firstDestination())
  4866. }else{
  4867. var item
  4868. if(e == 1){
  4869. item = this.nextItem(this.currentItem)
  4870. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  4871. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4872. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4873. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  4874. }else{
  4875. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  4876. } */
  4877. }else if(e == -1){
  4878. item = this.prevItem(this.currentItem)
  4879. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  4880. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  4881. else{
  4882. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4883. if(this.currentItem[1] == 0){//子目录中第一个
  4884. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  4885. }else{
  4886. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  4887. }
  4888. } */
  4889. }
  4890. //this.setDestinationItem(this.currentItem + e)
  4891. this.setDestinationItem(item)
  4892. }
  4893. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4894. this.useSpecialTransition("reverse-looping to end")
  4895. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4896. this.useSpecialTransition("looping back to start")
  4897. }
  4898. /* if(this.destinationItem[0] < 0 ){
  4899. this.setDestinationItem(this.finalDestination())
  4900. this.useSpecialTransition("reverse-looping to end")
  4901. }else{
  4902. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4903. this.useSpecialTransition("looping back to start"))
  4904. } */
  4905. /* var momentTour = this.getMomentTour(this.destinationItem);
  4906. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4907. var i = this.player.zoomLevel;
  4908. this.player.zoomEnabled = !0;
  4909. var t = function(e, t) {
  4910. this.player.zoomTo((1 - e) * i, !0)
  4911. }
  4912. .bind(this);
  4913. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4914. } */
  4915. this.goToDestination()
  4916. }
  4917. ,
  4918. t.prototype.getMomentTour = function(destinationItem) {//add
  4919. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  4920. if(!destinationItem) return wholeMomentTour
  4921. else{
  4922. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  4923. if(currentLocation.momentTour)return currentLocation.momentTour;
  4924. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  4925. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  4926. }
  4927. }
  4928. ,
  4929. I.exports = t
  4930. }
  4931. ).call(this, "/js/director.js")
  4932. }
  4933. , {
  4934. "./analytics": 4,
  4935. "./enum/BlackoutStyle": 18,
  4936. "./enum/ControlEvents": 21,
  4937. "./enum/DirectorEvents": 23,
  4938. "./enum/ModelManagerEvents": 33,
  4939. "./enum/PathDiscardMode": 38,
  4940. "./enum/PathDisplayMode": 39,
  4941. "./enum/PlayerEvents": 40,
  4942. "./enum/Viewmode": 51,
  4943. "./enum/WarpStyle": 52,
  4944. "./model/ModelManager": 140,
  4945. "./player": 155,
  4946. "./settings": 166,
  4947. "./util/logger": 189,
  4948. "./util/transitions": 195,
  4949. events: 202,
  4950. three: 217
  4951. }],
  4952. 16: [function(e, t, i) {
  4953. "use strict";
  4954. var n = e("three")
  4955. , r = e("./enum/Viewmode")
  4956. , o = (e("./settings"),
  4957. e("./util/transitions"))
  4958. , a = e("./enum/PlayerEvents")
  4959. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4960. , l = new n.ShaderPass(n.VerticalBlurShader);
  4961. l.renderToScreen = !0;
  4962. var c = $("#player").width() / $("#player").height();
  4963. isNaN(c) && (c = 1);
  4964. //initTransitionPass(n)
  4965. var h = {
  4966. currentBlur: 0,
  4967. aspect: c,
  4968. blurStrength: 1,
  4969. hblurPass: s,
  4970. vblurPass: l,
  4971. transitionMaskPass : new n.TransitionPass(),
  4972. bindEvents: function(e) {
  4973. e.on(a.ModeChanged, function(e, t) {
  4974. e === r.PANORAMA && (o.cancel(h.blur),
  4975. o.cancel(h.addBlur),
  4976. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4977. })
  4978. },
  4979. blur: function(e) {
  4980. var t = (h.currentBlur = e) * h.blurStrength;
  4981. l.uniforms.v.value = t / 512 * h.aspect,
  4982. s.uniforms.h.value = t / 512
  4983. },
  4984. addBlur: function(e) {
  4985. e = Math.max(e, h.currentBlur),
  4986. h.blur(e)
  4987. },
  4988. removeBlur: function(e) {
  4989. e = Math.min(1 - e, h.currentBlur),
  4990. h.blur(e)
  4991. }
  4992. };
  4993. h.blur(0),
  4994. t.exports = h
  4995. }
  4996. , {
  4997. "./enum/PlayerEvents": 40,
  4998. "./enum/Viewmode": 51,
  4999. "./settings": 166,
  5000. "./util/transitions": 195,
  5001. three: 217
  5002. }],
  5003. 17: [function(e, t, i) {
  5004. "use strict";
  5005. t.exports = {
  5006. UNKNOWN: 0,
  5007. ALIGNED: 1,
  5008. UNALIGNED: 2,
  5009. PLACED: 3
  5010. }
  5011. }
  5012. , {}],
  5013. 18: [function(e, t, i) {
  5014. "use strict";
  5015. t.exports = {
  5016. NONE: 0,
  5017. MIDDLE: 1,
  5018. END: 2,
  5019. BEGINNING: 3,
  5020. FADEIN: 4
  5021. }
  5022. }
  5023. , {}],
  5024. 19: [function(e, t, i) {
  5025. "use strict";
  5026. var r = e("three");
  5027. t.exports = {
  5028. newBlue: new r.Color(4967932),
  5029. altBlue: new r.Color(47355),
  5030. tagDefault: new r.Color(223357),
  5031. classicBlue: new r.Color(53759),
  5032. mpYellow: new r.Color(16502016),
  5033. mpOrange: new r.Color(16428055),
  5034. mpBlue: new r.Color(12096),
  5035. mpLtGrey: new r.Color(13751252),
  5036. mpDkGrey: new r.Color(10000019),
  5037. mpRed: new r.Color(12525854),
  5038. mpOrangeDesat: new r.Color(16764529),
  5039. mpBlueDesat: new r.Color(4034734),
  5040. mpRedDesat: new r.Color(14705505),
  5041. white: new r.Color(16777215),
  5042. black: new r.Color(0),
  5043. _desat: function(e, t) {
  5044. var i = t || .3
  5045. , n = (new r.Color).copy(e).getHSL();
  5046. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5047. },
  5048. _darken: function(e, t) {
  5049. var i = t || .2
  5050. , n = e.getHSL();
  5051. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5052. }
  5053. }
  5054. }
  5055. , {
  5056. three: 217
  5057. }],
  5058. 20: [function(e, t, i) {
  5059. "use strict";
  5060. t.exports = {
  5061. NONE: -1,
  5062. ROTATE: 0,
  5063. DOLLY: 1,
  5064. PAN: 2,
  5065. ROTATE_DOLLY: 3,
  5066. PAN_DOLLY: 4
  5067. }
  5068. }
  5069. , {}],
  5070. 21: [function(e, t, i) {
  5071. "use strict";
  5072. t.exports = {
  5073. Move: "move",
  5074. InteractionDirect: "interaction.direct",
  5075. InteractionKey: "interaction.key",
  5076. InteractionGui: "interaction.gui",
  5077. FlyInDirection: "fly.direction",
  5078. InputStart: "input.start",
  5079. Pinch: "input.pinch",
  5080. Scroll: "input.scroll",
  5081. AutoPanInterrupt: "autopan.interrupt",
  5082. AutoPanComplete: "autopan.complete",
  5083. AutoPanClamped: "autopan.clamped",
  5084. LongTap: "longtap"
  5085. }
  5086. }
  5087. , {}],
  5088. 22: [function(e, t, i) {
  5089. "use strict";
  5090. t.exports = Object.freeze({
  5091. FORWARD: "FORWARD",
  5092. LEFT: "LEFT",
  5093. RIGHT: "RIGHT",
  5094. BACK: "BACK",
  5095. UP: "UP",
  5096. DOWN: "DOWN"
  5097. })
  5098. }
  5099. , {}],
  5100. 23: [function(e, t, i) {
  5101. "use strict";
  5102. t.exports = {
  5103. ActionInterrupted: "action.interrupted",
  5104. TourStart: "tour.start",
  5105. TourEnd: "tour.end",
  5106. StartModeChange: "mode.startChange"
  5107. }
  5108. }
  5109. , {}],
  5110. 24: [function(e, t, i) {
  5111. "use strict";
  5112. t.exports = Object.freeze({
  5113. None: 0,
  5114. Queued: 1,
  5115. ForceQueued: 2,
  5116. Downloading: 3,
  5117. Downloaded: 4,
  5118. DownloadFailed: 5
  5119. })
  5120. }
  5121. , {}],
  5122. 25: [function(e, t, i) {
  5123. "use strict";
  5124. t.exports = {
  5125. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5126. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5127. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5128. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5129. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5130. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5131. }
  5132. }
  5133. , {}],
  5134. 26: [function(e, t, i) {
  5135. "use strict";
  5136. t.exports = {
  5137. Texture2D: 0,
  5138. TextureCube: 1
  5139. }
  5140. }
  5141. , {}],
  5142. 27: [function(e, t, i) {
  5143. "use strict";
  5144. t.exports = {
  5145. SMALL: "small",
  5146. LARGE: "large"
  5147. }
  5148. }
  5149. , {}],
  5150. 28: [function(e, t, i) {
  5151. "use strict";
  5152. var n = e("./Viewmode")
  5153. , r = {
  5154. LANDING: {},
  5155. NAVIGATION: "navigation",
  5156. MORE_HELP: "moreHelp",
  5157. TOUR_INTERACTION: {}
  5158. };
  5159. r.LANDING[n.PANORAMA] = "panorama.landing",
  5160. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5161. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5162. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5163. r.TOUR_INTERACTION.standard = "standard.tour",
  5164. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5165. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5166. t.exports = r
  5167. }
  5168. , {
  5169. "./Viewmode": 51
  5170. }],
  5171. 29: [function(e, t, i) {
  5172. "use strict";
  5173. var n = {
  5174. UP: 1,
  5175. DOWN: -1,
  5176. LEFT: "L",
  5177. RIGHT: "R",
  5178. FORWARD: "F",
  5179. BACK: "B",
  5180. reverse: {},
  5181. opposite: function(e) {
  5182. return this.reverse[e.toString()]
  5183. }
  5184. };
  5185. n.reverse[n.UP] = n.DOWN,
  5186. n.reverse[n.DOWN] = n.UP,
  5187. n.reverse[n.LEFT] = n.RIGHT,
  5188. n.reverse[n.RIGHT] = n.LEFT,
  5189. n.reverse[n.FORWARD] = n.BACK,
  5190. n.reverse[n.BACK] = n.FORWARD,
  5191. t.exports = n
  5192. }
  5193. , {}],
  5194. 30: [function(e, t, i) {
  5195. "use strict";
  5196. var n = {
  5197. ZERO: 48,
  5198. ONE: 49,
  5199. TWO: 50,
  5200. THREE: 51,
  5201. FOUR: 52,
  5202. FIVE: 53,
  5203. SIX: 54,
  5204. SEVEN: 55,
  5205. EIGHT: 56,
  5206. NINE: 57,
  5207. LEFTARROW: 37,
  5208. UPARROW: 38,
  5209. RIGHTARROW: 39,
  5210. DOWNARROW: 40,
  5211. A: 65,
  5212. B: 66,
  5213. C: 67,
  5214. D: 68,
  5215. E: 69,
  5216. F: 70,
  5217. G: 71,
  5218. H: 72,
  5219. I: 73,
  5220. J: 74,
  5221. K: 75,
  5222. L: 76,
  5223. M: 77,
  5224. N: 78,
  5225. O: 79,
  5226. P: 80,
  5227. Q: 81,
  5228. R: 82,
  5229. S: 83,
  5230. T: 84,
  5231. U: 85,
  5232. V: 86,
  5233. W: 87,
  5234. X: 88,
  5235. Y: 89,
  5236. Z: 90,
  5237. SPACE: 32,
  5238. RETURN: 13,
  5239. SEMICOLON: 186,
  5240. PLUSEQUALS: 187,
  5241. DASHUNDERSCORE: 189,
  5242. OPENBRACKET: 219
  5243. };
  5244. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5245. n.PLUSEQUALS = 61,
  5246. n.DASHUNDERSCORE = 173),
  5247. t.exports = n
  5248. }
  5249. , {
  5250. "../util/browser": 182
  5251. }],
  5252. 31: [function(e, t, i) {
  5253. "use strict";
  5254. t.exports = {
  5255. EN_US: "en-US",
  5256. ES_MX: "es-MX",
  5257. FR_FR: "fr-FR",
  5258. DE_DE: "de-DE",
  5259. RU_RU: "ru-RU",
  5260. CN_CN: "cn-CN",
  5261. JP_JP: "jp-JP"
  5262. }
  5263. }
  5264. , {}],
  5265. 32: [function(e, t, i) {
  5266. "use strict";
  5267. t.exports = {
  5268. TagActivated: "tag.activated",
  5269. TagDismissed: "tag.dismissed",
  5270. TagNavigation: "tag.navigation"
  5271. }
  5272. }
  5273. , {}],
  5274. 33: [function(e, t, i) {
  5275. "use strict";
  5276. t.exports = {
  5277. ModelAdded: "model-added",
  5278. ActiveModelChanged: "active-model-changed"
  5279. }
  5280. }
  5281. , {}],
  5282. 34: [function(e, t, i) {
  5283. "use strict";
  5284. t.exports = {
  5285. LEFT: 0,
  5286. MIDDLE: 1,
  5287. RIGHT: 2
  5288. }
  5289. }
  5290. , {}],
  5291. 35: [function(e, t, i) {
  5292. "use strict";
  5293. t.exports = {
  5294. PanoRenderComplete: "panorama.render.complete",
  5295. TileRenderFailure: "panorama.tile.render.failed",
  5296. TileRenderSuccess: "panorama.tile.render.success",
  5297. TileUploadAttempted: "panorama.tile.upload.attempted",
  5298. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5299. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5300. }
  5301. }
  5302. , {}],
  5303. 36: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. BASE: 1,
  5307. STANDARD: 2,
  5308. HIGH: 3,
  5309. ULTRAHIGH: 4
  5310. }
  5311. }
  5312. , {}],
  5313. 37: [function(e, t, i) {
  5314. "use strict";
  5315. t.exports = {
  5316. LoadComplete: "panorama.load.complete",
  5317. LoadFailed: "panorama.load.failed",
  5318. TileLoaded: "panorama.tile.loaded"
  5319. }
  5320. }
  5321. , {}],
  5322. 38: [function(e, t, i) {
  5323. "use strict";
  5324. t.exports = Object.freeze({
  5325. Standard: 0,
  5326. Slow: 1,
  5327. Retain: 2
  5328. })
  5329. }
  5330. , {}],
  5331. 39: [function(e, t, i) {
  5332. "use strict";
  5333. t.exports = Object.freeze({
  5334. Show: 0,
  5335. Hide: 1,
  5336. Retain: 2
  5337. })
  5338. }
  5339. , {}],
  5340. 40: [function(e, t, i) {
  5341. "use strict";
  5342. t.exports = {
  5343. Move: "move",
  5344. MoveComplete: "move.complete",
  5345. ModeChanged: "mode.changed",
  5346. ModeChanging: "mode.changing",
  5347. PanoChosen: "pano.chosen",
  5348. ClosestPanoChanging: "closest.pano.changing",
  5349. WarpStarted: "warp.started",
  5350. WarpInterrupted: "warp.interrupted",
  5351. WarpEnded: "warp.ended",
  5352. FlyinFinished: "flyin.finished",
  5353. FlyingStarted: "flying.started",
  5354. FlyingInterrupted: "flying.interrupted",
  5355. FlyingEnded: "flying.ended",
  5356. Ready: "ready",
  5357. StartInside: "start.inside",
  5358. StartOutside: "start.outside",
  5359. ViewChanged: "view.changed",
  5360. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5361. InputStart: "input.start"
  5362. }
  5363. }
  5364. , {}],
  5365. 41: [function(e, t, i) {
  5366. "use strict";
  5367. t.exports = Object.freeze({
  5368. DEFAULT: 0,
  5369. PANOMARKERS: 1,
  5370. RETICULE: 2,
  5371. TAG: 3
  5372. })
  5373. }
  5374. , {}],
  5375. 42: [function(e, t, i) {
  5376. "use strict";
  5377. t.exports = {
  5378. visibleFloor: 1,
  5379. ghostFloor: 3,
  5380. boundingSkybox: 1,
  5381. panoMarker: 2,
  5382. reticule: 3,
  5383. tagStem: 4,
  5384. tagDisc: 5,
  5385. ribbon: 100
  5386. }
  5387. }
  5388. , {}],
  5389. 43: [function(e, t, i) {
  5390. "use strict";
  5391. t.exports = {
  5392. ContextCreated: "scene-renderer-context-created",
  5393. AfterRender: "after-render",
  5394. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5395. }
  5396. }
  5397. , {}],
  5398. 44: [function(e, t, i) {
  5399. "use strict";
  5400. t.exports = {
  5401. IDLE: "idle",
  5402. BROWSE: "browse",
  5403. EXAMINE: "examine"
  5404. }
  5405. }
  5406. , {}],
  5407. 45: [function(e, t, i) {
  5408. "use strict";
  5409. t.exports = {
  5410. TileDownloadSuccess: "tiledownloader.download.success",
  5411. TileDownloadFailure: "tiledownloader.download.failure",
  5412. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5413. }
  5414. }
  5415. , {}],
  5416. 46: [function(e, t, i) {
  5417. "use strict";
  5418. t.exports = {
  5419. CardboardAndroid: "googlevr",
  5420. GearVR: "gearvr",
  5421. CardboardIOS: "googlevrios",
  5422. Cardboard: "googlevr"
  5423. }
  5424. }
  5425. , {}],
  5426. 47: [function(e, t, i) {
  5427. "use strict";
  5428. t.exports = {
  5429. NONE: 0,
  5430. CONTEXTUAL: 1,
  5431. ANDROID: 2
  5432. }
  5433. }
  5434. , {}],
  5435. 48: [function(e, t, i) {
  5436. "use strict";
  5437. var n = {
  5438. Title: 0,
  5439. Cardboard: 1
  5440. }
  5441. , r = {
  5442. Title: 0,
  5443. Cardboard: 1,
  5444. Gear: 2
  5445. };
  5446. [n, r].forEach(function(e) {
  5447. e.pageCount = Object.keys(e).length
  5448. }),
  5449. t.exports.ios = n,
  5450. t.exports.standard = r
  5451. }
  5452. , {}],
  5453. 49: [function(e, t, i) {
  5454. "use strict";
  5455. t.exports = {
  5456. Android: "android",
  5457. IOS: "ios",
  5458. Desktop: "desktop",
  5459. UnsupportedAndroid: "android-unsupported"
  5460. }
  5461. }
  5462. , {}],
  5463. 50: [function(e, t, i) {
  5464. "use strict";
  5465. var n = e("three");
  5466. t.exports = {
  5467. UP: new n.Vector3(0,1,0),
  5468. DOWN: new n.Vector3(0,-1,0),
  5469. LEFT: new n.Vector3(-1,0,0),
  5470. RIGHT: new n.Vector3(1,0,0),
  5471. FORWARD: new n.Vector3(0,0,-1),
  5472. BACK: new n.Vector3(0,0,1)
  5473. }
  5474. }
  5475. , {
  5476. three: 217
  5477. }],
  5478. 51: [function(e, t, i) {
  5479. "use strict";
  5480. var n = e("../exception/ViewmodeConvertException")
  5481. , r = e("./coreViewmodes")
  5482. , o = {
  5483. MESH: "mesh",
  5484. OUTDOOR: "outdoor",
  5485. TRANSITIONING: "transitioning",
  5486. toInt: function(e) {
  5487. switch (e) {
  5488. case this.PANORAMA:
  5489. return 1;
  5490. case this.DOLLHOUSE:
  5491. return 2;
  5492. case this.FLOORPLAN:
  5493. return 3;
  5494. case this.OUTDOOR:
  5495. return 4;
  5496. case this.TRANSITIONING:
  5497. return -1
  5498. }
  5499. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5500. },
  5501. fromInt: function(e) {
  5502. switch (e) {
  5503. case "1":
  5504. case 1:
  5505. return this.PANORAMA;
  5506. case "2":
  5507. case 2:
  5508. return this.DOLLHOUSE;
  5509. case "3":
  5510. case 3:
  5511. return this.FLOORPLAN;
  5512. case "4":
  5513. case 4:
  5514. return this.OUTDOOR
  5515. }
  5516. throw new n("No known conversion for int to viewmode for int: " + e)
  5517. },
  5518. convertWorkshopModeInt: function(e) {
  5519. switch (e) {
  5520. case "0":
  5521. case 0:
  5522. case void 0:
  5523. return this.PANORAMA;
  5524. case "1":
  5525. case 1:
  5526. return this.FLOORPLAN;
  5527. case "2":
  5528. case 2:
  5529. return this.DOLLHOUSE;
  5530. case "3":
  5531. case 3:
  5532. return this.MESH
  5533. }
  5534. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5535. }
  5536. };
  5537. e("../util/common").extendObject(o, r),
  5538. t.exports = o
  5539. }
  5540. , {
  5541. "../exception/ViewmodeConvertException": 58,
  5542. "../util/common": 185,
  5543. "./coreViewmodes": 54
  5544. }],
  5545. 52: [function(e, t, i) {
  5546. "use strict";
  5547. t.exports = {
  5548. BLACK: "black",
  5549. STD: "std",
  5550. WALK: "walk"
  5551. }
  5552. }
  5553. , {}],
  5554. 53: [function(e, t, i) {
  5555. "use strict";
  5556. t.exports = {
  5557. ZoomIn: "zoom.in",
  5558. ZoomOut: "zoom.out",
  5559. ZoomMax: "zoom.max",
  5560. ZoomMin: "zoom.min"
  5561. }
  5562. }
  5563. , {}],
  5564. 54: [function(e, t, i) {
  5565. "use strict";
  5566. t.exports = {
  5567. PANORAMA: "panorama",
  5568. DOLLHOUSE: "dollhouse",
  5569. FLOORPLAN: "floorplan"
  5570. }
  5571. }
  5572. , {}],
  5573. 55: [function(e, t, i) {
  5574. "use strict";
  5575. t.exports = function(e) {
  5576. this.message = e
  5577. }
  5578. }
  5579. , {}],
  5580. 56: [function(e, t, i) {
  5581. "use strict";
  5582. function n(e) {
  5583. r.call(this, e)
  5584. }
  5585. var r = e("./BasicException");
  5586. n.prototype = Object.create(r.prototype),
  5587. t.exports = n
  5588. }
  5589. , {
  5590. "./BasicException": 55
  5591. }],
  5592. 57: [function(e, t, i) {
  5593. "use strict";
  5594. function n(e) {
  5595. r.call(this, e)
  5596. }
  5597. var r = e("./BasicException");
  5598. n.prototype = Object.create(r.prototype),
  5599. t.exports = n
  5600. }
  5601. , {
  5602. "./BasicException": 55
  5603. }],
  5604. 58: [function(e, t, i) {
  5605. "use strict";
  5606. function n(e) {
  5607. r.call(this, e)
  5608. }
  5609. var r = e("./BasicException");
  5610. n.prototype = Object.create(r.prototype),
  5611. t.exports = n
  5612. }
  5613. , {
  5614. "./BasicException": 55
  5615. }],
  5616. 59: [function(a, s, e) {
  5617. (function(e) {
  5618. "use strict";
  5619. var i = a("./util/ajax")
  5620. , n = a("./util/showcase")
  5621. , t = a("./util/logger")
  5622. , r = new t(e)
  5623. , o = {};
  5624. s.exports = {
  5625. loadFeatureFlags: function(e) {
  5626. var t = $.Deferred();
  5627. return i.get(e.urlBase + "", {
  5628. responseType: "json",
  5629. prefetchFrom: "user",
  5630. auth: n.getAuthorizationHeader()
  5631. }).done(function(e) {
  5632. (o = function(e) {
  5633. var t = {};
  5634. if (e) {
  5635. var i = e.flags;
  5636. if (i)
  5637. for (var n in i)
  5638. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5639. return t
  5640. }
  5641. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5642. null
  5643. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5644. }).fail(function() {
  5645. r.debug("Retrieval of feature flags failed."),
  5646. t.reject("loading-failed")
  5647. }),
  5648. t.promise()
  5649. },
  5650. getFlags: function() {
  5651. return o
  5652. },
  5653. updateDependentSettings: function(e, t) {
  5654. (e = e || o).labels && (t.labels.enabled = !0),
  5655. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5656. e.showcase_sdk && (t.sdkInit = !0),
  5657. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5658. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5659. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5660. e.hide_sc_sharing && (t.share.enabled = !1)
  5661. }
  5662. }
  5663. }
  5664. ).call(this, "/js/featureflags.js")
  5665. }
  5666. , {
  5667. "./util/ajax": 181,
  5668. "./util/logger": 189,
  5669. "./util/showcase": 193
  5670. }],
  5671. 60: [function(e, t, i) {
  5672. "use strict";
  5673. var n = (e("../util/common"),
  5674. {
  5675. status: 0,
  5676. set: function(e) {
  5677. if (isNaN(e))
  5678. return !1;
  5679. var t = $(".progressbar");
  5680. e < 0 && (e = 0),
  5681. 100 < e && (e = 100);
  5682. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5683. , n = Math.round(e)
  5684. , r = parseInt(i) - 15;
  5685. t.find(".bar").css("width", i),
  5686. t.find(".label").css("left", r),
  5687. t.find(".perc").text(n + "%"),
  5688. this.status = e
  5689. },
  5690. done: function(e) {
  5691. return e || this.status ? (this.status = null,
  5692. this.set(100)) : this
  5693. }
  5694. });
  5695. t.exports.circleLoader = n
  5696. }
  5697. , {
  5698. "../util/common": 185
  5699. }],
  5700. 61: [function(e, t, i) {
  5701. "use strict";
  5702. t.exports = Object.freeze({
  5703. CLOSE: "modal.closer.close"
  5704. })
  5705. }
  5706. , {}],
  5707. 62: [function(e, t, i) {
  5708. "use strict";
  5709. function n(t, e) {
  5710. function i() {
  5711. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5712. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5713. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5714. c.classList.remove("closeByFooter")))
  5715. }
  5716. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5717. }
  5718. var r = e("../../settings")
  5719. , o = (e("../../tag/Media/MediaEvent"),
  5720. e("../../util/browser"))
  5721. , a = e("../../util/common")
  5722. , s = e("./ModalCloserEvent")
  5723. , l = e("events").EventEmitter
  5724. , c = document.getElementsByClassName("footer")[0]
  5725. , h = c.querySelectorAll(".close")[0]
  5726. , u = null
  5727. , d = null
  5728. , p = null
  5729. , f = (o.isMobile(),
  5730. {
  5731. open: function(e) {
  5732. e && (n(e),
  5733. u && h.removeEventListener("click", u, !0),
  5734. u = function(e, t) {
  5735. t && (t.stopPropagation(),
  5736. t.preventDefault()),
  5737. e && this.emit(s.CLOSE, e),
  5738. f.reset()
  5739. }
  5740. .bind(this, e.id),
  5741. h.addEventListener("click", u, !0),
  5742. d && window.removeEventListener("resize", d, !0),
  5743. d = n.bind(this, e),
  5744. window.addEventListener("resize", d, !0))
  5745. },
  5746. reset: function() {
  5747. c.classList.remove("closeByFooter"),
  5748. h.removeEventListener("click", u, !0),
  5749. window.removeEventListener("resize", d, !0),
  5750. u = d = p = null
  5751. }
  5752. });
  5753. a.extendObject(f, l.prototype),
  5754. t.exports = f
  5755. }
  5756. , {
  5757. "../../tag/Media/MediaEvent": 131,
  5758. "../../settings": 166,
  5759. "../../util/browser": 182,
  5760. "../../util/common": 185,
  5761. "./ModalCloserEvent": 61,
  5762. events: 202
  5763. }],
  5764. 63: [function(e, t, i) {
  5765. "use strict";
  5766. var A = e("../lib/dat.gui")
  5767. , C = e("three")
  5768. , I = e("../util/easing")
  5769. , E = e("../enum/Viewmode")
  5770. , _ = e("../enum/Colors")
  5771. , b = e("../enum/WarpStyle")
  5772. , w = e("../settings");
  5773. e("../tag/tag"),
  5774. A.GUI.prototype.removeFolder = function(e) {
  5775. var t = this.__folders[e];
  5776. t && (t.close(),
  5777. this.__ul.removeChild(t.domElement.parentNode),
  5778. delete this.__folders[e],
  5779. this.onResize())
  5780. }
  5781. ,
  5782. t.exports.toggle = function(t, e, i) {
  5783. var n = new A.GUI({
  5784. width: 400
  5785. })
  5786. , r = n.addFolder("Flydown from Dollhouse");
  5787. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5788. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5789. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5790. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5791. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5792. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5793. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5794. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5795. var o = n.addFolder("Transition between panos");
  5796. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5797. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5798. w.transition.flyTime = 0,
  5799. o.__controllers.forEach(function(e) {
  5800. e.updateDisplay()
  5801. })
  5802. }),
  5803. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5804. w.transition.flySpeed = 0,
  5805. o.__controllers.forEach(function(e) {
  5806. e.updateDisplay()
  5807. })
  5808. }),
  5809. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5810. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5811. o.add(w.transition, "movementEasing", Object.keys(I));
  5812. var a = n.addFolder("Path Display");
  5813. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5814. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5815. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5816. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5817. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5818. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5819. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5820. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5821. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5822. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5823. w.path.color = _[w.path.color],
  5824. w.path.colorUp = _._desat(w.path.color),
  5825. w.path.colorDown = _.darken(w.path.color)
  5826. }),
  5827. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5828. w.reticuleColor = _[w.reticuleColor]
  5829. });
  5830. var s = n.addFolder("Warping")
  5831. , l = s.addFolder("Warp/Teleport");
  5832. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5833. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5834. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5835. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5836. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5837. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5838. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5839. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5840. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5841. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5842. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5843. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5844. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5845. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5846. w.path.typ = b[w.path.typ]
  5847. }),
  5848. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5849. e.endlessLoop = w.warp.loop
  5850. }),
  5851. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5852. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5853. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5854. var c = s.addFolder("Long Warp Only");
  5855. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5856. w.warp.flySpeed = 0,
  5857. c.__controllers.forEach(function(e) {
  5858. e.updateDisplay()
  5859. })
  5860. }),
  5861. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5862. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5863. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5864. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5865. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5866. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5867. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5868. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5869. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5870. var h = n.addFolder("Warp Esoterica");
  5871. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5872. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5873. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5874. w.warp.minWarpTime = 0,
  5875. h.__controllers.forEach(function(e) {
  5876. e.updateDisplay()
  5877. })
  5878. }),
  5879. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5880. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5881. h.add(w.warp, "movementEasing", Object.keys(I));
  5882. var u = n.addFolder("Misc");
  5883. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5884. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5885. }),
  5886. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5887. i.cameras[E.PANORAMA].fov = w.insideFOV
  5888. }),
  5889. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5890. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5891. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5892. var d = n.addFolder("Navigation");
  5893. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5894. w.navigation.panoScores || t.panos.forEach(function(e) {
  5895. e.floor.remove(e.text3d),
  5896. e.text3d = null
  5897. })
  5898. }),
  5899. d.add(w.navigation, "mouseDirection"),
  5900. d.add(w.navigation, "filterStrictness", 0, 1),
  5901. d.add(w.navigation, "angleFactor", -60, 0),
  5902. d.add(w.navigation, "directionFactor", 1, 20),
  5903. d.add(w.navigation, "distanceFactor", -5, 5),
  5904. d.add(w.navigation, "optionalityFactor", .1, 10);
  5905. var p = n.addFolder("tags")
  5906. , f = p.addFolder("Tag Creation");
  5907. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5908. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5909. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5910. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5911. var g = p.addFolder("Visibility");
  5912. g.add(w.tags.visibility, "anyDistance"),
  5913. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5914. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5915. g.add(w.tags.visibility, "hideViaFloor"),
  5916. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5917. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5918. var m = p.addFolder("Disc Parameters");
  5919. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5920. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5921. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5922. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5923. }),
  5924. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5925. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5926. }),
  5927. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5928. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5929. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5930. var v = p.addFolder("Navigate");
  5931. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5932. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5933. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5934. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5935. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5936. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5937. var y = n.addFolder("Debug");
  5938. y.add(w, "wireframe").onFinishChange(function() {
  5939. t.chunks.forEach(function(e) {
  5940. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5941. e.wireframeTwin.material.depthWrite = !1,
  5942. e.wireframeTwin.material.depthTest = !1,
  5943. e.wireframeTwin.material.opacity = .5,
  5944. e.wireframeTwin.material.transparent = !0),
  5945. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5946. })
  5947. }),
  5948. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5949. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5950. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5951. t.skybox.wireframe = null)
  5952. }),
  5953. y.add(w, "showSweeps").onFinishChange(function() {
  5954. t.setSweepVisibility(w.showSweeps)
  5955. }),
  5956. y.add(w, "showMesh").onFinishChange(function() {
  5957. t.chunks.forEach(function(e) {
  5958. e.visible = w.showMesh
  5959. })
  5960. }),
  5961. y.add(w, "showFloors").onFinishChange(function() {
  5962. t.floors.forEach(function(e) {
  5963. e.collider.children.forEach(function(e) {
  5964. e.material.visible = w.showFloors
  5965. })
  5966. })
  5967. }),
  5968. y.add(w, "showSkyboxes").onFinishChange(function() {
  5969. t.panos.forEach(function(e) {
  5970. e.skyboxMesh.visible = w.showSkyboxes
  5971. })
  5972. }),
  5973. y.add(w, "showNeighbors").onChange(function() {}),
  5974. y.add(t, "alpha", 0, 1)
  5975. }
  5976. }
  5977. , {
  5978. "../enum/Colors": 19,
  5979. "../enum/Viewmode": 51,
  5980. "../enum/WarpStyle": 52,
  5981. "../lib/dat.gui": 93,
  5982. "../tag/tag": 123,
  5983. "../settings": 166,
  5984. "../util/easing": 186,
  5985. three: 217
  5986. }],
  5987. 64: [function(c, h, e) {
  5988. (function(e) {
  5989. "use strict";
  5990. function i(e, t, i, n) {
  5991. $(".gui-error .error-problem-text").text(e),
  5992. $(".gui-error .error-solution-text").text(t),
  5993. $(".gui-error .error-explanation").text(i),
  5994. $(".gui-error .error-actions").html(n),
  5995. $(window).resize(),
  5996. $(".gui-error").fadeIn(),
  5997. $("#bottom-logo").fadeIn()
  5998. }
  5999. function n(e) {
  6000. 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("");
  6001. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6002. r.isMobile() || $("[rel=tiletip]").tooltip({
  6003. placement: "bottom",
  6004. delay: {
  6005. show: 50,
  6006. hide: 0
  6007. },
  6008. trigger: "hover",
  6009. viewport: {
  6010. selector: "body",
  6011. padding: 10
  6012. }
  6013. })
  6014. }
  6015. function t() {
  6016. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6017. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6018. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6019. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6020. e.preventDefault(),
  6021. e.stopPropagation(),
  6022. n(" ")
  6023. })
  6024. }
  6025. var r = c("./../util/browser")
  6026. , o = c("./../analytics")
  6027. , a = c("./../settings")
  6028. , s = c("../localization/localize")
  6029. , l = new (c("./../util/logger"))(e);
  6030. h.exports.error = function(e) {
  6031. if ($("head title").text(a.pageTitle),
  6032. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6033. $("#gui-loading").fadeOut(250),
  6034. $("#quick-blackout").hide(),
  6035. o.track("showcase_error", {
  6036. error_key: e
  6037. }),
  6038. s.locale || s.init(),
  6039. "webgl-unsupported" === e)
  6040. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6041. else if ("webgl-ios" === e)
  6042. 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>.");
  6043. else if ("webgl-safari" === e)
  6044. 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>.");
  6045. else if ("webgl-generic" === e)
  6046. t();
  6047. else if ("missing-urls" === e)
  6048. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6049. else if ("loading-failed" === e)
  6050. 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>.");
  6051. else {
  6052. if ("loading-failed-maintenance" !== e)
  6053. return void l.error("Unhandled error: " + e);
  6054. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6055. }
  6056. }
  6057. }
  6058. ).call(this, "/js/gui/error.js")
  6059. }
  6060. , {
  6061. "../localization/localize": 108,
  6062. "./../analytics": 4,
  6063. "./../settings": 166,
  6064. "./../util/browser": 182,
  6065. "./../util/logger": 189
  6066. }],
  6067. 65: [function(Oe, Le, e) {
  6068. (function(e) {
  6069. "use strict";
  6070. function c() {
  6071. for (var e in Ce)
  6072. if (Ce.hasOwnProperty(e)) {
  6073. var t = Ce[e];
  6074. if (!t.visible)
  6075. for (var i = 0; i < t.elements.length; i++)
  6076. $(t.elements[i]).hide()
  6077. }
  6078. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6079. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6080. ge = [],
  6081. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6082. ge.push(".hideTarget", ".pinTop.right")
  6083. }
  6084. function v(e, t) {
  6085. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6086. $("#gui-zoomin").toggle(i),
  6087. $("#gui-zoomout").toggle(i)
  6088. }
  6089. function l() {
  6090. n(),
  6091. $(".pinBottom").toggleClass("open"),
  6092. $("#drawer").toggleClass("open"),
  6093. $(".footer").toggleClass("open"),
  6094. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6095. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6096. O.resetDrawer()),
  6097. setTimeout(function() {
  6098. $("#pullTab").toggleClass("opened")
  6099. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6100. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6101. }
  6102. function t(e) {
  6103. var t;
  6104. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6105. t = e.position().top + e.outerHeight(),
  6106. e.attr("style", "display: none")),
  6107. $("#player").outerHeight() - 130 < t + 25
  6108. }
  6109. function y(e) {
  6110. "touchstart" === e.type && e.preventDefault(),
  6111. e.stopPropagation()
  6112. }
  6113. function n() {
  6114. w && (w.reload(),
  6115. w.init())
  6116. }
  6117. function r() {
  6118. $("#gui-spinner").stop(!0, !0),
  6119. $("#gui-spinner").fadeOut(1e3),
  6120. !(Ae = !0)
  6121. }
  6122. function A(e, t) {
  6123. var i = e.mode
  6124. , n = t || e.currentPano;
  6125. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6126. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6127. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6128. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6129. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6130. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6131. $("#gui-modes-outside").removeClass("desktop-only")),
  6132. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6133. pe = i,
  6134. $("#gui-modes-outside").addClass("hidden"),
  6135. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6136. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6137. }
  6138. function C(t, i) {
  6139. function e() {
  6140. document.getElementById("vr").classList.remove("hidden"),
  6141. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6142. S.supportsFullscreen() ? function(e) {
  6143. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6144. Q.init(t.data, i, e, x),
  6145. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6146. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6147. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6148. $(".improper-embed").toggleClass("hidden", !1),
  6149. n())
  6150. }, function(e) {
  6151. n()
  6152. }) : n()
  6153. }
  6154. function n() {
  6155. var e;
  6156. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6157. X.init(t.data, x),
  6158. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6159. function() {
  6160. _e("vr"),
  6161. V.open(e)
  6162. }
  6163. )),
  6164. X.on(Z.CLOSED, V.reset)
  6165. }
  6166. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6167. switch (M.vr.option) {
  6168. case le.CONTEXTUAL:
  6169. e();
  6170. break;
  6171. case le.ANDROID:
  6172. S.detectAndroid() && e();
  6173. break;
  6174. case le.NONE:
  6175. }
  6176. }
  6177. function h(e, i) {
  6178. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6179. if ("372" !== getQueryVariable("m")) {
  6180. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6181. $(".gui-floor").find(".container").prepend(r)
  6182. }
  6183. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6184. n.on("click", function(e) {
  6185. y(e),
  6186. _e("floor"),
  6187. n.toggleClass("open")
  6188. }),
  6189. $(".floorChoice").on("click", function(e) {
  6190. y(e);
  6191. var t = $(this).data("index");
  6192. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6193. i.player.gotoFloor(t),
  6194. R.track("showcase_gui", {
  6195. gui_action: "click_floor_select_button",
  6196. interaction_source: "gui"
  6197. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6198. _e("move"),
  6199. i.allFloors(),
  6200. R.track("showcase_gui", {
  6201. gui_action: "click_toggle_all_floors_button",
  6202. interaction_source: "gui"
  6203. })),
  6204. n.removeClass("open")
  6205. //add:
  6206. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  6207. VisiSet.changePanoVisi(true)
  6208. }
  6209. })
  6210. }
  6211. function I(e, t) {
  6212. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6213. $(".gui-floor-icon").hide(),
  6214. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6215. $(".gui-floor-icon").show(),
  6216. $(".gui-floor-title").hide()),
  6217. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6218. $(".gui-floor-number").text(se.FLOOR_ALL),
  6219. $(".floorChoice").removeClass("active"),
  6220. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6221. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6222. $(".floorChoice").removeClass("active"),
  6223. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6224. }
  6225. function E() {
  6226. var e = $("#player").width() - 20
  6227. , t = $("#scroller")
  6228. , i = $("#drawer")
  6229. , n = $(".pinBottom");
  6230. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6231. i.addClass("noScroll"),
  6232. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6233. i.toggleClass("noScroll"),
  6234. n.toggleClass("noScroll"))
  6235. }
  6236. function _(e) {
  6237. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6238. e = e || 0,
  6239. Ae = !1,
  6240. window.setTimeout(function() {
  6241. Ae || (!0,
  6242. $("#gui-spinner").stop(!0, !0).show())
  6243. }
  6244. .bind(this), e)
  6245. }(M.modelComponentLoadSpinnerDelay)
  6246. }
  6247. function b(e, t) {
  6248. for (var i = []; e; )
  6249. i.push(e),
  6250. e = e.parentNode;
  6251. for (; t && -1 === i.indexOf(t); )
  6252. t = t.parentNode;
  6253. return t
  6254. }
  6255. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6256. Oe("../util/ajax"),
  6257. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6258. Oe("../util/camera"),
  6259. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6260. 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"),
  6261. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6262. Oe("../enum/PathDisplayMode"),
  6263. Oe("../enum/DirectorEvents"),
  6264. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6265. Oe("../enum/WarpStyle"),
  6266. Oe("../enum/AlignmentType"),
  6267. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6268. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6269. coBrand: {
  6270. visible: !0,
  6271. elements: [".co-brand", "#loaderCoBrand"]
  6272. },
  6273. help: {
  6274. visible: !0,
  6275. elements: [".nav-help", "#nav-help"]
  6276. },
  6277. tourControls: {
  6278. visible: !0,
  6279. elements: [".next", ".previous", "#play"]
  6280. },
  6281. highlight: {
  6282. visible: !0,
  6283. elements: ["#drawer", "#pullTab"]
  6284. },
  6285. share: {
  6286. visible: !0,
  6287. elements: [".socialButton", "#share"]
  6288. },
  6289. fullScreen: {
  6290. visible: !0,
  6291. elements: ["#gui-fullscreen"]
  6292. },
  6293. floors: {
  6294. visible: !0,
  6295. elements: [".gui-floor"]
  6296. }
  6297. }, Ie = (g = document.getElementById("drawer"),
  6298. function() {
  6299. $("#player").height() < 400 && g.classList.contains("open") && l()
  6300. }
  6301. ), Ee = (f = document.getElementById("meta-info"),
  6302. function() {
  6303. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6304. }
  6305. ), _e = (i = document.getElementById("meta-info"),
  6306. s = document.getElementById("interaction-modal"),
  6307. u = $("#drawer").eq(0),
  6308. d = $(".gui-floor").eq(0),
  6309. p = $(".vr-popup").eq(0),
  6310. function(e) {
  6311. switch (e) {
  6312. case "info":
  6313. we(),
  6314. Te(),
  6315. Ie(),
  6316. Me(),
  6317. Re(),
  6318. xe(),
  6319. Pe();
  6320. break;
  6321. case "terms":
  6322. be(),
  6323. Te(),
  6324. Se(),
  6325. Me(),
  6326. Re(),
  6327. xe(),
  6328. Pe();
  6329. break;
  6330. case "help":
  6331. be(),
  6332. we(),
  6333. Me(),
  6334. Re(),
  6335. xe(),
  6336. Pe();
  6337. break;
  6338. case "vr":
  6339. be(),
  6340. we(),
  6341. Me(),
  6342. Re(),
  6343. Te(),
  6344. Pe(),
  6345. t(p) && Se();
  6346. break;
  6347. case "highlights":
  6348. Ee(),
  6349. we(),
  6350. Me(),
  6351. Re();
  6352. break;
  6353. case "share":
  6354. be(),
  6355. we(),
  6356. Te(),
  6357. Re(),
  6358. xe(),
  6359. Pe();
  6360. break;
  6361. case "floor":
  6362. we(),
  6363. Me(),
  6364. xe();
  6365. break;
  6366. case "view":
  6367. Re(),
  6368. Me(),
  6369. we(),
  6370. xe();
  6371. break;
  6372. case "tour":
  6373. case "move":
  6374. we(),
  6375. Me(),
  6376. Re(),
  6377. xe();
  6378. break;
  6379. case "resize":
  6380. be(),
  6381. Ie(),
  6382. Re();
  6383. break;
  6384. case "tag":
  6385. we(),
  6386. Te(),
  6387. Me(),
  6388. Re(),
  6389. xe()
  6390. }
  6391. }
  6392. );
  6393. function be() {
  6394. i.classList.contains("expand") && z.toggleMeta(!0)
  6395. }
  6396. function we() {
  6397. W.hide()
  6398. }
  6399. function Te() {
  6400. U.close()
  6401. }
  6402. function xe() {
  6403. X.dismiss()
  6404. }
  6405. function Se() {
  6406. u.hasClass("open") && l()
  6407. }
  6408. function Me() {
  6409. K.hide()
  6410. }
  6411. function Re() {
  6412. d.hasClass("open") && d.removeClass("open")
  6413. }
  6414. function Pe() {
  6415. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6416. }
  6417. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6418. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6419. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6420. setTimeout(function() {
  6421. $(".icon:visible").hide().show(0)
  6422. }, 100)
  6423. }),
  6424. $("#gui-fullscreen").find("a").on("click", function(e) {
  6425. y(e),
  6426. S.requestFullscreen($("body")[0]),
  6427. R.track("showcase_gui", {
  6428. gui_action: "click_enter_fullscreen",
  6429. interaction_source: "gui"
  6430. })
  6431. }),
  6432. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6433. y(e),
  6434. S.exitFullscreen(),
  6435. R.track("showcase_gui", {
  6436. gui_action: "click_exit_fullscreen",
  6437. interaction_source: "gui"
  6438. })
  6439. }),
  6440. $(window).on("resize", function(e) {
  6441. var t = e.target.innerHeight
  6442. , i = e.target.innerWidth;
  6443. t === o && i === a || (Ce.highlight.visible && E(),
  6444. _e("resize"),
  6445. $(".pinTop.right").removeClass("hideUnderMeta"),
  6446. n(),
  6447. o = t,
  6448. a = i)
  6449. }).resize(),
  6450. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6451. $("#pullTab").on("click", function(e) {
  6452. y(e),
  6453. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6454. gui_action: "hide_highlight_reel"
  6455. }),
  6456. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6457. gui_action: "show_highlight_reel"
  6458. }),
  6459. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6460. l()
  6461. }),
  6462. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6463. $("#hotList").on("click", function(e) {
  6464. y(e);
  6465. var t = $("#hotListWrap")[0];
  6466. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6467. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6468. this.classList.add("active"))
  6469. }),
  6470. $("#hotListContent ul").on("mouseover", function(e) {
  6471. y(e);
  6472. var t = e.target
  6473. , i = document.getElementById("hotListWrap");
  6474. if ("SPAN" === t.tagName) {
  6475. var n = t.parentElement.parentElement;
  6476. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6477. } else if ("LI" === t.tagName) {
  6478. n = t.parentElement;
  6479. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6480. } else
  6481. i.style.width = ""
  6482. }),
  6483. $("#hotListContent ul").on("click", function(e) {
  6484. y(e),
  6485. this.preElem && this.preElem.classList.remove("active"),
  6486. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6487. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6488. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6489. e.target.hot && e.target.hot.examine(!0),
  6490. this.preElem = e.target)
  6491. }),
  6492. $("#hotListClose").on("click", function(e) {
  6493. y(e),
  6494. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6495. $("#hotListContent ul .active").removeClass("active"),
  6496. $("#hotList")[0].classList.remove("active")
  6497. })),
  6498. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6499. $("#more-menu-button").on("click", function(e) {
  6500. y(e),
  6501. $("#more-menu").toggleClass("open")
  6502. }),
  6503. Le.exports.init = function(s, l, c, e, t, i, n) {
  6504. var r;
  6505. x = n,
  6506. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6507. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6508. F.init(),
  6509. D.init(s, i),
  6510. ce.init(s, l, e),
  6511. $(".icon").on("mouseover", function() {
  6512. l.player && l.player.reticule.hide()
  6513. }),
  6514. function(e, t) {
  6515. var i = t.player;
  6516. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6517. y(e),
  6518. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6519. R.track("USER", {
  6520. event_type: "showcase_gui",
  6521. gui_action: "click_inside_mode_button"
  6522. }),
  6523. t.changeMode(ie.PANORAMA)
  6524. }),
  6525. $("#gui-modes-outside").find("a").on("click", function(e) {
  6526. y(e),
  6527. R.track("showcase_gui", {
  6528. gui_action: "click_outside_mode_button"
  6529. }),
  6530. t.changeMode(pe)
  6531. }),
  6532. $("#gui-modes-floorplan").on("click", function(e) {
  6533. y(e),
  6534. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6535. gui_action: "click_floorplan_mode_button"
  6536. }),
  6537. t.changeMode(ie.FLOORPLAN))
  6538. }),
  6539. $("#gui-modes-dollhouse").on("click", function(e) {
  6540. y(e),
  6541. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6542. gui_action: "click_dollhouse_mode_button"
  6543. }),
  6544. t.changeMode(ie.DOLLHOUSE))
  6545. })
  6546. }(0, l),
  6547. function(e, t) {
  6548. $("#play").on("mousedown touchstart", function(e) {
  6549. y(e),
  6550. _e("tour"),
  6551. q.play(),
  6552. R.trackAlways("showcase_gui", {
  6553. gui_action: "play_highlights"
  6554. })
  6555. }),
  6556. window.startAndPlay = function(e) {
  6557. _e("tour"),
  6558. q.play(),
  6559. R.trackAlways("showcase_gui", {
  6560. gui_action: "play_highlights"
  6561. })
  6562. }
  6563. ,
  6564. $("#pause").on("mousedown touchstart", function(e) {
  6565. y(e),
  6566. q.pause(),
  6567. R.trackAlways("showcase_gui", {
  6568. gui_action: "pause_highlights"
  6569. })
  6570. }),
  6571. $("#gui-zoomin").find("a").on("click", function(e) {
  6572. y(e),
  6573. t.player.zoomInIncrementally()
  6574. }),
  6575. $("#gui-zoomout").find("a").on("click", function(e) {
  6576. y(e),
  6577. t.player.zoomOutIncrementally()
  6578. })
  6579. }(0, l),
  6580. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6581. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6582. function() {
  6583. _e("share"),
  6584. V.open(r)
  6585. }
  6586. )),
  6587. K.on(ae.CLOSED, V.reset)),
  6588. 0 < s.heroLocations.length ? function(e, i, t) {
  6589. var n = 100 / (fe = e.heroLocations.length) + "%"
  6590. , r = $("#thumb-container")
  6591. , o = $("#progressBar");
  6592. $("#status").find(".totalSteps").text(fe);
  6593. for (var a = 0; a < fe; a++) {
  6594. var s = e.heroLocations[a]
  6595. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6596. if(s.heroLocations){//有子项,选第一张截图
  6597. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6598. }else{
  6599. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6600. }
  6601. if (l.attr("data-index", a),
  6602. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6603. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6604. s.name) {
  6605. var c = $('<div class="overlay"></div>').text(s.name);
  6606. l.prepend(c)
  6607. }
  6608. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6609. var h = e.panos.get(s.panoId)
  6610. , 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>';
  6611. l.prepend(u)
  6612. }
  6613. r.append(l),
  6614. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6615. }
  6616. T = 144 * fe,
  6617. 111 * fe,
  6618. $(".thumbImg").on("mouseover", function() {
  6619. !function(e) {
  6620. return e.describe().inTransition
  6621. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6622. }),
  6623. $(".thumbImg").on("mouseout", function() {
  6624. i.clearPath()
  6625. }),
  6626. $(".thumbImg").on("click", function(e) {
  6627. y(e);
  6628. var t = $(this);
  6629. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6630. R.trackAlways("showcase_gui", {
  6631. gui_action: "click_highlight"
  6632. }),
  6633. i.goToHighlight([t.data("index"),0])//改
  6634. }),
  6635. $(".previous").find("a").on("click", function(e) {
  6636. y(e),
  6637. R.trackAlways("showcase_gui", {
  6638. gui_action: "prev_highlight"
  6639. }),
  6640. i.prevHighlight()
  6641. }),
  6642. $(".next").find("a").on("click", function(e) {
  6643. y(e),
  6644. R.trackAlways("showcase_gui", {
  6645. gui_action: "next_highlight"
  6646. }),
  6647. i.nextHighlight()
  6648. }),
  6649. $("#drawer").on("mouseleave", function(t) {
  6650. var i;
  6651. y(t);
  6652. try {
  6653. i = new MouseEvent("mouseup",{
  6654. clientX: t.clientX,
  6655. clientY: t.clientY,
  6656. screenX: t.screenX,
  6657. screenY: t.screenY
  6658. })
  6659. } catch (e) {
  6660. (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)
  6661. }
  6662. document.dispatchEvent(i)
  6663. }),
  6664. (w = new Sly($("#scrollFrame"),{
  6665. horizontal: !0,
  6666. itemNav: "centered",
  6667. smart: !0,
  6668. scrollTrap: !0,
  6669. scrollBy: 1,
  6670. mouseDragging: !0,
  6671. touchDragging: !0,
  6672. speed: 300,
  6673. dragHandle: !0,
  6674. dynamicHandle: !0,
  6675. clickBar: !0,
  6676. scrollBar: $("#scroller"),
  6677. activateOn: null
  6678. }).init()).on("active", function(e, t) {
  6679. t,
  6680. _e("tour"),
  6681. $(".step").removeClass("active"),
  6682. $("#status").find(".curIdx").text(t + 1);
  6683. for (var i = 0; i <= t; i++)
  6684. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6685. }),
  6686. E()
  6687. //add :
  6688. let scrollFrame = $(w.frame)
  6689. scrollFrame.on("wheel.sly", function() {
  6690. lastMoveScrollTime = Date.now()
  6691. })
  6692. let dragstart
  6693. /* scrollFrame.on("pointerdown", function() {
  6694. dragstart = true
  6695. })
  6696. scrollFrame.on("pointerup", function() {
  6697. dragstart = false
  6698. }) */
  6699. scrollFrame.on("pointermove", function() {
  6700. //if(dragstart){
  6701. lastMoveScrollTime = Date.now()
  6702. //}
  6703. })
  6704. }(s, l, c) : (Ce.highlight.visible = !1,
  6705. Ce.tourControls.visible = !1),
  6706. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6707. function() {
  6708. var n;
  6709. document.body.addEventListener("mousedown", function(e) {
  6710. n = 0 === e.button || 1 === e.which ? e.target : null
  6711. }, !0),
  6712. document.body.addEventListener("mouseup", function(t) {
  6713. n !== t.target && (n = b(n, t.target));
  6714. var e = document.getElementById("gui-parent");
  6715. if (b(e, n) !== e && (n = null),
  6716. n) {
  6717. var i;
  6718. try {
  6719. i = new MouseEvent("click",t)
  6720. } catch (e) {
  6721. (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)
  6722. }
  6723. i.syntheticClick = !0,
  6724. n.dispatchEvent(i),
  6725. n = null
  6726. }
  6727. }, !0),
  6728. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6729. e.syntheticClick || (e.stopPropagation(),
  6730. "A" === e.target.nodeName && e.preventDefault())
  6731. }, !0)
  6732. }(),
  6733. A(c),
  6734. C(s, t),
  6735. s.on("floor.changed", I),
  6736. s.on("waiting", function(e) {
  6737. _(e)
  6738. }
  6739. .bind(this, s)),
  6740. s.on("waiting-done", function(e) {
  6741. _(e)
  6742. }
  6743. .bind(this, s)),
  6744. c.on(re.ModeChanged, function(e, t) {
  6745. A(c),
  6746. v(l, c),
  6747. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6748. U.updateMode(t)
  6749. }),
  6750. e.on(oe.Move, _e.bind(this, "move")),
  6751. c.on(re.Ready, function() {
  6752. O.init(e, c, c.tagManager, l),
  6753. c.on(re.ModeChanged, function(e, t) {
  6754. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6755. })
  6756. }),
  6757. c.on(re.PanoChosen, function(e, t) {
  6758. A(c, t),
  6759. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6760. }),
  6761. V.on(k.CLOSE, function(e) {
  6762. switch (e) {
  6763. case "vr-modal":
  6764. X.dismiss();
  6765. break;
  6766. case "share-modal":
  6767. K.hide();
  6768. break;
  6769. case "terms-modal":
  6770. W.hide()
  6771. }
  6772. });
  6773. var lastMoveScrollTime = 0;//add
  6774. 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();
  6775. l.on("update.controls", function() {
  6776. var e, t, i, n = l.describe();
  6777. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6778. u.show()),
  6779. n.tourInProgress && (d.forEach(function(e) {
  6780. e.classList.add("playing")
  6781. }),
  6782. p.addClass("playing"),
  6783. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6784. u.hide()),
  6785. n.tourInProgress || (q.stopTour(),
  6786. d.forEach(function(e) {
  6787. e.classList.remove("playing")
  6788. }),
  6789. p.removeClass("playing"),
  6790. f.removeClass("playing"))),
  6791. null !== n.currentItem) {
  6792. var r, o;
  6793. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6794. n.onTheBus ? (r = "active",
  6795. o = "recent") : (o = "active",
  6796. r = "recent");
  6797. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6798. for (e = 0; e < s.heroLocations.length; e += 1)
  6799. i = g.eq(e),
  6800. t = m.eq(e),
  6801. i.removeClass(o),
  6802. t.removeClass(o),
  6803. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6804. t.addClass(r),
  6805. // 如果一段时间内用户不拖拽滚动scroll,才focus回这个item
  6806. (Date.now() - lastMoveScrollTime > 2000) && w.activate(e)
  6807. ): n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6808. t.addClass(r)) : (i.removeClass(r),
  6809. t.removeClass(r))
  6810. } else
  6811. for (e = 0; e < s.heroLocations.length; e += 1)
  6812. i = g.eq(e),
  6813. t = m.eq(e),
  6814. i.removeClass("active recent"),
  6815. t.removeClass("active recent");
  6816. v(l, c)
  6817. }),
  6818. document.addEventListener("keydown", function(e) {
  6819. switch (R.updateInteraction(oe.InteractionKey),
  6820. e.which) {
  6821. case te.ZERO:
  6822. M.debug && s.toggleAlpha();
  6823. break;
  6824. case te.NINE:
  6825. M.debug && B.toggle();
  6826. break;
  6827. case te.ONE:
  6828. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6829. break;
  6830. case te.TWO:
  6831. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6832. break;
  6833. case te.THREE:
  6834. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6835. break;
  6836. case te.FOUR:
  6837. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6838. break;
  6839. case te.SPACE:
  6840. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6841. break;
  6842. case te.RETURN:
  6843. M.debug && s.toggleExplodeUp();
  6844. break;
  6845. case te.P:
  6846. !function(e) {
  6847. me.gui || (me.gui = function(e) {
  6848. var t = new he.GUI;
  6849. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6850. e.setSweepVisibility(M.showSweeps)
  6851. }),
  6852. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6853. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6854. M.transition.flySpeed = 0,
  6855. t.__controllers.forEach(function(e) {
  6856. e.updateDisplay()
  6857. })
  6858. }),
  6859. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6860. $(t.__closeButton).hide(),
  6861. t
  6862. }(me.model)),
  6863. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6864. }(!me.visible);
  6865. break;
  6866. case te.U:
  6867. !function(e) {
  6868. ve.gui || (ve.gui = function(t, i) {
  6869. function e() {
  6870. var e = i.toJSON();
  6871. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6872. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6873. }
  6874. var n = {}
  6875. , r = new he.GUI({
  6876. autoPlace: !0,
  6877. width: "60%"
  6878. });
  6879. return e(),
  6880. i.on(re.ViewChanged, e),
  6881. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6882. r.domElement.id = "datLinks",
  6883. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6884. if (!S.detectSafari()) {
  6885. var t = document.createElement("button");
  6886. t.classList.add("btn-deep-link"),
  6887. t.innerText = se.MENU_COPY,
  6888. e.nextSibling.appendChild(t);
  6889. var n = function() {
  6890. alert(se.LINK_ALERT_COPY),
  6891. t.hide()
  6892. };
  6893. t.addEventListener("click", function(e) {
  6894. try {
  6895. var t = e.target.parentNode.childNodes[0];
  6896. t.select();
  6897. var i = document.execCommand("copy");
  6898. t.blur(),
  6899. i || n()
  6900. } catch (e) {
  6901. n()
  6902. }
  6903. })
  6904. }
  6905. }),
  6906. $(r.__closeButton).hide(),
  6907. r
  6908. }(ve.model, ve.player)),
  6909. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6910. }(!ve.visible);
  6911. break;
  6912. case te.X:
  6913. M.debug && s.toggleExplode();
  6914. break;
  6915. case te.PLUSEQUALS:
  6916. l.player.activatePersistentZooming(!0),
  6917. O.hideUi();
  6918. break;
  6919. case te.DASHUNDERSCORE:
  6920. l.player.activatePersistentZooming(!1),
  6921. O.hideUi();
  6922. break;
  6923. case te.SEVEN:
  6924. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6925. break;
  6926. case te.EIGHT:
  6927. l.player.decreaseZoomSpeed();
  6928. break;
  6929. case te.NINE:
  6930. l.player.increaseZoomSpeed()
  6931. }
  6932. return c && c.reticule.hide(),
  6933. !0
  6934. }
  6935. .bind(this)),
  6936. document.addEventListener("keyup", function(e) {
  6937. switch (e.which) {
  6938. case te.PLUSEQUALS:
  6939. l.player.deactivatePersistentZooming();
  6940. break;
  6941. case te.DASHUNDERSCORE:
  6942. l.player.deactivatePersistentZooming()
  6943. }
  6944. }
  6945. .bind(this)),
  6946. function(e) {
  6947. me = {
  6948. gui: null,
  6949. visible: !1,
  6950. model: e
  6951. }
  6952. }(s),
  6953. function(e, t) {
  6954. ve = {
  6955. gui: null,
  6956. visible: !1,
  6957. model: e,
  6958. player: t
  6959. }
  6960. }(s, l.player),
  6961. function(e) {
  6962. function t(e, i) {
  6963. $(e).find("a").each(function(e, t) {
  6964. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6965. t.style.pointerEvents = i ? "auto" : "none"
  6966. })
  6967. }
  6968. e.on(de.ZoomMax, function() {
  6969. t("#gui-zoomin", !1),
  6970. t("#gui-zoomout", !0)
  6971. }),
  6972. e.on(de.ZoomMin, function() {
  6973. t("#gui-zoomin", !0),
  6974. t("#gui-zoomout", !1)
  6975. }),
  6976. e.on(de.ZoomIn, function() {
  6977. t("#gui-zoomout", !0)
  6978. }),
  6979. e.on(de.ZoomOut, function() {
  6980. t("#gui-zoomin", !0)
  6981. }),
  6982. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6983. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6984. }(c),
  6985. P.setAutoPlay(s.heroCount()),
  6986. U.init(c, i.mode),
  6987. U.on(H.OPENED, _e.bind(this, "help")),
  6988. W.init(),
  6989. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6990. function() {
  6991. _e("terms"),
  6992. V.open(o)
  6993. }
  6994. )),
  6995. W.on(j.CLOSED, V.reset),
  6996. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6997. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6998. M.profiling.enabled && B.show(),
  6999. q.init(l)
  7000. }
  7001. ,
  7002. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7003. function a() {
  7004. o.setLoadingStartTime(),
  7005. function() {
  7006. function e(e) {
  7007. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7008. }
  7009. $("body").css("touch-action", "none"),
  7010. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7011. var t = document.getElementById("terms-text")
  7012. , i = document.getElementById("more-help-wrapper")
  7013. , n = (document.getElementById("navigation-help-wrapper"),
  7014. document.getElementById("help-dialog"),
  7015. document.getElementById("tag-billboards"));
  7016. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7017. passive: !1
  7018. }),
  7019. document.body.addEventListener("DOMMouseScroll", e)),
  7020. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7021. e.stopPropagation()
  7022. })
  7023. }(),
  7024. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7025. l()) : function(e) {
  7026. L.show(e),
  7027. c()
  7028. }(l)
  7029. }
  7030. var s = $.Deferred()
  7031. , l = s.resolve.bind(s);
  7032. ye = !0,
  7033. _(e);
  7034. e.data.player_options && function(e) {
  7035. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7036. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7037. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7038. }(e.data.player_options),
  7039. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7040. se.localizeGUI();
  7041. !function(i) {
  7042. function e(e, t) {
  7043. return !!i.player_options[e] && i[t || e]
  7044. }
  7045. $(".model-title").text(i.name);
  7046. var t = M.pageTitle;
  7047. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7048. document.title = t,
  7049. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7050. delay: {
  7051. show: 50,
  7052. hide: 0
  7053. },
  7054. trigger: "hover",
  7055. html: !1,
  7056. viewport: {
  7057. selector: "body",
  7058. padding: 10
  7059. }
  7060. }),
  7061. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7062. z.populate({
  7063. name: e("model_name", "name"),
  7064. coBrand: e("presented_by"),
  7065. description: e("model_summary", "summary") || "暂无内容",
  7066. contactName: e("contact_name"),
  7067. address: e("address"),
  7068. phone: e("contact_phone"),
  7069. formattedPhone: i.formatted_contact_phone,
  7070. email: e("contact_email"),
  7071. url: e("external_url"),
  7072. socialSharing: i.enable_social_sharing && i.is_public
  7073. })
  7074. }(e.data);
  7075. r || $(".quick").addClass("hidden");
  7076. n ? (R.impression(),
  7077. a()) : (o.setWaitingStartTime(),
  7078. N.show(r, a))
  7079. return s
  7080. }
  7081. ,
  7082. Le.exports.endLoading = function(e, t, i) {
  7083. var n = t.player;
  7084. function r() {
  7085. i.dismissExaminedTag(),
  7086. i.disableHovering()
  7087. }
  7088. $("#gui-thumb").fadeOut(2500),
  7089. L.hide(function() {
  7090. ye = !1
  7091. }),
  7092. Y.init(e, i),
  7093. z.finishSetup(Object.keys(e.tags).length),
  7094. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7095. X.on(Z.OPENED, r),
  7096. K.on(ae.OPENED, r),
  7097. U.on(H.OPENED, r),
  7098. W.on(j.OPENED, r);
  7099. var o = i.enableHovering.bind(i);
  7100. if (X.on(Z.CLOSED, o),
  7101. K.on(ae.CLOSED, o),
  7102. U.on(H.CLOSED, o),
  7103. W.on(j.CLOSED, o),
  7104. M.labels.enabled && Object.keys(e.labels).length,
  7105. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7106. I(e.currentFloor, n.mode)),
  7107. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7108. h(e, t)),
  7109. c(),
  7110. v(t, t.player),
  7111. $("#gui").fadeIn(1500),
  7112. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7113. l(),
  7114. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7115. }, 2e3),
  7116. !S.isMobile())
  7117. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7118. $(a[s]).addClass("hasHover");
  7119. _(e),
  7120. z.setupToggling(),
  7121. window.editHotPanel && editHotPanel(),
  7122. function() {
  7123. var i = $("#pullTab")
  7124. , e = {
  7125. bottom: {
  7126. "border-bottom-left-radius": "10px",
  7127. "border-bottom-right-radius": "10px"
  7128. },
  7129. top: {
  7130. "border-top-left-radius": "10px",
  7131. "border-top-right-radius": "10px"
  7132. }
  7133. }
  7134. , t = {
  7135. bottom: {
  7136. "border-top-right-radius": "10px",
  7137. "border-bottom-right-radius": "10px"
  7138. },
  7139. top: {
  7140. "border-bottom-left-radius": "10px",
  7141. "border-top-left-radius": "10px"
  7142. }
  7143. };
  7144. function n(e, t) {
  7145. $("#gui-modes-map > div:visible:last").css(e),
  7146. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7147. }
  7148. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7149. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7150. }()
  7151. $(".toolRight a").removeClass('hasHover')
  7152. }
  7153. ,
  7154. Le.exports.onProgress = function(e) {
  7155. L.progress(e)
  7156. }
  7157. }
  7158. ).call(this, "/js/gui/gui.js")
  7159. }
  7160. , {
  7161. "../analytics": 4,
  7162. "../controls/serializer": 14,
  7163. "../enum/AlignmentType": 17,
  7164. "../enum/BlackoutStyle": 18,
  7165. "../enum/ControlEvents": 21,
  7166. "../enum/DirectorEvents": 23,
  7167. "../enum/Keys": 30,
  7168. "../enum/PathDiscardMode": 38,
  7169. "../enum/PathDisplayMode": 39,
  7170. "../enum/PlayerEvents": 40,
  7171. "../enum/VROption": 47,
  7172. "../enum/Vectors": 50,
  7173. "../enum/Viewmode": 51,
  7174. "../enum/WarpStyle": 52,
  7175. "../enum/ZoomEvents": 53,
  7176. "../lib/dat.gui": 93,
  7177. "../localization/localize": 108,
  7178. "../tag/Media/MediaEvent": 131,
  7179. "../objects/Snapshot": 153,
  7180. "../settings": 166,
  7181. "../util/ajax": 181,
  7182. "../util/browser": 182,
  7183. "../util/camera": 183,
  7184. "../util/logger": 189,
  7185. "../util/showcase": 193,
  7186. "../util/transitions": 195,
  7187. "./closer/ModalCloserEvent": 61,
  7188. "./closer/modalCloser": 62,
  7189. "./help/HelpEvent": 66,
  7190. "./help/help": 67,
  7191. "./helpManager": 68,
  7192. "./immersiveMode": 69,
  7193. "./konami": 70,
  7194. "./landingScreen": 71,
  7195. "./loadingScreen": 72,
  7196. "./memoryUsage": 73,
  7197. "./playButton": 74,
  7198. "./populateModal": 75,
  7199. "./sharing/ShareEvents": 76,
  7200. "./sharing/modal": 77,
  7201. "./terms/TermsEvent": 78,
  7202. "./terms/terms": 79,
  7203. "./title/TitleEvents": 80,
  7204. "./title/tagToggle": 81,
  7205. "./title/titleBar": 82,
  7206. "./tourInteraction": 84,
  7207. "./vr/vrEvent": 85,
  7208. "./vr/vrModal": 87,
  7209. "./webvr/WebVrEvent": 88,
  7210. "./webvr/webVRgui": 89,
  7211. three: 217
  7212. }],
  7213. 66: [function(e, t, i) {
  7214. "use strict";
  7215. t.exports = Object.freeze({
  7216. OPENED: "help.opened",
  7217. CLOSED: "help.closed"
  7218. })
  7219. }
  7220. , {}],
  7221. 67: [function(e, t, i) {
  7222. "use strict";
  7223. function n() {
  7224. p.on("click", function(e) {
  7225. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7226. setTimeout(function() {
  7227. x = !1
  7228. }, h.help.modalStayDuration),
  7229. S.emit(l.OPENED),
  7230. f.addClass("open " + T),
  7231. p.addClass("open"),
  7232. o(),
  7233. r(),
  7234. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7235. v.classList.add("fadeIn")))
  7236. }),
  7237. E.on("click", function(e) {
  7238. S.close()
  7239. }),
  7240. C.on("click", function(e) {
  7241. T && T !== a.TRANSITIONING && (o(),
  7242. r())
  7243. }),
  7244. I.on("click", function(e) {
  7245. o(),
  7246. I.addClass("underline-tab"),
  7247. c.fill(b, s.MORE_HELP),
  7248. f.addClass("more-help")
  7249. })
  7250. }
  7251. function r() {
  7252. C.addClass("underline-tab"),
  7253. c.fill(_, s.NAVIGATION, T),
  7254. f.addClass(T)
  7255. }
  7256. function o() {
  7257. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7258. A.forEach(function(e) {
  7259. e.classList.remove("underline-tab")
  7260. })
  7261. }
  7262. var a = e("../../enum/Viewmode")
  7263. , s = e("../../enum/HelpModalType")
  7264. , l = e("./HelpEvent")
  7265. , c = (e("../helpManager"),
  7266. e("./../populateModal"))
  7267. , h = e("../../settings")
  7268. , u = e("../../util/common")
  7269. , d = e("events").EventEmitter
  7270. , p = $(".footer-help").eq(0)
  7271. , f = $("#help-dialog").eq(0)
  7272. , g = document.querySelector("#quick-logo")
  7273. , m = document.querySelector("#loaderCoBrand")
  7274. , v = document.querySelector("#help-dialog")
  7275. , y = document.querySelector(".footer")
  7276. , A = $(".help-tabs").children().toArray()
  7277. , C = $(".navigation-tab").eq(0)
  7278. , I = $(".more-help-tab").eq(0)
  7279. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7280. f.find(".close").eq(0))
  7281. , _ = f.find(".interactions").toArray()
  7282. , b = f.find(".ui-instructions").toArray()
  7283. , w = a.PANORAMA
  7284. , T = a.PANORAMA
  7285. , x = !1
  7286. , S = {
  7287. init: function(e, t) {
  7288. w = T = t,
  7289. [v, m, g, y].forEach(function(e) {
  7290. e.classList.add(c.deviceType)
  7291. }),
  7292. n()
  7293. },
  7294. close: function() {
  7295. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7296. p.removeClass("open"),
  7297. f.removeClass("open"),
  7298. v.classList.contains("fadeIn"))) {
  7299. v.classList.remove("fadeIn");
  7300. var e = T === a.TRANSITIONING ? w : T;
  7301. c.clear(_, s.NAVIGATION, e)
  7302. }
  7303. },
  7304. updateMode: function(e) {
  7305. w = T,
  7306. T = e
  7307. }
  7308. };
  7309. u.extendObject(S, d.prototype),
  7310. t.exports = S
  7311. }
  7312. , {
  7313. "../../enum/HelpModalType": 28,
  7314. "../../enum/Viewmode": 51,
  7315. "../../settings": 166,
  7316. "../../util/common": 185,
  7317. "../helpManager": 68,
  7318. "./../populateModal": 75,
  7319. "./HelpEvent": 66,
  7320. events: 202
  7321. }],
  7322. 68: [function(s, l, e) {
  7323. (function(e) {
  7324. "use strict";
  7325. var t = s("../util/browser")
  7326. , i = s("./../util/logger")
  7327. , n = s("./../settings")
  7328. , r = new i(e)
  7329. , o = function() {
  7330. var t;
  7331. try {
  7332. return t = window.localStorage.getItem("visitCount") || "0",
  7333. t = (parseFloat(t) + 1).toString(),
  7334. window.localStorage.setItem("visitCount", t),
  7335. r.debug("visitCount = " + t),
  7336. t
  7337. } catch (e) {
  7338. t = "1",
  7339. r.debug("couldn't set local storage")
  7340. }
  7341. }()
  7342. , a = !1;
  7343. l.exports = {
  7344. isHelpDisabled: function() {
  7345. return "0" === t.valueFromHash("help", null) || a
  7346. },
  7347. isLargeHelpEnabled: function() {
  7348. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7349. },
  7350. isSmallHelpEnabled: function() {
  7351. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7352. },
  7353. isHelpEnabled: function() {
  7354. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7355. },
  7356. setAutoPlay: function(e) {
  7357. a = 0 <= n.warp.auto && 1 < e
  7358. }
  7359. }
  7360. }
  7361. ).call(this, "/js/gui/helpManager.js")
  7362. }
  7363. , {
  7364. "../util/browser": 182,
  7365. "./../settings": 166,
  7366. "./../util/logger": 189
  7367. }],
  7368. 69: [function(e, t, i) {
  7369. "use strict";
  7370. function r(e) {
  7371. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7372. T = !0,
  7373. h.close(),
  7374. function(e) {
  7375. !n(e) && S ? v.forEach(function(e) {
  7376. e.classList.remove("drawerOpen"),
  7377. e.classList.add("duringTour")
  7378. }) : C.hasClass("open") ? v.forEach(function(e) {
  7379. e.classList.remove("duringTour"),
  7380. e.classList.add("drawerOpen")
  7381. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7382. e.classList.add("fadeOut")
  7383. })
  7384. }(e),
  7385. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7386. C.hasClass("playing") || (y.forEach(function(e) {
  7387. e.classList.add("detectHover")
  7388. }),
  7389. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7390. }
  7391. function o() {
  7392. C.hasClass("playing") || (clearTimeout(x),
  7393. x = setTimeout(a, c.immersive.timeToShowAgain))
  7394. }
  7395. function a() {
  7396. clearTimeout(x),
  7397. T = !1,
  7398. m.forEach(function(e) {
  7399. e.classList.remove("drawerOpen")
  7400. }),
  7401. S || v.forEach(function(e) {
  7402. e.classList.remove("duringTour")
  7403. }),
  7404. y.forEach(function(e) {
  7405. e.classList.remove("detectHover")
  7406. })
  7407. }
  7408. function s() {
  7409. T ? a() : r(),
  7410. M = !0,
  7411. setTimeout(function() {
  7412. M = !1
  7413. }, c.immersive.uiStayDuration)
  7414. }
  7415. function n(e) {
  7416. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7417. }
  7418. var l = e("../util/browser")
  7419. , c = e("../settings")
  7420. , h = e("./help/help")
  7421. , u = e("../enum/tagEvents")
  7422. , d = e("../enum/ControlEvents")
  7423. , p = e("../enum/PlayerEvents")
  7424. , f = e("../enum/DirectorEvents")
  7425. , g = (p = e("../enum/PlayerEvents"),
  7426. e("../enum/Viewmode"))
  7427. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7428. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7429. , y = $("#hover-bottom, #hover-top").toArray()
  7430. , A = ($("#pullTab").eq(0),
  7431. $("#playHead").eq(0),
  7432. $(".pinBottom-container").eq(0))
  7433. , C = $("#drawer").eq(0)
  7434. , I = $("#drawer-container").eq(0)
  7435. , E = $("#meta-info").eq(0)
  7436. , _ = $(".pinTop.left").eq(0)
  7437. , b = $("#player").eq(0)
  7438. , w = document.getElementById("pullTab")
  7439. , T = !1
  7440. , x = null
  7441. , S = !1
  7442. , M = !1
  7443. , R = null
  7444. , P = !1;
  7445. t.exports.init = function(e, t, i, n) {
  7446. (function(t, i, e, n) {
  7447. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7448. t.controls[e].on(d.Move, r),
  7449. t.controls[e].on(d.LongTap, s)
  7450. }),
  7451. b.on("mousewheel DOMMouseScroll", r),
  7452. e.on(u.TagActivated, r),
  7453. e.on(u.TagNavigation, r),
  7454. i.on(p.FlyingEnded, o),
  7455. i.on(p.ModeChanging, function(e, t) {
  7456. P = t !== g.PANORAMA && e !== g.PANORAMA
  7457. }),
  7458. i.on(p.ModeChanged, function(e, t) {
  7459. R = i.mode,
  7460. t !== g.TRANSITIONING ? a() : r("modeChange")
  7461. }),
  7462. n.on(f.TourStart, function() {
  7463. S = !0,
  7464. r()
  7465. }),
  7466. n.on(f.TourEnd, function() {
  7467. S = !1,
  7468. a()
  7469. }),
  7470. n.on(f.ActionInterrupted, function() {
  7471. S = !1
  7472. }),
  7473. w.addEventListener("touchend", function() {
  7474. $("#pullTab").hasClass("opened") && !S && a()
  7475. }, !0)
  7476. }
  7477. )(e, t, i, n),
  7478. l.isMobile() ? (y.forEach(function(e) {
  7479. e.classList.add("mobile")
  7480. }),
  7481. A.click(a)) : (y.forEach(function(e) {
  7482. e.addEventListener("mouseleave", function() {
  7483. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7484. }, !0)
  7485. }),
  7486. b.mouseleave(function() {
  7487. y[0].classList.contains("detectHover") && a()
  7488. })),
  7489. R = t.mode
  7490. }
  7491. ,
  7492. t.exports.hideUi = r,
  7493. t.exports.resetDrawer = function() {
  7494. I.hasClass("duringTour") || (S = !1,
  7495. r("gui"),
  7496. a())
  7497. }
  7498. }
  7499. , {
  7500. "../enum/ControlEvents": 21,
  7501. "../enum/DirectorEvents": 23,
  7502. "../enum/tagEvents": 32,
  7503. "../enum/PlayerEvents": 40,
  7504. "../enum/Viewmode": 51,
  7505. "../settings": 166,
  7506. "../util/browser": 182,
  7507. "./help/help": 67
  7508. }],
  7509. 70: [function(i, n, e) {
  7510. (function(e) {
  7511. "use strict";
  7512. var t = i("./../util/logger")
  7513. , o = i("./../settings")
  7514. , a = i("./debug")
  7515. , s = i("./../util/common")
  7516. , l = (i("./gui"),
  7517. new t(e));
  7518. o.console && $("body").append('<div id="debug-console"></div>'),
  7519. n.exports.init = function(i, n, r) {
  7520. l.debug("konami has the modelInstance");
  7521. var t = [];
  7522. $(window).on("keydown", function(e) {
  7523. t.push(e.which),
  7524. t.length > o.secretPanelWord.length && t.shift(),
  7525. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7526. o.debug = !0)
  7527. }),
  7528. $(window).on("keydown", function e(t) {
  7529. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7530. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7531. })
  7532. }
  7533. }
  7534. ).call(this, "/js/gui/konami.js")
  7535. }
  7536. , {
  7537. "./../settings": 166,
  7538. "./../util/common": 185,
  7539. "./../util/logger": 189,
  7540. "./debug": 63,
  7541. "./gui": 65
  7542. }],
  7543. 71: [function(e, t, i) {
  7544. "use strict";
  7545. function r() {
  7546. s.clear(m, l.LANDING[v]),
  7547. g.removeClass("fadeIn")
  7548. }
  7549. var o = e("../settings")
  7550. , a = (e("./help/help"),
  7551. e("./helpManager"))
  7552. , s = e("./populateModal")
  7553. , l = e("../enum/HelpModalType")
  7554. , n = e("../enum/Viewmode")
  7555. , c = e("../enum/DirectorEvents")
  7556. , h = e("../enum/PlayerEvents")
  7557. , u = $("#quick-blackout").eq(0)
  7558. , d = $("#quick-logo").eq(0)
  7559. , p = $(".quick-brand").toArray()
  7560. , f = $("#loaderCoBrand").eq(0)
  7561. , g = $("#interaction-modal").eq(0)
  7562. , m = g.find(".interaction").toArray()
  7563. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7564. "");
  7565. t.exports.delayLanding = function(e) {
  7566. var t = $.Deferred();
  7567. e || t.resolve();
  7568. var i = o.startupFlyinDelay;
  7569. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7570. setTimeout(t.resolve.bind(t), i),
  7571. t
  7572. }
  7573. ,
  7574. t.exports.showMessage = function(e, t, i) {
  7575. var n = 0;
  7576. o.quickstart.enabled && (function(e) {
  7577. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7578. d.before(f),
  7579. p = $(".quick-brand").toArray()), */
  7580. u.addClass("fadeOut")
  7581. /* setTimeout(function() {
  7582. p.forEach(function(e) {
  7583. e.classList.add("fadeIn")
  7584. })
  7585. }, o.quickstart.showTextDelay),
  7586. setTimeout(function() {
  7587. p.forEach(function(e) {
  7588. e.classList.add("fadeOut")
  7589. })
  7590. }, o.quickstart.fadeOutDelay) */
  7591. }(i),
  7592. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7593. function(e, t) {
  7594. setTimeout(function() {
  7595. if (a.isHelpEnabled()) {
  7596. if (t(),
  7597. s.init(),
  7598. g.addClass("fadeIn landing " + s.deviceType),
  7599. a.isSmallHelpEnabled())
  7600. return void g.addClass("small");
  7601. s.fill(m, l.LANDING[v]),
  7602. g.addClass(v)
  7603. }
  7604. }, e);
  7605. var i = {
  7606. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7607. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7608. }
  7609. , n = $(".nav-icon .icon");
  7610. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7611. function r(e) {
  7612. e.on("click", function() {
  7613. var e = null;
  7614. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7615. i.length < e || e < 1)
  7616. return !1;
  7617. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7618. "data-page": e,
  7619. src: i.mobile[e - 1]
  7620. }) : n.attr({
  7621. "data-page": e,
  7622. src: i.pc[e - 1]
  7623. })
  7624. })
  7625. }
  7626. r($(".next-button")),
  7627. r($(".prev-button"))
  7628. }(n, function() {
  7629. e.once(h.Move, r),
  7630. t.once(c.TourStart, r)
  7631. })
  7632. }
  7633. ,
  7634. t.exports.init = function(e, t) {
  7635. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7636. }
  7637. ,
  7638. t.exports.dismissModal = r
  7639. }
  7640. , {
  7641. "../enum/DirectorEvents": 23,
  7642. "../enum/HelpModalType": 28,
  7643. "../enum/PlayerEvents": 40,
  7644. "../enum/Viewmode": 51,
  7645. "../settings": 166,
  7646. "./help/help": 67,
  7647. "./helpManager": 68,
  7648. "./populateModal": 75
  7649. }],
  7650. 72: [function(e, t, i) {
  7651. "use strict";
  7652. var n = e("./circleLoader").circleLoader;
  7653. t.exports = {
  7654. element: $("#gui-loading"),
  7655. hide: function(e) {
  7656. n.done(),
  7657. this.element.fadeOut(1500, e)
  7658. },
  7659. show: function(e) {
  7660. this.element.fadeIn(500, function() {
  7661. this.element.css("display", "table"),
  7662. e && e()
  7663. }
  7664. .bind(this))
  7665. },
  7666. progress: function(e) {
  7667. n.set(e)
  7668. }
  7669. }
  7670. }
  7671. , {
  7672. "./circleLoader": 60
  7673. }],
  7674. 73: [function(e, t, i) {
  7675. "use strict";
  7676. var n = e("../settings")
  7677. , r = $("#memory-info")
  7678. , o = r.find("#memory-gpu")
  7679. , a = !1;
  7680. t.exports = {
  7681. show: function() {
  7682. n.profiling.enabled && (r.show(),
  7683. a = !0)
  7684. },
  7685. hide: function() {
  7686. r.hide(),
  7687. a = !1
  7688. },
  7689. toggle: function() {
  7690. a ? this.hide() : this.show()
  7691. },
  7692. update: function(e) {
  7693. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7694. }
  7695. }
  7696. }
  7697. , {
  7698. "../settings": 166
  7699. }],
  7700. 74: [function(e, t, i) {
  7701. "use strict";
  7702. e("../util/browser"),
  7703. e("../analytics");
  7704. e("../settings"),
  7705. t.exports = {
  7706. show: function(e, t) {
  7707. $("#gui-message").fadeOut(500, function() {
  7708. t()
  7709. })
  7710. }
  7711. }
  7712. }
  7713. , {
  7714. "../analytics": 4,
  7715. "../settings": 166,
  7716. "../util/browser": 182
  7717. }],
  7718. 75: [function(e, t, i) {
  7719. "use strict";
  7720. function n(e, t, i, n) {
  7721. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7722. }
  7723. var r = e("../util/browser")
  7724. , o = e("../localization/localize")
  7725. , a = e("../enum/HelpModalType")
  7726. , s = (e("../enum/HelpModalSize"),
  7727. e("../enum/Viewmode"));
  7728. t.exports = {
  7729. init: function() {
  7730. if (!this.hasInitialized) {
  7731. this.hasInitialized = !0,
  7732. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7733. this.assets = {},
  7734. this.assets[a.LANDING[s.PANORAMA]] = {
  7735. desktop: {
  7736. left: {
  7737. "top-info": o.ROTATE,
  7738. "big-image": "images/nav_help_mouse_drag_left.png",
  7739. keyboard: "images/nav_help_keyboard_left_right.png"
  7740. },
  7741. middle: {
  7742. "top-info": o.MOVE,
  7743. "big-image": "images/nav_help_mouse_click.png",
  7744. keyboard: "images/nav_help_keyboard_up_down.png"
  7745. },
  7746. right: {
  7747. "top-info": o.ZOOM,
  7748. "big-image": "images/nav_help_mouse_zoom.png",
  7749. keyboard: "images/nav_help_zoom_keys.png"
  7750. }
  7751. },
  7752. mobile: {
  7753. left: {
  7754. "top-info": o.ROTATE,
  7755. "big-image": "images/nav_help_gesture_drag.png"
  7756. },
  7757. middle: {
  7758. "top-info": o.MOVE,
  7759. "big-image": "images/nav_help_gesture_tap.png"
  7760. },
  7761. right: {
  7762. "top-info": o.ZOOM,
  7763. "big-image": "images/nav_help_gesture_pinch.png"
  7764. }
  7765. }
  7766. },
  7767. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7768. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7769. desktop: {
  7770. left: {
  7771. "top-info": o.ROTATE,
  7772. "big-image": "images/nav_help_mouse_drag_left.png",
  7773. keyboard: "images/nav_help_keyboard_left_right.png"
  7774. },
  7775. middle: {
  7776. "top-info": o.MOVE,
  7777. "big-image": "images/nav_help_mouse_position_right.png"
  7778. }
  7779. },
  7780. mobile: {
  7781. left: {
  7782. "top-info": o.ROTATE,
  7783. "big-image": "images/nav_help_gesture_drag.png"
  7784. },
  7785. middle: {
  7786. "top-info": o.MOVE,
  7787. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7788. }
  7789. }
  7790. },
  7791. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7792. desktop: {
  7793. left: {
  7794. "top-info": o.MOVE,
  7795. "big-image": "images/nav_help_mouse_position_left.png"
  7796. },
  7797. middle: {
  7798. "top-info": o.ROTATE,
  7799. "big-image": "images/nav_help_mouse_drag_right.png",
  7800. keyboard: "images/nav_help_keyboard_left_right.png"
  7801. }
  7802. },
  7803. mobile: {
  7804. left: {
  7805. "top-info": o.MOVE,
  7806. "big-image": "images/nav_help_gesture_position.png"
  7807. },
  7808. middle: {
  7809. "top-info": o.ROTATE,
  7810. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7811. }
  7812. }
  7813. };
  7814. var e = {
  7815. "top-info": o.INSIDE,
  7816. "big-image": "images/nav_help_click_inside.png",
  7817. keyboard: "images/nav_help_inside_key.png"
  7818. };
  7819. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7820. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7821. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7822. var t = {
  7823. "top-info": o.INSIDE,
  7824. "big-image": "images/nav_help_tap_inside.png"
  7825. };
  7826. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7827. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7828. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7829. this.assets[a.NAVIGATION] = {},
  7830. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7831. desktop: {
  7832. left: {
  7833. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7834. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7835. "big-image": "images/nav_help_mouse_drag_left.png",
  7836. keyboard: "images/nav_help_keyboard_left_right.png"
  7837. },
  7838. middle: {
  7839. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7840. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7841. "big-image": "images/nav_help_mouse_click.png",
  7842. keyboard: "images/nav_help_keyboard_up_down.png"
  7843. },
  7844. right: {
  7845. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7846. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7847. "big-image": "images/nav_help_mouse_zoom.png",
  7848. keyboard: "images/nav_help_zoom_keys.png"
  7849. }
  7850. },
  7851. mobile: {
  7852. left: {
  7853. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7854. "big-image": "images/nav_help_gesture_drag.png"
  7855. },
  7856. middle: {
  7857. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7858. "big-image": "images/nav_help_gesture_tap.png"
  7859. },
  7860. right: {
  7861. "top-info": o.HELP_MOBILE_3,
  7862. "big-image": "images/nav_help_gesture_pinch.png"
  7863. }
  7864. }
  7865. },
  7866. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7867. desktop: {
  7868. left: {
  7869. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7870. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7871. "big-image": "images/nav_help_mouse_drag_left.png",
  7872. keyboard: "images/nav_help_keyboard_all.png"
  7873. },
  7874. middle: {
  7875. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7876. "big-image": "images/nav_help_mouse_position_right.png"
  7877. },
  7878. right: {
  7879. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7880. "big-image": "images/nav_help_mouse_zoom.png"
  7881. }
  7882. },
  7883. mobile: {
  7884. left: {
  7885. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7886. "big-image": "images/nav_help_gesture_drag.png"
  7887. },
  7888. middle: {
  7889. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7890. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7891. },
  7892. right: {
  7893. "top-info": o.HELP_MOBILE_3,
  7894. "big-image": "images/nav_help_gesture_pinch.png"
  7895. }
  7896. }
  7897. },
  7898. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7899. desktop: {
  7900. left: {
  7901. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7902. "big-image": "images/nav_help_mouse_position_left.png"
  7903. },
  7904. middle: {
  7905. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7906. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7907. "big-image": "images/nav_help_mouse_drag_right.png",
  7908. keyboard: "images/nav_help_keyboard_left_right.png"
  7909. },
  7910. right: {
  7911. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7912. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7913. "big-image": "images/nav_help_mouse_zoom.png",
  7914. keyboard: "images/nav_help_keyboard_up_down.png"
  7915. }
  7916. },
  7917. mobile: {
  7918. left: {
  7919. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7920. "big-image": "images/nav_help_gesture_position.png"
  7921. },
  7922. middle: {
  7923. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7924. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7925. },
  7926. right: {
  7927. "top-info": o.HELP_MOBILE_3,
  7928. "big-image": "images/nav_help_gesture_pinch.png"
  7929. }
  7930. }
  7931. },
  7932. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7933. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7934. "top-info": o.HELP_DESKTOP_360_2A,
  7935. "bottom-info": o.HELP_DESKTOP_360_2B,
  7936. "big-image": "images/nav_help_click_inside.png",
  7937. keyboard: "images/nav_help_inside_key.png"
  7938. },
  7939. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7940. "top-info": o.HELP_MOBILE_360_2,
  7941. "big-image": "images/nav_help_tap_inside.png"
  7942. },
  7943. this.assets[a.MORE_HELP] = {
  7944. desktop: {
  7945. "more-help-hlr": {
  7946. "top-info": o.HELP_MORE_HLR_A,
  7947. "big-image": "images/nav_help_expand.svg",
  7948. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7949. },
  7950. "more-help-dollhouse": {
  7951. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7952. "big-image": "images/nav_help_dollhouse.svg",
  7953. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7954. },
  7955. "more-help-floors": {
  7956. "top-info": o.HELP_MORE_FLOORS_A,
  7957. "big-image": "images/nav_help_floor picker.svg",
  7958. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7959. },
  7960. "more-help-tag": {
  7961. "top-info": o.HELP_MORE_TAG_A,
  7962. "big-image": "images/nav_help_tag.svg",
  7963. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7964. },
  7965. "more-help-zoom": {
  7966. "top-info": o.HELP_MORE_ZOOM_A,
  7967. "big-image": "images/nav_help_zoom.svg",
  7968. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7969. },
  7970. "more-help-tour": {
  7971. "top-info": o.HELP_MORE_TOUR_A,
  7972. "big-image": "images/nav_help_play.png",
  7973. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7974. },
  7975. "more-help-inside": {
  7976. "top-info": o.HELP_MORE_INSIDE_A,
  7977. "big-image": "images/nav_help_inside.svg",
  7978. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7979. },
  7980. "more-help-vr": {
  7981. "top-info": o.HELP_MORE_VR_A,
  7982. "big-image": "images/nav_help_vr.svg",
  7983. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7984. },
  7985. "more-help-360": {
  7986. "top-info": o.HELP_MORE_360_A,
  7987. "big-image": "images/nav_help_360.svg",
  7988. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7989. },
  7990. "more-help-fullscreen": {
  7991. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7992. "big-image": "images/nav_help_fullscreen.svg",
  7993. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7994. }
  7995. },
  7996. mobile: {
  7997. "more-help-hlr": {
  7998. "top-info": o.HELP_MORE_HLR_A,
  7999. "big-image": "images/nav_help_expand.svg",
  8000. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8001. },
  8002. "more-help-dollhouse": {
  8003. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8004. "big-image": "images/nav_help_dollhouse.svg",
  8005. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8006. },
  8007. "more-help-floors": {
  8008. "top-info": o.HELP_MORE_FLOORS_A,
  8009. "big-image": "images/nav_help_floor picker.svg",
  8010. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8011. },
  8012. "more-help-tag": {
  8013. "top-info": o.HELP_MORE_TAG_A,
  8014. "big-image": "images/nav_help_tag.svg",
  8015. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8016. },
  8017. "more-help-tour": {
  8018. "top-info": o.HELP_MORE_TOUR_A,
  8019. "big-image": "images/nav_help_play.png",
  8020. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8021. },
  8022. "more-help-inside": {
  8023. "top-info": o.HELP_MORE_INSIDE_A,
  8024. "big-image": "images/nav_help_inside.svg",
  8025. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8026. },
  8027. "more-help-vr": {
  8028. "top-info": o.HELP_MORE_VR_A,
  8029. "big-image": "images/webvr.svg",
  8030. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8031. },
  8032. "more-help-360": {
  8033. "top-info": o.HELP_MORE_360_A,
  8034. "big-image": "images/nav_help_360.svg",
  8035. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8036. }
  8037. }
  8038. },
  8039. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8040. desktop: {
  8041. left: {
  8042. "top-info": o.ROTATE,
  8043. "big-image": "images/nav_help_mouse_drag_left.png",
  8044. keyboard: "images/nav_help_keyboard_left_right.png"
  8045. },
  8046. middle: {
  8047. "top-info": o.MOVE,
  8048. "big-image": "images/nav_help_mouse_click.png",
  8049. keyboard: "images/nav_help_keyboard_up_down.png"
  8050. },
  8051. right: {
  8052. "top-info": o.PLAY,
  8053. "big-image": "images/Desktop-help-play-button.svg",
  8054. keyboard: "images/Desktop-help-spacebar-2.svg"
  8055. }
  8056. },
  8057. mobile: {
  8058. left: {
  8059. "top-info": o.ROTATE,
  8060. "big-image": "images/nav_help_gesture_drag.png"
  8061. },
  8062. middle: {
  8063. "top-info": o.MOVE,
  8064. "big-image": "images/nav_help_gesture_tap.png"
  8065. },
  8066. right: {
  8067. "top-info": o.PLAY,
  8068. "big-image": "images/mobile-help-play-button.svg"
  8069. }
  8070. }
  8071. },
  8072. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8073. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8074. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8075. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8076. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8077. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8078. }
  8079. },
  8080. fill: function(e, t, i) {
  8081. n.call(this, e, t, i, !0)
  8082. },
  8083. clear: function(e, t, i) {
  8084. n.call(this, e, t, i, !1)
  8085. }
  8086. }
  8087. }
  8088. , {
  8089. "../enum/HelpModalSize": 27,
  8090. "../enum/HelpModalType": 28,
  8091. "../enum/Viewmode": 51,
  8092. "../localization/localize": 108,
  8093. "../util/browser": 182
  8094. }],
  8095. 76: [function(e, t, i) {
  8096. "use strict";
  8097. t.exports = Object.freeze({
  8098. OPENED: "share.open",
  8099. CLOSED: "share.closed",
  8100. LINK_CLICKED: "share.linked"
  8101. })
  8102. }
  8103. , {}],
  8104. 77: [function(e, t, i) {
  8105. "use strict";
  8106. function n(n) {
  8107. function e(e, t) {
  8108. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8109. I.emit(l.LINK_CLICKED, {
  8110. channel: n
  8111. }),
  8112. window.open(C[n], "shareWindow", i)
  8113. }
  8114. switch (n) {
  8115. case A.FACEBOOK:
  8116. e(580, 420);
  8117. break;
  8118. case A.TWITTER:
  8119. e(550, 440);
  8120. break;
  8121. case A.MAIL:
  8122. I.emit(l.LINK_CLICKED, {
  8123. channel: "email"
  8124. }),
  8125. window.open(C[n], "_blank");
  8126. break;
  8127. case A.LINKEDIN:
  8128. }
  8129. }
  8130. function r(e) {
  8131. I.emit(l.LINK_CLICKED, {
  8132. channel: "copylink"
  8133. });
  8134. var t = document.createRange();
  8135. t.selectNodeContents(v);
  8136. var i = window.getSelection();
  8137. i.removeAllRanges(),
  8138. i.addRange(t),
  8139. document.execCommand("copy"),
  8140. y.classList.remove("hidden"),
  8141. v.classList.add("highlighted")
  8142. }
  8143. function o(e) {
  8144. e && (e.stopPropagation(),
  8145. e.target === v) || (window.getSelection().removeAllRanges(),
  8146. v.classList.remove("highlighted"),
  8147. y.classList.add("hidden"))
  8148. }
  8149. var a = e("../../util/browser")
  8150. , s = e("../../localization/localize")
  8151. , l = e("./ShareEvents")
  8152. , c = e("../../util/common")
  8153. , h = e("events").EventEmitter
  8154. , u = document.getElementById("sharing")
  8155. , d = document.getElementById("share-modal")
  8156. , p = document.getElementById("share-close")
  8157. , f = document.getElementById("facebook-share")
  8158. , g = document.getElementById("twitter-share")
  8159. , m = document.getElementById("mail-share")
  8160. , v = document.getElementById("share-url-text")
  8161. , y = document.getElementById("copy-success")
  8162. , A = Object.freeze({
  8163. FACEBOOK: "facebook",
  8164. TWITTER: "twitter",
  8165. MAIL: "mail",
  8166. LINKEDIN: "linkedin"
  8167. })
  8168. , C = {};
  8169. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8170. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8171. C[A.MAIL] = "mailto:?subject=";
  8172. var I = {
  8173. init: function(e) {
  8174. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8175. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8176. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8177. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8178. u.addEventListener("click", this.toggle.bind(this)),
  8179. p.addEventListener("click", this.hide.bind(this)),
  8180. v.addEventListener("click", r),
  8181. d.addEventListener("click", o),
  8182. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8183. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8184. m.addEventListener("click", n.bind(this, A.MAIL)),
  8185. v.textContent = window.location.href + "&utm_source=4",
  8186. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8187. u.classList.remove("hidden")
  8188. },
  8189. show: function() {
  8190. this.emit(l.OPENED),
  8191. d.classList.add("fadeIn")
  8192. },
  8193. hide: function() {
  8194. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8195. document.selection && document.selection.empty(),
  8196. window.getSelection().removeAllRanges(),
  8197. o(),
  8198. d.classList.remove("fadeIn"))
  8199. },
  8200. toggle: function() {
  8201. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8202. }
  8203. };
  8204. c.extendObject(I, h.prototype),
  8205. t.exports = I
  8206. }
  8207. , {
  8208. "../../localization/localize": 108,
  8209. "../../util/browser": 182,
  8210. "../../util/common": 185,
  8211. "./ShareEvents": 76,
  8212. events: 202
  8213. }],
  8214. 78: [function(e, t, i) {
  8215. "use strict";
  8216. t.exports = Object.freeze({
  8217. OPENED: "terms.opened",
  8218. CLOSED: "terms.closed"
  8219. })
  8220. }
  8221. , {}],
  8222. 79: [function(e, t, i) {
  8223. "use strict";
  8224. var n = e("./TermsEvent")
  8225. , r = e("../../localization/localize")
  8226. , o = e("../../analytics")
  8227. , a = e("../../util/ajax")
  8228. , s = e("../../util/common")
  8229. , l = e("events").EventEmitter
  8230. , c = document.getElementById("terms-modal")
  8231. , h = {
  8232. init: function() {
  8233. $(".footer-terms").on("click", function(e) {
  8234. e.preventDefault(),
  8235. this.show()
  8236. }
  8237. .bind(this)),
  8238. $("#terms-modal .close").on("click", this.hide.bind(this))
  8239. },
  8240. show: function() {
  8241. this.emit(n.OPENED),
  8242. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8243. var t = $("#terms-text").html(e);
  8244. o.track("showcase_gui", {
  8245. gui_action: "click_terms_button",
  8246. interaction_source: "gui"
  8247. }),
  8248. t.find("a").attr("target", "_blank")
  8249. }).fail(function() {
  8250. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8251. }),
  8252. c.classList.add("fadeIn")
  8253. },
  8254. hide: function(e) {
  8255. e && e.preventDefault(),
  8256. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8257. c.classList.remove("fadeIn")
  8258. }
  8259. };
  8260. s.extendObject(h, l.prototype),
  8261. t.exports = h
  8262. }
  8263. , {
  8264. "../../analytics": 4,
  8265. "../../localization/localize": 108,
  8266. "../../util/ajax": 181,
  8267. "../../util/common": 185,
  8268. "./TermsEvent": 78,
  8269. events: 202
  8270. }],
  8271. 80: [function(e, t, i) {
  8272. "use strict";
  8273. t.exports = Object.freeze({
  8274. OPEN_INFO: "title.open.info",
  8275. CLOSE_INFO: "title.close.info",
  8276. SHOW_INFO: "title.show.info",
  8277. HIDE_INFO: "title.hide.info",
  8278. LINK_CLICKED: "title.link.click",
  8279. CONTACT_LINK_CLICKED: "title.contact.click",
  8280. ORIGIN_LINK_CLICKED: "title.origin.click"
  8281. })
  8282. }
  8283. , {}],
  8284. 81: [function(e, t, i) {
  8285. "use strict";
  8286. var o = e("../../settings");
  8287. t.exports.init = function(e, t) {
  8288. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8289. function e(e) {
  8290. t.shouldShowtags = "show" === this.value,
  8291. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8292. }
  8293. document.getElementById("tag-toggles").classList.remove("hidden"),
  8294. document.getElementById("radio-tag-show").checked = !0;
  8295. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8296. n[r].addEventListener("change", e)
  8297. }(e, t)
  8298. }
  8299. }
  8300. , {
  8301. "../../settings": 166
  8302. }],
  8303. 82: [function(S, M, e) {
  8304. (function(e) {
  8305. "use strict";
  8306. function i(e) {
  8307. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8308. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8309. _.appendChild(function(e) {
  8310. var t = document.createElement("a");
  8311. return t.id = "url",
  8312. t.target = "_blank",
  8313. t.href = e,
  8314. t.innerText = e,
  8315. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8316. t
  8317. }(e)),
  8318. b.forEach(function(e) {
  8319. e.classList.add("share-link")
  8320. }),
  8321. 0))
  8322. }
  8323. function s(e, t) {
  8324. var i = e
  8325. , n = t;
  8326. return function(e, t) {
  8327. i.push(t || n, e)
  8328. }
  8329. }
  8330. var l = S("../../util/browser")
  8331. , t = S("../../util/common")
  8332. , n = S("../../util/logger")
  8333. , r = S("../../localization/localize")
  8334. , o = S("./titleBarSettings")
  8335. , c = S("../../settings")
  8336. , a = S("./TitleEvents")
  8337. , h = S("events").EventEmitter
  8338. , u = new n(e)
  8339. , d = document.querySelector(".pinTop.left")
  8340. , p = document.getElementsByClassName("title-container")[0]
  8341. , f = document.getElementById("title-toggle").querySelector("i")
  8342. , g = document.getElementById("meta-info-wrapper")
  8343. , m = document.getElementById("meta-info")
  8344. , v = document.getElementById("meta-description")
  8345. , y = document.getElementsByClassName("contact-info")[0]
  8346. , A = document.getElementById("contact-data")
  8347. , C = document.getElementById("addressTxt")
  8348. , I = document.getElementById("tag-toggles")
  8349. , E = document.getElementById("share-origin")
  8350. , _ = document.getElementById("share-link-wrapper")
  8351. , b = [m, g, p]
  8352. , w = !1
  8353. , T = !1
  8354. , x = {
  8355. populate: function(e) {
  8356. if (function(e, t) {
  8357. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8358. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8359. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8360. document.getElementById("gui-name").classList.add("noCoBrand"),
  8361. document.getElementById("cobrandTitle").classList.add("hidden")),
  8362. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8363. !1)
  8364. }(DATA.name, e.coBrand)) {
  8365. if (function(e) {
  8366. e ? (w = !0,
  8367. v.innerHTML = e) : v.classList.add("hidden")
  8368. }(e.description),
  8369. function(e, t, i, n) {
  8370. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8371. w = !0;
  8372. var r = []
  8373. , o = s(r, "<br>");
  8374. if (e && o('<span id="contactName">' + e + "</span>"),
  8375. t) {
  8376. var a = n || t;
  8377. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8378. }
  8379. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8380. r[0] = "",
  8381. A.innerHTML = r.join("")
  8382. } else
  8383. y.classList.add("hidden")
  8384. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8385. function(e) {
  8386. if ("string" == typeof e)
  8387. try {
  8388. e = JSON.parse(e)
  8389. } catch (e) {
  8390. return u.warn("Unable to parse address data"),
  8391. C.parentElement.classList.add("hidden")
  8392. }
  8393. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8394. w = !0;
  8395. var t = []
  8396. , i = s(t, " ");
  8397. e.address_1 && i(e.address_1),
  8398. e.address_2 && i(e.address_2),
  8399. e.city && i(e.city, ", "),
  8400. e.state && i(e.state, ", "),
  8401. e.zip && i(e.zip, e.state ? " " : ", "),
  8402. t[0] = "",
  8403. C.innerText = t.join("")
  8404. } else
  8405. C.parentElement.classList.add("hidden")
  8406. }(e.address),
  8407. w) {
  8408. var t = document.createElement("br");
  8409. I.insertBefore(t, I.firstElementChild)
  8410. }
  8411. e.socialSharing && c.share.enabled && (T = i(e.url))
  8412. }
  8413. },
  8414. finishSetup: function(e) {
  8415. w = w || !!e,
  8416. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8417. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8418. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8419. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8420. }),
  8421. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8422. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8423. contact_type: e.getAttribute("id")
  8424. }))
  8425. }),
  8426. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8427. },
  8428. toggleMeta: function(e, t) {
  8429. var i = document.getElementById("model-title");
  8430. t && t.preventDefault();
  8431. var n = m.classList.contains("expand");
  8432. e && !n || (n ? (b.forEach(function(e) {
  8433. e.classList.remove("expand")
  8434. }),
  8435. this.emit(a.CLOSE_INFO),
  8436. i.classList.remove("expand")) : (b.forEach(function(e) {
  8437. e.classList.add("expand")
  8438. }),
  8439. i.classList.add("expand"),
  8440. this.emit(a.OPEN_INFO)))
  8441. },
  8442. setupToggling: function() {
  8443. g.style.height = m.offsetHeight + "px",
  8444. m.addEventListener("transitionend", function() {
  8445. g.style.height = m.offsetHeight + "px"
  8446. })
  8447. },
  8448. toggleTitle: function(e) {
  8449. e && e.preventDefault(),
  8450. d.classList.contains("closed") ? (d.classList.add("open"),
  8451. f.classList.remove("icon-dpad-right"),
  8452. f.classList.add("icon-dpad-left"),
  8453. this.emit(a.SHOW_INFO),
  8454. setTimeout(function() {
  8455. d.classList.remove("closed"),
  8456. d.classList.remove("open")
  8457. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8458. f.classList.remove("icon-dpad-left"),
  8459. f.classList.add("icon-dpad-right"),
  8460. this.emit(a.HIDE_INFO))
  8461. }
  8462. };
  8463. t.extendObject(x, h.prototype),
  8464. M.exports = x
  8465. }
  8466. ).call(this, "/js/gui/title/titleBar.js")
  8467. }
  8468. , {
  8469. "../../localization/localize": 108,
  8470. "../../settings": 166,
  8471. "../../util/browser": 182,
  8472. "../../util/common": 185,
  8473. "../../util/logger": 189,
  8474. "./TitleEvents": 80,
  8475. "./titleBarSettings": 83,
  8476. events: 202
  8477. }],
  8478. 83: [function(e, t, i) {
  8479. "use strict";
  8480. t.exports = Object.freeze({
  8481. minTooltipCharacters: 19,
  8482. removeAnimationClasses: 500
  8483. })
  8484. }
  8485. , {}],
  8486. 84: [function(e, t, i) {
  8487. "use strict";
  8488. function n() {
  8489. v.playTour(),
  8490. y && clearTimeout(y),
  8491. c(),
  8492. E.removeClass("fadeIn")
  8493. }
  8494. function r() {
  8495. A.classList.contains("playing") && (v.stopTour(),
  8496. E.addClass("fadeIn"),
  8497. setTimeout(function() {
  8498. E.removeClass("fadeIn")
  8499. }, h.tourInteraction.showPauseButton),
  8500. M || (clearTimeout(y),
  8501. y = setTimeout(s, h.tourInteraction.showModal)),
  8502. setTimeout(function() {
  8503. A.classList.remove("playing")
  8504. }, h.tourInteraction.allowNextClick))
  8505. }
  8506. function o() {
  8507. v.tourInProgress && (v.stopTour(),
  8508. v.endTourProgress(),
  8509. A.classList.remove("playing"))
  8510. }
  8511. function a() {
  8512. _.is(":visible") ? n() : r()
  8513. }
  8514. function s() {//去掉导览结束时的提示
  8515. /* if (!h.tourInteraction.disabled) {
  8516. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8517. T.addClass("fadeIn tour " + p.deviceType);
  8518. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8519. if (!h.tourInteraction.smallModal)
  8520. 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,
  8521. p.fill(x, g.TOUR_INTERACTION[e]),
  8522. T.addClass(e);
  8523. T.addClass(t)
  8524. } */
  8525. }
  8526. function l(e, t) {
  8527. if (t) {
  8528. if($.contains($('.toolRight')[0],t.target))return //add 防止编辑时input 空格开始导览
  8529. var i = "keydown" === t.type
  8530. , n = t.which === u.SPACE || v.tourIsPlaying;
  8531. i && n || e || (M = !0),
  8532. v.atEndOfTour() && c(),
  8533. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8534. c(),
  8535. t.which !== u.SPACE && o()),
  8536. i && n && a()
  8537. }
  8538. }
  8539. function c() {
  8540. T.removeClass("fadeIn")
  8541. }
  8542. var h = (e("../util/browser"),
  8543. e("../settings"))
  8544. , u = e("../enum/Keys")
  8545. , d = e("../enum/Viewmode")
  8546. , p = (e("./helpManager"),
  8547. e("./populateModal"))
  8548. , f = e("../enum/DirectorEvents")
  8549. , g = e("../enum/HelpModalType")
  8550. , m = e("../enum/HelpModalSize")
  8551. , v = null
  8552. , y = null
  8553. , A = document.getElementById("pause-overlay")
  8554. , C = document.getElementById("player")
  8555. , I = document.getElementById("gui")
  8556. , E = $("#pause-icon").eq(0)
  8557. , _ = $("#play").eq(0)
  8558. , b = $("#playHead").eq(0)
  8559. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8560. , T = $("#interaction-modal").eq(0)
  8561. , x = $("#interaction-modal .interaction").toArray()
  8562. , S = ["touchstart", "mousedown", "pointerdown"]
  8563. , M = !1;
  8564. t.exports.init = function(e) {
  8565. v = e,
  8566. S.forEach(function(t) {
  8567. C.addEventListener(t, l.bind(this, !1), !0),
  8568. I.addEventListener(t, l.bind(this, !0), !0),
  8569. A.addEventListener(t, r, !0),
  8570. w.forEach(function(e) {
  8571. e.addEventListener(t, o, !0)
  8572. }),
  8573. $("#drawer img").on(t, o)
  8574. }),
  8575. document.addEventListener("keydown", l.bind(this, !1), !0),
  8576. v.on(f.TourStart, function() {
  8577. A.classList.add("playing")
  8578. })
  8579. }
  8580. ,
  8581. t.exports.play = n,
  8582. t.exports.pause = r,
  8583. t.exports.pauseWithoutCTA = o,
  8584. t.exports.togglePlay = a,
  8585. t.exports.stopTour = function() {
  8586. b.hasClass("playing") && (clearTimeout(y),
  8587. v.atEndOfTour() ? (A.classList.remove("playing"),
  8588. s()) : E.removeClass("fadeIn"))
  8589. }
  8590. ,
  8591. t.exports.dismissModal = c
  8592. }
  8593. , {
  8594. "../enum/DirectorEvents": 23,
  8595. "../enum/HelpModalSize": 27,
  8596. "../enum/HelpModalType": 28,
  8597. "../enum/Keys": 30,
  8598. "../enum/Viewmode": 51,
  8599. "../settings": 166,
  8600. "../util/browser": 182,
  8601. "./helpManager": 68,
  8602. "./populateModal": 75
  8603. }],
  8604. 85: [function(e, t, i) {
  8605. "use strict";
  8606. t.exports = Object.freeze({
  8607. OPENED: "vr.modal.opened",
  8608. LAUNCH: "vr.modal.launch",
  8609. CLOSED: "vr.modal.closed",
  8610. NEXT: "vr.modal.next",
  8611. PREV: "vr.modal.prev",
  8612. STORE: "vr.modal.store",
  8613. falseICECHOSEN: "vr.modal.device"
  8614. })
  8615. }
  8616. , {}],
  8617. 86: [function(e, t, i) {
  8618. "use strict";
  8619. var h = e("../../util/browser")
  8620. , u = e("../../enum/VRApps")
  8621. , n = e("../../enum/VRPlatforms")
  8622. , d = e("../../util/ajax")
  8623. , p = e("../../settings")
  8624. , r = {};
  8625. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8626. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8627. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8628. u) {
  8629. var a = u[o];
  8630. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8631. }
  8632. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8633. "https://" + s);
  8634. t.exports.init = function(e, t, o) {
  8635. function a(e, t, i, n) {
  8636. function r() {
  8637. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8638. }
  8639. 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()
  8640. }
  8641. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8642. , l = g + "/vr/dlist/?ret=" + s
  8643. , c = g + "/vr/show/?ret=" + s;
  8644. switch (e) {
  8645. case n.IOS:
  8646. !function(t, e, i, n) {
  8647. var r = a(t, e, i, n)
  8648. , o = {
  8649. responseType: "json",
  8650. data: {
  8651. branch_key: p.appConfig.branch_key,
  8652. data: {
  8653. m: e,
  8654. full_url: r,
  8655. $desktop_url: "",
  8656. $og_app_id: "331853976762864119",
  8657. $og_title: i,
  8658. $og_description: n,
  8659. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8660. $canonical_url: window.location.href
  8661. }
  8662. }
  8663. };
  8664. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8665. f[t] = e.url
  8666. }).fail(function(e) {
  8667. f[t] = e
  8668. }
  8669. .bind(this, r))
  8670. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8671. break;
  8672. default:
  8673. !function(e, t, i) {
  8674. for (var n in u) {
  8675. var r = u[n]
  8676. , o = a(r, e, t, i);
  8677. f[r] = o
  8678. }
  8679. }(t.sid, t.name, t.summary)
  8680. }
  8681. }
  8682. ,
  8683. t.exports.launch = function(e) {
  8684. var t = f[e];
  8685. window.open(t, "_blank")
  8686. }
  8687. ,
  8688. t.exports.launchStore = function(e) {
  8689. var t = r[e];
  8690. window.open(t, "_blank")
  8691. }
  8692. }
  8693. , {
  8694. "../../enum/VRApps": 46,
  8695. "../../enum/VRPlatforms": 49,
  8696. "../../settings": 166,
  8697. "../../util/ajax": 181,
  8698. "../../util/browser": 182
  8699. }],
  8700. 87: [function(e, t, i) {
  8701. "use strict";
  8702. function c(e) {
  8703. var t;
  8704. switch (e) {
  8705. case y.IOS:
  8706. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8707. case y.Android:
  8708. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8709. }
  8710. return !1
  8711. }
  8712. function h(e) {
  8713. switch (e) {
  8714. case y.Android:
  8715. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8716. x.filter(".gearvr").off().on("click", q.gear),
  8717. n(k, U, "logo-button", "same-line");
  8718. break;
  8719. case y.UnsupportedAndroid:
  8720. n("", H, "", "");
  8721. break;
  8722. case y.IOS:
  8723. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8724. n(k, "", "logo-button", "");
  8725. break;
  8726. case y.Desktop:
  8727. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8728. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8729. n(k, U, "logo-button", "same-line"),
  8730. Q.cardboard()
  8731. }
  8732. }
  8733. function u(e) {
  8734. $(".p1, .p2, .p3").hide(),
  8735. l.insertAfter(T),
  8736. w.removeClass("front-page"),
  8737. w.removeClass("details-page"),
  8738. w.removeClass("lastPage"),
  8739. x.removeClass("logo-button"),
  8740. x.removeClass("same-line"),
  8741. T.removeClass("headsetOptions"),
  8742. S.attr("src", ""),
  8743. S.filter(".second").removeClass("gear"),
  8744. S.css("display", "inline-block"),
  8745. S.off(),
  8746. M.filter(".second").css("display", ""),
  8747. O.css("display", "none"),
  8748. $(".p" + (e + 1) + _).show(),
  8749. S.filter(".third").insertBefore(M.filter(".third"))
  8750. }
  8751. function n(e, t, i, n) {
  8752. w.addClass("front-page"),
  8753. S.filter(".first").attr("src", e),
  8754. S.filter(".second").attr("src", t),
  8755. x.filter(".first").addClass(i),
  8756. x.filter(".second").addClass(i),
  8757. x.addClass(n),
  8758. ".show-desktop" === _ && T.insertAfter(l)
  8759. }
  8760. function r(e, t, i) {
  8761. T.addClass("headsetOptions"),
  8762. x.off(),
  8763. S.filter(".second").attr("src", t),
  8764. O.css("display", "block"),
  8765. M.filter(".second").css("display", "none"),
  8766. O.on("click", function() {
  8767. u(b.Title),
  8768. h(y.Desktop)
  8769. }),
  8770. e && (X.emit(C.falseICECHOSEN, {
  8771. name: v.GearVR
  8772. }),
  8773. S.filter(".first").attr("src", e),
  8774. S.filter(".second").addClass("gear"),
  8775. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8776. Q.gearvr()),
  8777. i && (X.emit(C.falseICECHOSEN, {
  8778. name: v.Cardboard
  8779. }),
  8780. S.filter(".third").attr("src", i),
  8781. S.filter(".third").show(),
  8782. S.filter(".third").insertAfter(S.filter(".second")),
  8783. S.filter(".third").addClass("link"),
  8784. S.filter(".second").addClass("link"),
  8785. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8786. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8787. Q.cardboard())
  8788. }
  8789. function d(e, t) {
  8790. switch (t) {
  8791. case y.IOS:
  8792. j = W,
  8793. Y = G;
  8794. break;
  8795. case y.Desktop:
  8796. e === b.Cardboard ? (j = N,
  8797. Y = B,
  8798. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8799. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8800. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8801. Y = "");
  8802. break;
  8803. default:
  8804. Y = e === b.Cardboard ? (j = H,
  8805. G) : (j = V,
  8806. z)
  8807. }
  8808. }
  8809. function p(e, t, i) {
  8810. w.find(".inner").addClass("details-page"),
  8811. w.addClass("details-page"),
  8812. S.filter(".first").attr("src", e),
  8813. S.filter(".second").attr("src", t),
  8814. S.filter(".third").attr("src", i)
  8815. }
  8816. function f() {
  8817. var e = 1 < g.aspectRatio() && g.isMobile();
  8818. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8819. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8820. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8821. }
  8822. var g = e("../../util/browser")
  8823. , m = e("./vrLink")
  8824. , v = e("../../enum/VRApps")
  8825. , y = e("../../enum/VRPlatforms")
  8826. , A = e("../../enum/VRPages")
  8827. , C = e("./vrEvent")
  8828. , o = (e("../../settings"),
  8829. e("../../constants"))
  8830. , I = e("../../localization/localize")
  8831. , a = e("../../util/common")
  8832. , s = e("events").EventEmitter
  8833. , E = 0
  8834. , _ = null
  8835. , b = A.standard
  8836. , w = $(".vr-popup")
  8837. , l = w.find(".vr-popup-body")
  8838. , T = w.find(".vr-images")
  8839. , x = w.find(".img-container")
  8840. , S = w.find(".vr-sm-image")
  8841. , M = x.find(".vr-img-caption")
  8842. , R = $(".vr-buttons").find(".prev-button")
  8843. , P = $(".vr-buttons").find(".next-button")
  8844. , O = T.find(".front-close")
  8845. , L = $(".vr-page")
  8846. , D = w.find("img")
  8847. , N = "images/apple-store.png"
  8848. , F = "images/badge-oculus.png"
  8849. , B = "images/badge-cardboard.png"
  8850. , V = "images/logo-samsung.png"
  8851. , k = "images/headset-cardboard.png"
  8852. , U = "images/headset-gearvr.png"
  8853. , H = "images/ico-android-robot.png"
  8854. , z = "images/ico-gearvr.png"
  8855. , G = "images/ico-vr.png"
  8856. , W = "images/apple-logo-white.svg"
  8857. , j = null
  8858. , Y = null
  8859. , q = {}
  8860. , X = {
  8861. init: function(e, t) {
  8862. function i(e) {
  8863. X.emit(C.STORE, {
  8864. type: e
  8865. }),
  8866. m.launchStore(e)
  8867. }
  8868. function n(e) {
  8869. switch (e !== b.pageCount && (u(e),
  8870. L.text(e + 1 + " / " + b.pageCount)),
  8871. e) {
  8872. case b.Title:
  8873. R.css("display", "none"),
  8874. P.text(a[e]),
  8875. h(r);
  8876. break;
  8877. case b.Cardboard:
  8878. R.css("display", "block"),
  8879. P.text(a[e]),
  8880. x.filter(".cardboard").off(),
  8881. x.filter(".gearvr").off(),
  8882. d(e, r),
  8883. p(k, j, Y);
  8884. break;
  8885. case b.Gear:
  8886. P.text(a[e]),
  8887. d(e, r),
  8888. w.addClass("lastPage"),
  8889. p(U, j, Y);
  8890. break;
  8891. case b.pageCount:
  8892. w.removeClass("fadeIn"),
  8893. X.emit(C.CLOSED)
  8894. }
  8895. D.filter("[src='']").hide()
  8896. }
  8897. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8898. _ = ".show-supported",
  8899. y.Android) : (w.addClass("unsupported"),
  8900. _ = ".show-unsupported",
  8901. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8902. _ = ".show-ios",
  8903. b = A.ios,
  8904. y.IOS) : (w.addClass("desktop"),
  8905. _ = ".show-desktop",
  8906. y.Desktop);
  8907. function o(e) {
  8908. X.emit(C.LAUNCH, {
  8909. vr_platform: r,
  8910. vr_app: e
  8911. }),
  8912. m.launch(e)
  8913. }
  8914. m.init(r, e, t),
  8915. r !== y.Desktop && w.addClass("mobile"),
  8916. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8917. q.gear = o.bind(this, v.GearVR),
  8918. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8919. f(),
  8920. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8921. $(_).show();
  8922. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8923. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8924. r === y.IOS && (a.splice(1, 1),
  8925. s.splice(1, 1)),
  8926. $("#vr").on("click", function(e) {
  8927. e.preventDefault(),
  8928. window.vrEnabled || (window.vrEnabled = !0,
  8929. this.classList.add("active"),
  8930. $("#gui div").not("#vrOff").addClass("vrHide"),
  8931. $("#vrOffImg").css({
  8932. display: "inline-block"
  8933. }))
  8934. }),
  8935. $("#vrOff").on("click", function() {
  8936. window.vrEnabled = !1,
  8937. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8938. $("#vrOffImg").css({
  8939. display: "none"
  8940. }),
  8941. $("#player canvas").css({
  8942. width: "",
  8943. height: ""
  8944. }),
  8945. $("#vr").removeClass("active")
  8946. });
  8947. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8948. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8949. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8950. $("span.modelLink").text(l),
  8951. R.on("click", function(e) {
  8952. X.emit(C.PREV),
  8953. n(--E)
  8954. }),
  8955. P.on("click", function(e) {
  8956. P.text(),
  8957. X.emit(C.NEXT, {
  8958. nextAction: s[E]
  8959. }),
  8960. n(++E)
  8961. }),
  8962. w.find(".close").on("click", X.dismiss)
  8963. },
  8964. dismiss: function() {
  8965. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8966. X.emit(C.CLOSED))
  8967. },
  8968. isDeviceSupported: c
  8969. };
  8970. a.extendObject(X, s.prototype),
  8971. $(window).resize(f);
  8972. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8973. K = M.filter(".first").find(".gearvr"),
  8974. {
  8975. cardboard: function() {
  8976. K.addClass("hidden"),
  8977. Z.removeClass("hidden")
  8978. },
  8979. gearvr: function() {
  8980. Z.addClass("hidden"),
  8981. K.removeClass("hidden")
  8982. }
  8983. });
  8984. t.exports = X
  8985. }
  8986. , {
  8987. "../../constants": 8,
  8988. "../../enum/VRApps": 46,
  8989. "../../enum/VRPages": 48,
  8990. "../../enum/VRPlatforms": 49,
  8991. "../../localization/localize": 108,
  8992. "../../settings": 166,
  8993. "../../util/browser": 182,
  8994. "../../util/common": 185,
  8995. "./vrEvent": 85,
  8996. "./vrLink": 86,
  8997. events: 202
  8998. }],
  8999. 88: [function(e, t, i) {
  9000. "use strict";
  9001. t.exports = Object.freeze({
  9002. OPENED: "webvr.modal.opened",
  9003. SHOW_TERMS: "webvr.footer.show.terms"
  9004. })
  9005. }
  9006. , {}],
  9007. 89: [function(B, V, e) {
  9008. (function(e) {
  9009. "use strict";
  9010. function a() {
  9011. function t() {
  9012. p.isPresenting || (r.info("exiting webVR"),
  9013. c("webvr_exit_app"),
  9014. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9015. window.removeEventListener("vrdisplaypresentchange", t))
  9016. }
  9017. r.info("Headset mounted"),
  9018. u.suspend();
  9019. var e = document.createElement("canvas");
  9020. for (e.getContext("webgl"),
  9021. e.className = "webvr-canvas",
  9022. document.bgColor = "#000",
  9023. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9024. document.body.removeChild(document.body.firstChild);
  9025. document.body.appendChild(e),
  9026. c("webvr_enter_app"),
  9027. p.requestPresent([{
  9028. source: e,
  9029. predistorted: !0
  9030. }]).catch(function(e) {
  9031. r.error("Failed to present: " + e),
  9032. c("webvr_exit_calibrate"),
  9033. t()
  9034. }),
  9035. d.then(function() {
  9036. window.dispatchEvent(new Event("vrapp-start"))
  9037. }),
  9038. window.addEventListener("vrdisplaypresentchange", t)
  9039. }
  9040. function s() {
  9041. c("webvr_modal_close"),
  9042. _.find(".enter-button").off("click", a),
  9043. E.fadeOut(g.guiAnimationSpeed, function() {
  9044. _.toggleClass("hidden", !1),
  9045. b.toggleClass("hidden", !0),
  9046. f.exitFullscreen()
  9047. }),
  9048. I.fadeIn(g.guiAnimationSpeed)
  9049. }
  9050. function t() {
  9051. M.toggleClass("hidden", !0),
  9052. S.toggleClass("hidden", !1)
  9053. }
  9054. function l() {
  9055. _.toggleClass("hidden"),
  9056. b.toggleClass("hidden")
  9057. }
  9058. function c(e) {
  9059. var t = f.isLandscape() ? "landscape" : "portrait";
  9060. i.trackAlways("showcase_gui", {
  9061. gui_action: e,
  9062. orientation: t
  9063. })
  9064. }
  9065. function h() {
  9066. var e = f.isLandscape();
  9067. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9068. }
  9069. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9070. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9071. 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 = {
  9072. init: function(e, t, i, n) {
  9073. function r(e) {
  9074. e.preventDefault(),
  9075. o(e.currentTarget.id)
  9076. }
  9077. function o(i) {
  9078. F[i](),
  9079. Object.keys(F).map(function(e, t) {
  9080. $("#" + e).toggleClass("tabs-underlined", e === i)
  9081. })
  9082. }
  9083. p = i,
  9084. u = t,
  9085. y.init(m.Android, e, n),
  9086. h(),
  9087. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9088. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9089. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9090. w.filter(".device-headset-side").attr("src", R),
  9091. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9092. $("#vr").on("click", function(e) {
  9093. e.preventDefault(),
  9094. c("click_webvr_button"),
  9095. E.is(":hidden") && (N.emit(A.OPENED),
  9096. I.fadeOut(g.guiAnimationSpeed),
  9097. E.fadeIn(g.guiAnimationSpeed),
  9098. function() {
  9099. if (!d) {
  9100. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9101. d = new Promise(function(e, t) {
  9102. var i = document.createElement("script");
  9103. i.type = "text/javascript",
  9104. i.src = n,
  9105. i.onload = e,
  9106. document.head.appendChild(i)
  9107. }
  9108. )
  9109. }
  9110. _.find(".enter-button").on("click", a)
  9111. }())
  9112. }),
  9113. $(".webvr-popup .close").on("click", function(e) {
  9114. e.preventDefault(),
  9115. _.hasClass("hidden") ? (c("webvr_help_close"),
  9116. l()) : s()
  9117. }),
  9118. $("#tabcardboard").on("click", r),
  9119. $("#tabdaydream").on("click", r),
  9120. $("#tabnative").on("click", r),
  9121. $(".webvr-popup .open-with-app").on("click", function(e) {
  9122. e.preventDefault(),
  9123. c("webvr_learn_more"),
  9124. o("tabnative"),
  9125. l()
  9126. }),
  9127. $(".webvr-popup .help").on("click", function(e) {
  9128. e.preventDefault(),
  9129. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9130. l()
  9131. }),
  9132. $(".webvr-popup .terms").on("click", function(e) {
  9133. e.preventDefault(),
  9134. c("webvr_click_terms"),
  9135. s(),
  9136. N.emit(A.SHOW_TERMS)
  9137. }),
  9138. T.on("click", function(e) {
  9139. e.preventDefault(),
  9140. c(D),
  9141. window.open(L, "_blank")
  9142. }),
  9143. x.on("click", function(e) {
  9144. e.preventDefault(),
  9145. c("webvr_phone_link"),
  9146. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9147. }),
  9148. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9149. e.preventDefault(),
  9150. c("webvr_cardboard_link"),
  9151. y.launch(v.CardboardAndroid)
  9152. }),
  9153. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9154. e.preventDefault(),
  9155. c("webvr_oculus_link"),
  9156. y.launch(v.GearVR)
  9157. })
  9158. }
  9159. }, F = {
  9160. tabcardboard: function() {
  9161. w.filter(".device-headset").attr("src", R),
  9162. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9163. L = "https://vr.google.com/cardboard/get-cardboard/",
  9164. D = "webvr_cardboard_link",
  9165. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9166. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9167. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9168. t()
  9169. },
  9170. tabdaydream: function() {
  9171. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9172. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9173. L = P,
  9174. D = O,
  9175. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9176. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9177. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9178. t()
  9179. },
  9180. tabnative: function() {
  9181. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9182. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9183. M.toggleClass("hidden", !1),
  9184. S.toggleClass("hidden", !0)
  9185. }
  9186. };
  9187. n.extendObject(N, o.prototype),
  9188. $(window).resize(h),
  9189. V.exports = N
  9190. }
  9191. ).call(this, "/js/gui/webvr/webVRgui.js")
  9192. }
  9193. , {
  9194. "../../analytics": 4,
  9195. "../../constants": 8,
  9196. "../../enum/VRApps": 46,
  9197. "../../enum/VRPlatforms": 49,
  9198. "../../localization/localize": 108,
  9199. "../../settings": 166,
  9200. "../../util/browser": 182,
  9201. "../../util/common": 185,
  9202. "../../util/logger": 189,
  9203. "./../gui": 65,
  9204. "./../vr/vrLink": 86,
  9205. "./WebVrEvent": 88,
  9206. events: 202
  9207. }],
  9208. 90: [function(e, t, i) {
  9209. "use strict";
  9210. function n(e, t, i, n, r) {
  9211. this.floorId = n || 0 === n ? n : -1,
  9212. this.roomId = r || "",
  9213. this.labelId = e,
  9214. this.position = (new o.Vector3).copy(t),
  9215. this.text = i
  9216. }
  9217. var o = e("three")
  9218. , r = e("../util/browser");
  9219. n.prototype.build = function() {
  9220. var e = window.document.createElement("div");
  9221. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9222. var t = window.document.createElement("div");
  9223. t.setAttribute("class", "gui-floorplan-label-text");
  9224. var i = window.document.createTextNode(this.text);
  9225. t.appendChild(i),
  9226. e.appendChild(t),
  9227. window.document.body.appendChild(e),
  9228. this.labelGui = e,
  9229. this.textBlock = t,
  9230. $(this.labelGui).hide();
  9231. var n = window.getComputedStyle(this.labelGui);
  9232. this.initialTransform = n.transform || n.webkitTransform
  9233. }
  9234. ,
  9235. t.exports = n
  9236. }
  9237. , {
  9238. "../util/browser": 182,
  9239. three: 217
  9240. }],
  9241. 91: [function(e, t, i) {
  9242. "use strict";
  9243. function n() {
  9244. this.player = null,
  9245. this.modelManager = null,
  9246. this.container = null
  9247. }
  9248. var c, o, r = e("three"), a = (e("../util/common"),
  9249. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9250. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9251. e("../util/transitions"),
  9252. e("../util/lerp"),
  9253. e("../util/browser"));
  9254. n.prototype.init = function(e, t, i) {
  9255. this.player = e,
  9256. this.modelManager = t,
  9257. this.container = i,
  9258. this.updateModel(),
  9259. this.bindEvents()
  9260. }
  9261. ,
  9262. n.prototype.bindEvents = function() {
  9263. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9264. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9265. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9266. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9267. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9268. }
  9269. ,
  9270. n.prototype.updateModel = function() {
  9271. this.model = this.modelManager.getActiveModel()
  9272. }
  9273. ,
  9274. n.prototype.handlePlayerViewChanged = function() {
  9275. this.updateLabelVisibility(),
  9276. this.updateLabelDisplay()
  9277. }
  9278. ,
  9279. n.prototype.getLabelsForFloor = function(t, i) {
  9280. return (i = i || []).length = 0,
  9281. this.model.labels.forEach(function(e) {
  9282. this.labelVisibleForFloor(e, t) && i.push(e)
  9283. }
  9284. .bind(this)),
  9285. i
  9286. }
  9287. ,
  9288. n.prototype.getLabelsForCurrentFloor = function(e) {
  9289. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9290. }
  9291. ,
  9292. n.prototype.labelVisibleForFloor = function(e, t) {
  9293. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9294. if (!this.model.showingLabels || !e.labelGui || !i)
  9295. return !1;
  9296. var n = e.floorId === this.model.floors.size() - 1;
  9297. return this.model.allFloorsVisible ? n : e.floorId === t
  9298. }
  9299. ,
  9300. n.prototype.updateLabelVisibility = function(e) {
  9301. this.model.labels.forEach(function(e) {
  9302. 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)
  9303. }
  9304. .bind(this))
  9305. }
  9306. ,
  9307. n.prototype.showAllLabels = function(t, i) {
  9308. this.model.labels.forEach(function(e) {
  9309. this.showLabel(e, t, i)
  9310. }
  9311. .bind(this))
  9312. }
  9313. ,
  9314. n.prototype.hideAllLabels = function(t, i) {
  9315. this.model.labels.forEach(function(e) {
  9316. this.hideLabel(e, t, i)
  9317. }
  9318. .bind(this))
  9319. }
  9320. ,
  9321. n.prototype.showLabel = function(e, t, i) {
  9322. this.model.showingLabels && (e.visible || (e.visible = !0,
  9323. e.labelGui.style.display = "block",
  9324. e.labelGui.style.opacity = 0,
  9325. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9326. }
  9327. ,
  9328. n.prototype.hideLabel = function(e, t, i) {
  9329. e.visible && (e.visible = !1,
  9330. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9331. }
  9332. ,
  9333. n.prototype.supportedMode = function() {
  9334. return this.player.mode === h.FLOORPLAN
  9335. }
  9336. ,
  9337. n.prototype.updateLabelDisplay = (new r.Vector3,
  9338. new r.Vector3,
  9339. o = [],
  9340. function() {
  9341. var e = this.player.getLabelScaleFactor()
  9342. , t = 1.2 * (1 - e) + .6
  9343. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9344. this.getLabelsForCurrentFloor(o);
  9345. for (var n = 0; n < o.length; n++) {
  9346. var r = o[n];
  9347. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9348. 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)
  9349. }
  9350. }
  9351. ),
  9352. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9353. new r.Vector3,
  9354. function(e, t, i, n, r) {
  9355. t.style.fontSize = 100 * r + "%";
  9356. var o = .5 * $("#player").width()
  9357. , a = .5 * $("#player").height();
  9358. c.copy(i),
  9359. c.project(this.player.camera);
  9360. var s = c.x * o + o
  9361. , l = -c.y * a + a;
  9362. s -= e.offsetWidth / 2,
  9363. l -= e.offsetHeight / 2,
  9364. e.style.left = s + "px",
  9365. e.style.top = l + "px"
  9366. }
  9367. ),
  9368. n.prototype.handleStartInside = function(e) {
  9369. this.updateLabelVisibility()
  9370. }
  9371. ,
  9372. n.prototype.handleStartOutside = function() {
  9373. this.updateLabelVisibility()
  9374. }
  9375. ,
  9376. t.exports = n
  9377. }
  9378. , {
  9379. "../enum/DirectorEvents": 23,
  9380. "../enum/ModelManagerEvents": 33,
  9381. "../enum/PlayerEvents": 40,
  9382. "../enum/Viewmode": 51,
  9383. "../enum/WarpStyle": 52,
  9384. "../settings": 166,
  9385. "../util/browser": 182,
  9386. "../util/common": 185,
  9387. "../util/lerp": 188,
  9388. "../util/transitions": 195,
  9389. three: 217
  9390. }],
  9391. 92: [function(e, t, i) {
  9392. "use strict";
  9393. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9394. if (null == this)
  9395. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9396. if ("function" != typeof e)
  9397. throw new TypeError("predicate must be a function");
  9398. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9399. if (t = i[o],
  9400. e.call(r, t, o, i))
  9401. return o;
  9402. return -1
  9403. }
  9404. ),
  9405. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9406. value: function(e) {
  9407. if (null == this)
  9408. throw new TypeError('"this" is null or not defined');
  9409. var t = Object(this)
  9410. , i = t.length >>> 0;
  9411. if ("function" != typeof e)
  9412. throw new TypeError("predicate must be a function");
  9413. for (var n = arguments[1], r = 0; r < i; ) {
  9414. var o = t[r];
  9415. if (e.call(n, o, r, t))
  9416. return o;
  9417. r++
  9418. }
  9419. }
  9420. })
  9421. }
  9422. , {}],
  9423. 93: [function(e, t, i) {
  9424. "use strict";
  9425. 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 || {};
  9426. function te() {
  9427. this.backgroundElement = document.createElement("div"),
  9428. r.extend(this.backgroundElement.style, {
  9429. backgroundColor: "rgba(0,0,0,0.8)",
  9430. top: 0,
  9431. left: 0,
  9432. display: "none",
  9433. zIndex: "1000",
  9434. opacity: 0,
  9435. WebkitTransition: "opacity 0.2s linear"
  9436. }),
  9437. n.makeFullscreen(this.backgroundElement),
  9438. this.backgroundElement.style.position = "fixed",
  9439. this.domElement = document.createElement("div"),
  9440. r.extend(this.domElement.style, {
  9441. position: "fixed",
  9442. display: "none",
  9443. zIndex: "1001",
  9444. opacity: 0,
  9445. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9446. }),
  9447. document.body.appendChild(this.backgroundElement),
  9448. document.body.appendChild(this.domElement);
  9449. var e = this;
  9450. n.bind(this.backgroundElement, "click", function() {
  9451. e.hide()
  9452. })
  9453. }
  9454. function ie(e, t, i) {
  9455. Object.defineProperty(e, t, {
  9456. get: function() {
  9457. return "RGB" === this.__state.space || re(this, t, i),
  9458. this.__state[t]
  9459. },
  9460. set: function(e) {
  9461. "RGB" !== this.__state.space && (re(this, t, i),
  9462. this.__state.space = "RGB"),
  9463. this.__state[t] = e
  9464. }
  9465. })
  9466. }
  9467. function ne(e, t) {
  9468. Object.defineProperty(e, t, {
  9469. get: function() {
  9470. return "HSV" === this.__state.space || oe(this),
  9471. this.__state[t]
  9472. },
  9473. set: function(e) {
  9474. "HSV" !== this.__state.space && (oe(this),
  9475. this.__state.space = "HSV"),
  9476. this.__state[t] = e
  9477. }
  9478. })
  9479. }
  9480. function re(e, t, i) {
  9481. if ("HEX" === e.__state.space)
  9482. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9483. else {
  9484. if ("HSV" !== e.__state.space)
  9485. throw "Corrupted color state";
  9486. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9487. }
  9488. }
  9489. function oe(e) {
  9490. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9491. l.extend(e.__state, {
  9492. s: t.s,
  9493. v: t.v
  9494. }),
  9495. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9496. }
  9497. function ae() {
  9498. if (this.__state = o.apply(this, arguments),
  9499. !1 === this.__state)
  9500. throw "Failed to interpret color arguments";
  9501. this.__state.a = this.__state.a || 1
  9502. }
  9503. function se(e) {
  9504. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9505. }
  9506. function le(e, t) {
  9507. this.initialValue = e[t],
  9508. this.domElement = document.createElement("div"),
  9509. this.object = e,
  9510. this.property = t,
  9511. this.__onChange = void 0,
  9512. this.__onFinishChange = void 0
  9513. }
  9514. (t.exports = ee).gui = ee.gui || {},
  9515. ee.utils = ee.utils || {},
  9516. ee.controllers = ee.controllers || {},
  9517. ee.dom = ee.dom || {},
  9518. ee.color = ee.color || {},
  9519. ee.utils.css = {
  9520. load: function(e, t) {
  9521. var i = (t = t || document).createElement("link");
  9522. i.type = "text/css",
  9523. i.rel = "stylesheet",
  9524. i.href = e,
  9525. t.getElementsByTagName("head")[0].appendChild(i)
  9526. },
  9527. inject: function(e, t) {
  9528. t = t || document;
  9529. var i = document.createElement("style");
  9530. i.type = "text/css",
  9531. i.innerHTML = e,
  9532. t.getElementsByTagName("head")[0].appendChild(i)
  9533. }
  9534. },
  9535. ee.utils.common = (Q = Array.prototype.forEach,
  9536. J = Array.prototype.slice,
  9537. {
  9538. BREAK: {},
  9539. extend: function(i) {
  9540. return this.each(J.call(arguments, 1), function(e) {
  9541. for (var t in e)
  9542. this.isUndefined(e[t]) || (i[t] = e[t])
  9543. }, this),
  9544. i
  9545. },
  9546. defaults: function(i) {
  9547. return this.each(J.call(arguments, 1), function(e) {
  9548. for (var t in e)
  9549. this.isUndefined(i[t]) && (i[t] = e[t])
  9550. }, this),
  9551. i
  9552. },
  9553. compose: function() {
  9554. var i = J.call(arguments);
  9555. return function() {
  9556. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9557. e = [i[t].apply(this, e)];
  9558. return e[0]
  9559. }
  9560. },
  9561. each: function(e, t, i) {
  9562. if (e)
  9563. if (Q && e.forEach && e.forEach === Q)
  9564. e.forEach(t, i);
  9565. else if (e.length === e.length + 0) {
  9566. for (var n = 0, r = e.length; n < r; n++)
  9567. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9568. return
  9569. } else
  9570. for (var n in e)
  9571. if (t.call(i, e[n], n) === this.BREAK)
  9572. return
  9573. },
  9574. defer: function(e) {
  9575. setTimeout(e, 0)
  9576. },
  9577. toArray: function(e) {
  9578. return e.toArray ? e.toArray() : J.call(e)
  9579. },
  9580. isUndefined: function(e) {
  9581. return void 0 === e
  9582. },
  9583. isNull: function(e) {
  9584. return null === e
  9585. },
  9586. isNaN: function(e) {
  9587. return e != e
  9588. },
  9589. isArray: Array.isArray || function(e) {
  9590. return e.constructor === Array
  9591. }
  9592. ,
  9593. isObject: function(e) {
  9594. return e === Object(e)
  9595. },
  9596. isNumber: function(e) {
  9597. return e === e + 0
  9598. },
  9599. isString: function(e) {
  9600. return e === e + ""
  9601. },
  9602. isBoolean: function(e) {
  9603. return !1 === e || !0 === e
  9604. },
  9605. isFunction: function(e) {
  9606. return "[object Function]" === Object.prototype.toString.call(e)
  9607. }
  9608. }),
  9609. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9610. onChange: function(e) {
  9611. return this.__onChange = e,
  9612. this
  9613. },
  9614. onFinishChange: function(e) {
  9615. return this.__onFinishChange = e,
  9616. this
  9617. },
  9618. setValue: function(e) {
  9619. return this.object[this.property] = e,
  9620. this.__onChange && this.__onChange.call(this, e),
  9621. this.updateDisplay(),
  9622. this
  9623. },
  9624. getValue: function() {
  9625. return this.object[this.property]
  9626. },
  9627. updateDisplay: function() {
  9628. return this
  9629. },
  9630. isModified: function() {
  9631. return this.initialValue !== this.getValue()
  9632. }
  9633. }),
  9634. le),
  9635. ee.dom.dom = function(c) {
  9636. function i(e) {
  9637. if ("0" === e || c.isUndefined(e))
  9638. return 0;
  9639. var t = e.match(n);
  9640. return c.isNull(t) ? 0 : parseFloat(t[1])
  9641. }
  9642. var h = {};
  9643. c.each({
  9644. HTMLEvents: ["change"],
  9645. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9646. KeyboardEvents: ["keydown"]
  9647. }, function(e, t) {
  9648. c.each(e, function(e) {
  9649. h[e] = t
  9650. })
  9651. });
  9652. var n = /(\d+(\.\d+)?)px/
  9653. , r = {
  9654. makeSelectable: function(e, t) {
  9655. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9656. return !1
  9657. }
  9658. : function() {}
  9659. ,
  9660. e.style.MozUserSelect = t ? "auto" : "none",
  9661. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9662. e.unselectable = t ? "on" : "off")
  9663. },
  9664. makeFullscreen: function(e, t, i) {
  9665. c.isUndefined(t) && (t = !0),
  9666. c.isUndefined(i) && (i = !0),
  9667. e.style.position = "absolute",
  9668. t && (e.style.left = 0,
  9669. e.style.right = 0),
  9670. i && (e.style.top = 0,
  9671. e.style.bottom = 0)
  9672. },
  9673. fakeEvent: function(e, t, i, n) {
  9674. i = i || {};
  9675. var r = h[t];
  9676. if (!r)
  9677. throw new Error("Event type " + t + " not supported.");
  9678. var o = document.createEvent(r);
  9679. switch (r) {
  9680. case "MouseEvents":
  9681. var a = i.x || i.clientX || 0
  9682. , s = i.y || i.clientY || 0;
  9683. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9684. break;
  9685. case "KeyboardEvents":
  9686. var l = o.initKeyboardEvent || o.initKeyEvent;
  9687. c.defaults(i, {
  9688. cancelable: !0,
  9689. ctrlKey: !1,
  9690. altKey: !1,
  9691. shiftKey: !1,
  9692. metaKey: !1,
  9693. keyCode: void 0,
  9694. charCode: void 0
  9695. }),
  9696. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9697. break;
  9698. default:
  9699. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9700. }
  9701. c.defaults(o, n),
  9702. e.dispatchEvent(o)
  9703. },
  9704. bind: function(e, t, i, n) {
  9705. return n = n || !1,
  9706. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9707. r
  9708. },
  9709. unbind: function(e, t, i, n) {
  9710. return n = n || !1,
  9711. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9712. r
  9713. },
  9714. addClass: function(e, t) {
  9715. if (void 0 === e.className)
  9716. e.className = t;
  9717. else if (e.className !== t) {
  9718. var i = e.className.split(/ +/);
  9719. -1 == i.indexOf(t) && (i.push(t),
  9720. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9721. }
  9722. return r
  9723. },
  9724. removeClass: function(e, t) {
  9725. if (t)
  9726. if (void 0 === e.className)
  9727. ;
  9728. else if (e.className === t)
  9729. e.removeAttribute("class");
  9730. else {
  9731. var i = e.className.split(/ +/)
  9732. , n = i.indexOf(t);
  9733. -1 != n && (i.splice(n, 1),
  9734. e.className = i.join(" "))
  9735. }
  9736. else
  9737. e.className = void 0;
  9738. return r
  9739. },
  9740. hasClass: function(e, t) {
  9741. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9742. },
  9743. getWidth: function(e) {
  9744. var t = getComputedStyle(e);
  9745. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9746. },
  9747. getHeight: function(e) {
  9748. var t = getComputedStyle(e);
  9749. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9750. },
  9751. getOffset: function(e) {
  9752. var t = {
  9753. left: 0,
  9754. top: 0
  9755. };
  9756. if (e.offsetParent)
  9757. for (; t.left += e.offsetLeft,
  9758. t.top += e.offsetTop,
  9759. e = e.offsetParent; )
  9760. ;
  9761. return t
  9762. },
  9763. isActive: function(e) {
  9764. return e === document.activeElement && (e.type || e.href)
  9765. }
  9766. };
  9767. return r
  9768. }(ee.utils.common),
  9769. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9770. X = ee.dom.dom,
  9771. Z = ee.utils.common,
  9772. (K = function(e, t, i) {
  9773. K.superclass.call(this, e, t);
  9774. var n = this;
  9775. if (this.__select = document.createElement("select"),
  9776. Z.isArray(i)) {
  9777. var r = {};
  9778. Z.each(i, function(e) {
  9779. r[e] = e
  9780. }),
  9781. i = r
  9782. }
  9783. Z.each(i, function(e, t) {
  9784. var i = document.createElement("option");
  9785. i.innerHTML = t,
  9786. i.setAttribute("value", e),
  9787. n.__select.appendChild(i)
  9788. }),
  9789. this.updateDisplay(),
  9790. X.bind(this.__select, "change", function() {
  9791. var e = this.options[this.selectedIndex].value;
  9792. n.setValue(e)
  9793. }),
  9794. this.domElement.appendChild(this.__select)
  9795. }
  9796. ).superclass = q,
  9797. Z.extend(K.prototype, q.prototype, {
  9798. setValue: function(e) {
  9799. var t = K.superclass.prototype.setValue.call(this, e);
  9800. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9801. t
  9802. },
  9803. updateDisplay: function() {
  9804. return this.__select.value = this.getValue(),
  9805. K.superclass.prototype.updateDisplay.call(this)
  9806. }
  9807. }),
  9808. K),
  9809. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9810. j = ee.utils.common,
  9811. (Y = function(e, t, i) {
  9812. Y.superclass.call(this, e, t),
  9813. i = i || {},
  9814. this.__min = i.min,
  9815. this.__max = i.max,
  9816. this.__step = i.step,
  9817. 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,
  9818. this.__precision = se(this.__impliedStep)
  9819. }
  9820. ).superclass = W,
  9821. j.extend(Y.prototype, W.prototype, {
  9822. setValue: function(e) {
  9823. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9824. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9825. Y.superclass.prototype.setValue.call(this, e)
  9826. },
  9827. min: function(e) {
  9828. return this.__min = e,
  9829. this
  9830. },
  9831. max: function(e) {
  9832. return this.__max = e,
  9833. this
  9834. },
  9835. step: function(e) {
  9836. return this.__step = e,
  9837. this.__impliedStep = e,
  9838. this.__precision = se(e),
  9839. this
  9840. }
  9841. }),
  9842. Y),
  9843. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9844. H = ee.dom.dom,
  9845. z = ee.utils.common,
  9846. (G = function(e, t, i) {
  9847. function n() {
  9848. var e = parseFloat(s.__input.value);
  9849. z.isNaN(e) || s.setValue(e)
  9850. }
  9851. function r(e) {
  9852. var t = a - e.clientY;
  9853. s.setValue(s.getValue() + t * s.__impliedStep),
  9854. a = e.clientY
  9855. }
  9856. function o() {
  9857. H.unbind(window, "mousemove", r),
  9858. H.unbind(window, "mouseup", o)
  9859. }
  9860. this.__truncationSuspended = !1,
  9861. G.superclass.call(this, e, t, i);
  9862. var a, s = this;
  9863. this.__input = document.createElement("input"),
  9864. this.__input.setAttribute("type", "text"),
  9865. H.bind(this.__input, "change", n),
  9866. H.bind(this.__input, "blur", function() {
  9867. n(),
  9868. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9869. }),
  9870. H.bind(this.__input, "mousedown", function(e) {
  9871. H.bind(window, "mousemove", r),
  9872. H.bind(window, "mouseup", o),
  9873. a = e.clientY
  9874. }),
  9875. H.bind(this.__input, "keydown", function(e) {
  9876. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9877. this.blur(),
  9878. s.__truncationSuspended = !1)
  9879. }),
  9880. this.updateDisplay(),
  9881. this.domElement.appendChild(this.__input)
  9882. }
  9883. ).superclass = U,
  9884. z.extend(G.prototype, U.prototype, {
  9885. updateDisplay: function() {
  9886. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9887. var i = Math.pow(10, t);
  9888. return Math.round(e * i) / i
  9889. }(this.getValue(), this.__precision),
  9890. G.superclass.prototype.updateDisplay.call(this)
  9891. }
  9892. }),
  9893. G),
  9894. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9895. F = ee.dom.dom,
  9896. B = ee.utils.css,
  9897. V = ee.utils.common,
  9898. (k = function(e, t, i, n, r) {
  9899. function o(e) {
  9900. e.preventDefault();
  9901. var t = F.getOffset(s.__background)
  9902. , i = F.getWidth(s.__background);
  9903. return s.setValue(function(e, t, i, n, r) {
  9904. return n + (e - t) / (i - t) * (r - n)
  9905. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9906. !1
  9907. }
  9908. function a() {
  9909. F.unbind(window, "mousemove", o),
  9910. F.unbind(window, "mouseup", a),
  9911. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9912. }
  9913. k.superclass.call(this, e, t, {
  9914. min: i,
  9915. max: n,
  9916. step: r
  9917. });
  9918. var s = this;
  9919. this.__background = document.createElement("div"),
  9920. this.__foreground = document.createElement("div"),
  9921. F.bind(this.__background, "mousedown", function(e) {
  9922. F.bind(window, "mousemove", o),
  9923. F.bind(window, "mouseup", a),
  9924. o(e)
  9925. }),
  9926. F.addClass(this.__background, "slider"),
  9927. F.addClass(this.__foreground, "slider-fg"),
  9928. this.updateDisplay(),
  9929. this.__background.appendChild(this.__foreground),
  9930. this.domElement.appendChild(this.__background)
  9931. }
  9932. ).superclass = N,
  9933. k.useDefaultStyles = function() {
  9934. 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}")
  9935. }
  9936. ,
  9937. V.extend(k.prototype, N.prototype, {
  9938. updateDisplay: function() {
  9939. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9940. return this.__foreground.style.width = 100 * e + "%",
  9941. k.superclass.prototype.updateDisplay.call(this)
  9942. }
  9943. }),
  9944. k),
  9945. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9946. O = ee.dom.dom,
  9947. L = ee.utils.common,
  9948. (D = function(e, t, i) {
  9949. D.superclass.call(this, e, t);
  9950. var n = this;
  9951. this.__button = document.createElement("div"),
  9952. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9953. O.bind(this.__button, "click", function(e) {
  9954. return e.preventDefault(),
  9955. n.fire(),
  9956. !1
  9957. }),
  9958. O.addClass(this.__button, "button"),
  9959. this.domElement.appendChild(this.__button)
  9960. }
  9961. ).superclass = P,
  9962. L.extend(D.prototype, P.prototype, {
  9963. fire: function() {
  9964. this.__onChange && this.__onChange.call(this),
  9965. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9966. this.getValue().call(this.object)
  9967. }
  9968. }),
  9969. D),
  9970. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9971. S = ee.dom.dom,
  9972. M = ee.utils.common,
  9973. (R = function(e, t) {
  9974. R.superclass.call(this, e, t);
  9975. var i = this;
  9976. this.__prev = this.getValue(),
  9977. this.__checkbox = document.createElement("input"),
  9978. this.__checkbox.setAttribute("type", "checkbox"),
  9979. S.bind(this.__checkbox, "change", function() {
  9980. i.setValue(!i.__prev)
  9981. }, !1),
  9982. this.domElement.appendChild(this.__checkbox),
  9983. this.updateDisplay()
  9984. }
  9985. ).superclass = x,
  9986. M.extend(R.prototype, x.prototype, {
  9987. setValue: function(e) {
  9988. var t = R.superclass.prototype.setValue.call(this, e);
  9989. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9990. this.__prev = this.getValue(),
  9991. t
  9992. },
  9993. updateDisplay: function() {
  9994. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9995. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9996. R.superclass.prototype.updateDisplay.call(this)
  9997. }
  9998. }),
  9999. R),
  10000. ee.color.toString = (T = ee.utils.common,
  10001. function(e) {
  10002. if (1 == e.a || T.isUndefined(e.a)) {
  10003. for (var t = e.hex.toString(16); t.length < 6; )
  10004. t = "0" + t;
  10005. return "#" + t
  10006. }
  10007. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10008. }
  10009. ),
  10010. ee.color.interpret = (I = ee.color.toString,
  10011. E = ee.utils.common,
  10012. w = [{
  10013. litmus: E.isString,
  10014. conversions: {
  10015. THREE_CHAR_HEX: {
  10016. read: function(e) {
  10017. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10018. return null !== t && {
  10019. space: "HEX",
  10020. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10021. }
  10022. },
  10023. write: I
  10024. },
  10025. SIX_CHAR_HEX: {
  10026. read: function(e) {
  10027. var t = e.match(/^#([A-F0-9]{6})$/i);
  10028. return null !== t && {
  10029. space: "HEX",
  10030. hex: parseInt("0x" + t[1].toString())
  10031. }
  10032. },
  10033. write: I
  10034. },
  10035. CSS_RGB: {
  10036. read: function(e) {
  10037. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10038. return null !== t && {
  10039. space: "RGB",
  10040. r: parseFloat(t[1]),
  10041. g: parseFloat(t[2]),
  10042. b: parseFloat(t[3])
  10043. }
  10044. },
  10045. write: I
  10046. },
  10047. CSS_RGBA: {
  10048. read: function(e) {
  10049. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10050. return null !== t && {
  10051. space: "RGB",
  10052. r: parseFloat(t[1]),
  10053. g: parseFloat(t[2]),
  10054. b: parseFloat(t[3]),
  10055. a: parseFloat(t[4])
  10056. }
  10057. },
  10058. write: I
  10059. }
  10060. }
  10061. }, {
  10062. litmus: E.isNumber,
  10063. conversions: {
  10064. HEX: {
  10065. read: function(e) {
  10066. return {
  10067. space: "HEX",
  10068. hex: e,
  10069. conversionName: "HEX"
  10070. }
  10071. },
  10072. write: function(e) {
  10073. return e.hex
  10074. }
  10075. }
  10076. }
  10077. }, {
  10078. litmus: E.isArray,
  10079. conversions: {
  10080. RGB_ARRAY: {
  10081. read: function(e) {
  10082. return 3 == e.length && {
  10083. space: "RGB",
  10084. r: e[0],
  10085. g: e[1],
  10086. b: e[2]
  10087. }
  10088. },
  10089. write: function(e) {
  10090. return [e.r, e.g, e.b]
  10091. }
  10092. },
  10093. RGBA_ARRAY: {
  10094. read: function(e) {
  10095. return 4 == e.length && {
  10096. space: "RGB",
  10097. r: e[0],
  10098. g: e[1],
  10099. b: e[2],
  10100. a: e[3]
  10101. }
  10102. },
  10103. write: function(e) {
  10104. return [e.r, e.g, e.b, e.a]
  10105. }
  10106. }
  10107. }
  10108. }, {
  10109. litmus: E.isObject,
  10110. conversions: {
  10111. RGBA_OBJ: {
  10112. read: function(e) {
  10113. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10114. space: "RGB",
  10115. r: e.r,
  10116. g: e.g,
  10117. b: e.b,
  10118. a: e.a
  10119. }
  10120. },
  10121. write: function(e) {
  10122. return {
  10123. r: e.r,
  10124. g: e.g,
  10125. b: e.b,
  10126. a: e.a
  10127. }
  10128. }
  10129. },
  10130. RGB_OBJ: {
  10131. read: function(e) {
  10132. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10133. space: "RGB",
  10134. r: e.r,
  10135. g: e.g,
  10136. b: e.b
  10137. }
  10138. },
  10139. write: function(e) {
  10140. return {
  10141. r: e.r,
  10142. g: e.g,
  10143. b: e.b
  10144. }
  10145. }
  10146. },
  10147. HSVA_OBJ: {
  10148. read: function(e) {
  10149. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10150. space: "HSV",
  10151. h: e.h,
  10152. s: e.s,
  10153. v: e.v,
  10154. a: e.a
  10155. }
  10156. },
  10157. write: function(e) {
  10158. return {
  10159. h: e.h,
  10160. s: e.s,
  10161. v: e.v,
  10162. a: e.a
  10163. }
  10164. }
  10165. },
  10166. HSV_OBJ: {
  10167. read: function(e) {
  10168. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10169. space: "HSV",
  10170. h: e.h,
  10171. s: e.s,
  10172. v: e.v
  10173. }
  10174. },
  10175. write: function(e) {
  10176. return {
  10177. h: e.h,
  10178. s: e.s,
  10179. v: e.v
  10180. }
  10181. }
  10182. }
  10183. }
  10184. }],
  10185. function() {
  10186. b = !1;
  10187. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10188. return E.each(w, function(e) {
  10189. if (e.litmus(i))
  10190. return E.each(e.conversions, function(e, t) {
  10191. if (_ = e.read(i),
  10192. !1 === b && !1 !== _)
  10193. return (b = _).conversionName = t,
  10194. _.conversion = e,
  10195. E.BREAK
  10196. }),
  10197. E.BREAK
  10198. }),
  10199. b
  10200. }
  10201. ),
  10202. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10203. function y(e, t, i, n) {
  10204. if (void 0 === t[i])
  10205. throw new Error("Object " + t + ' has no property "' + i + '"');
  10206. var r;
  10207. if (n.color)
  10208. r = new g(t,i);
  10209. else {
  10210. var o = [t, i].concat(n.factoryArgs);
  10211. r = c.apply(e, o)
  10212. }
  10213. n.before instanceof h && (n.before = n.before.__li),
  10214. C(e, r),
  10215. m.addClass(r.domElement, "c");
  10216. var a = document.createElement("span");
  10217. m.addClass(a, "property-name"),
  10218. a.innerHTML = r.property;
  10219. var s = document.createElement("div");
  10220. s.appendChild(a),
  10221. s.appendChild(r.domElement);
  10222. var l = A(e, s, n.before);
  10223. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10224. m.addClass(l, typeof r.getValue()),
  10225. function(t, i, n) {
  10226. if (n.__li = i,
  10227. n.__gui = t,
  10228. v.extend(n, {
  10229. options: function(e) {
  10230. return 1 < arguments.length ? (n.remove(),
  10231. y(t, n.object, n.property, {
  10232. before: n.__li.nextElementSibling,
  10233. factoryArgs: [v.toArray(arguments)]
  10234. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10235. y(t, n.object, n.property, {
  10236. before: n.__li.nextElementSibling,
  10237. factoryArgs: [e]
  10238. })) : void 0
  10239. },
  10240. name: function(e) {
  10241. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10242. n
  10243. },
  10244. listen: function() {
  10245. return n.__gui.listen(n),
  10246. n
  10247. },
  10248. remove: function() {
  10249. return n.__gui.remove(n),
  10250. n
  10251. }
  10252. }),
  10253. n instanceof f) {
  10254. var r = new p(n.object,n.property,{
  10255. min: n.__min,
  10256. max: n.__max,
  10257. step: n.__step
  10258. });
  10259. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10260. var t = n[e]
  10261. , i = r[e];
  10262. n[e] = r[e] = function() {
  10263. var e = Array.prototype.slice.call(arguments);
  10264. return t.apply(n, e),
  10265. i.apply(r, e)
  10266. }
  10267. }),
  10268. m.addClass(i, "has-slider"),
  10269. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10270. } else if (n instanceof p) {
  10271. var e = function(e) {
  10272. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10273. y(t, n.object, n.property, {
  10274. before: n.__li.nextElementSibling,
  10275. factoryArgs: [n.__min, n.__max, n.__step]
  10276. })) : e
  10277. };
  10278. n.min = v.compose(e, n.min),
  10279. n.max = v.compose(e, n.max)
  10280. } else
  10281. n instanceof u ? (m.bind(i, "click", function() {
  10282. m.fakeEvent(n.__checkbox, "click")
  10283. }),
  10284. m.bind(n.__checkbox, "click", function(e) {
  10285. e.stopPropagation()
  10286. })) : n instanceof d ? (m.bind(i, "click", function() {
  10287. m.fakeEvent(n.__button, "click")
  10288. }),
  10289. m.bind(i, "mouseover", function() {
  10290. m.addClass(n.__button, "hover")
  10291. }),
  10292. m.bind(i, "mouseout", function() {
  10293. m.removeClass(n.__button, "hover")
  10294. })) : n instanceof g && (m.addClass(i, "color"),
  10295. n.updateDisplay = v.compose(function(e) {
  10296. return i.style.borderLeftColor = n.__color.toString(),
  10297. e
  10298. }, n.updateDisplay),
  10299. n.updateDisplay());
  10300. n.setValue = v.compose(function(e) {
  10301. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10302. e
  10303. }, n.setValue)
  10304. }(e, l, r),
  10305. e.__controllers.push(r),
  10306. r
  10307. }
  10308. function A(e, t, i) {
  10309. var n = document.createElement("li");
  10310. return t && n.appendChild(t),
  10311. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10312. e.onResize(),
  10313. n
  10314. }
  10315. function C(e, t) {
  10316. var i = e.getRoot()
  10317. , n = i.__rememberedObjects.indexOf(t.object);
  10318. if (-1 != n) {
  10319. var r = i.__rememberedObjectIndecesToControllers[n];
  10320. if (void 0 === r && (r = {},
  10321. i.__rememberedObjectIndecesToControllers[n] = r),
  10322. r[t.property] = t,
  10323. i.load && i.load.remembered) {
  10324. var o, a = i.load.remembered;
  10325. if (a[e.preset])
  10326. o = a[e.preset];
  10327. else {
  10328. if (!a[T])
  10329. return;
  10330. o = a[T]
  10331. }
  10332. if (o[n] && void 0 !== o[n][t.property]) {
  10333. var s = o[n][t.property];
  10334. t.initialValue = s,
  10335. t.setValue(s)
  10336. }
  10337. }
  10338. }
  10339. }
  10340. function I(e, t) {
  10341. return document.location.href + "." + t
  10342. }
  10343. function l(e, t) {
  10344. e.domElement.style.width = t + "px",
  10345. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10346. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10347. }
  10348. function a(r, o) {
  10349. var a = {};
  10350. return v.each(r.__rememberedObjects, function(e, t) {
  10351. var i = {}
  10352. , n = r.__rememberedObjectIndecesToControllers[t];
  10353. v.each(n, function(e, t) {
  10354. i[t] = o ? e.initialValue : e.getValue()
  10355. }),
  10356. a[t] = i
  10357. }),
  10358. a
  10359. }
  10360. function E(e, t, i) {
  10361. var n = document.createElement("option");
  10362. n.innerHTML = t,
  10363. n.value = t,
  10364. e.__preset_select.appendChild(n),
  10365. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10366. }
  10367. function _(e, t) {
  10368. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10369. i.innerHTML = t ? i.value + "*" : i.value
  10370. }
  10371. 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");
  10372. var b, w, T = "Default", x = function() {
  10373. try {
  10374. return "localStorage"in window && null !== window.localStorage
  10375. } catch (e) {
  10376. return !1
  10377. }
  10378. }(), S = !0, s = !1, M = [], R = function(t) {
  10379. var i = this;
  10380. this.domElement = document.createElement("div"),
  10381. this.__ul = document.createElement("ul"),
  10382. this.domElement.appendChild(this.__ul),
  10383. m.addClass(this.domElement, "dg"),
  10384. this.__folders = {},
  10385. this.__controllers = [],
  10386. this.__rememberedObjects = [],
  10387. this.__rememberedObjectIndecesToControllers = [],
  10388. this.__listening = [],
  10389. t = t || {},
  10390. t = v.defaults(t, {
  10391. autoPlace: !0,
  10392. width: R.DEFAULT_WIDTH
  10393. }),
  10394. t = v.defaults(t, {
  10395. resizable: t.autoPlace,
  10396. hideable: t.autoPlace
  10397. }),
  10398. v.isUndefined(t.load) ? t.load = {
  10399. preset: T
  10400. } : t.preset && (t.load.preset = t.preset),
  10401. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10402. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10403. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10404. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10405. if (Object.defineProperties(this, {
  10406. parent: {
  10407. get: function() {
  10408. return t.parent
  10409. }
  10410. },
  10411. scrollable: {
  10412. get: function() {
  10413. return t.scrollable
  10414. }
  10415. },
  10416. autoPlace: {
  10417. get: function() {
  10418. return t.autoPlace
  10419. }
  10420. },
  10421. preset: {
  10422. get: function() {
  10423. return i.parent ? i.getRoot().preset : t.load.preset
  10424. },
  10425. set: function(e) {
  10426. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10427. function(e) {
  10428. for (var t = 0; t < e.__preset_select.length; t++)
  10429. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10430. }(this),
  10431. i.revert()
  10432. }
  10433. },
  10434. width: {
  10435. get: function() {
  10436. return t.width
  10437. },
  10438. set: function(e) {
  10439. t.width = e,
  10440. l(i, e)
  10441. }
  10442. },
  10443. name: {
  10444. get: function() {
  10445. return t.name
  10446. },
  10447. set: function(e) {
  10448. t.name = e,
  10449. a && (a.innerHTML = t.name)
  10450. }
  10451. },
  10452. closed: {
  10453. get: function() {
  10454. return t.closed
  10455. },
  10456. set: function(e) {
  10457. t.closed = e,
  10458. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10459. this.onResize(),
  10460. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10461. }
  10462. },
  10463. load: {
  10464. get: function() {
  10465. return t.load
  10466. }
  10467. },
  10468. useLocalStorage: {
  10469. get: function() {
  10470. return r
  10471. },
  10472. set: function(e) {
  10473. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10474. localStorage.setItem(I(0, "isLocal"), e))
  10475. }
  10476. }
  10477. }),
  10478. v.isUndefined(t.parent)) {
  10479. if (t.closed = !1,
  10480. m.addClass(this.domElement, R.CLASS_MAIN),
  10481. m.makeSelectable(this.domElement, !1),
  10482. x && r) {
  10483. i.useLocalStorage = !0;
  10484. var o = localStorage.getItem(I(0, "gui"));
  10485. o && (t.load = JSON.parse(o))
  10486. }
  10487. this.__closeButton = document.createElement("div"),
  10488. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10489. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10490. this.domElement.appendChild(this.__closeButton),
  10491. m.bind(this.__closeButton, "click", function() {
  10492. i.closed = !i.closed
  10493. })
  10494. } else {
  10495. void 0 === t.closed && (t.closed = !0);
  10496. var a = document.createTextNode(t.name);
  10497. m.addClass(a, "controller-name");
  10498. var s = A(i, a);
  10499. m.addClass(this.__ul, R.CLASS_CLOSED),
  10500. m.addClass(s, "title"),
  10501. m.bind(s, "click", function(e) {
  10502. return e.preventDefault(),
  10503. i.closed = !i.closed,
  10504. !1
  10505. }),
  10506. t.closed || (this.closed = !1)
  10507. }
  10508. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10509. m.addClass(w, "dg"),
  10510. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10511. document.body.appendChild(w),
  10512. S = !1),
  10513. w.appendChild(this.domElement),
  10514. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10515. this.parent || l(i, t.width)),
  10516. m.bind(window, "resize", function() {
  10517. i.onResize()
  10518. }),
  10519. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10520. i.onResize()
  10521. }),
  10522. m.bind(this.__ul, "transitionend", function() {
  10523. i.onResize()
  10524. }),
  10525. m.bind(this.__ul, "oTransitionEnd", function() {
  10526. i.onResize()
  10527. }),
  10528. this.onResize(),
  10529. t.resizable && function(t) {
  10530. function e(e) {
  10531. return e.preventDefault(),
  10532. r = e.clientX,
  10533. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10534. m.bind(window, "mousemove", i),
  10535. m.bind(window, "mouseup", n),
  10536. !1
  10537. }
  10538. function i(e) {
  10539. return e.preventDefault(),
  10540. t.width += r - e.clientX,
  10541. t.onResize(),
  10542. r = e.clientX,
  10543. !1
  10544. }
  10545. function n() {
  10546. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10547. m.unbind(window, "mousemove", i),
  10548. m.unbind(window, "mouseup", n)
  10549. }
  10550. var r;
  10551. t.__resize_handle = document.createElement("div"),
  10552. v.extend(t.__resize_handle.style, {
  10553. width: "6px",
  10554. marginLeft: "-3px",
  10555. height: "200px",
  10556. cursor: "ew-resize",
  10557. position: "absolute"
  10558. }),
  10559. m.bind(t.__resize_handle, "mousedown", e),
  10560. m.bind(t.__closeButton, "mousedown", e),
  10561. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10562. }(this),
  10563. n = function() {
  10564. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10565. }
  10566. ,
  10567. this.saveToLocalStorageIfPossible = n,
  10568. i.getRoot(),
  10569. t.parent || ((e = i.getRoot()).width += 1,
  10570. v.defer(function() {
  10571. e.width -= 1
  10572. }))
  10573. };
  10574. return R.toggleHide = function() {
  10575. s = !s,
  10576. v.each(M, function(e) {
  10577. e.domElement.style.zIndex = s ? -999 : 999,
  10578. e.domElement.style.opacity = s ? 0 : 1
  10579. })
  10580. }
  10581. ,
  10582. R.CLASS_AUTO_PLACE = "a",
  10583. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10584. R.CLASS_MAIN = "main",
  10585. R.CLASS_CONTROLLER_ROW = "cr",
  10586. R.CLASS_TOO_TALL = "taller-than-window",
  10587. R.CLASS_CLOSED = "closed",
  10588. R.CLASS_CLOSE_BUTTON = "close-button",
  10589. R.CLASS_DRAG = "drag",
  10590. R.DEFAULT_WIDTH = 245,
  10591. R.TEXT_CLOSED = "Close Controls",
  10592. R.TEXT_OPEN = "Open Controls",
  10593. m.bind(window, "keydown", function(e) {
  10594. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10595. }, !1),
  10596. v.extend(R.prototype, {
  10597. add: function(e, t) {
  10598. return y(this, e, t, {
  10599. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10600. })
  10601. },
  10602. addColor: function(e, t) {
  10603. return y(this, e, t, {
  10604. color: !0
  10605. })
  10606. },
  10607. remove: function(e) {
  10608. this.__ul.removeChild(e.__li),
  10609. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10610. var t = this;
  10611. v.defer(function() {
  10612. t.onResize()
  10613. })
  10614. },
  10615. destroy: function() {
  10616. this.autoPlace && w.removeChild(this.domElement)
  10617. },
  10618. addFolder: function(e) {
  10619. if (void 0 !== this.__folders[e])
  10620. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10621. var t = {
  10622. name: e,
  10623. parent: this
  10624. };
  10625. t.autoPlace = this.autoPlace,
  10626. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10627. t.load = this.load.folders[e]);
  10628. var i = new R(t);
  10629. this.__folders[e] = i;
  10630. var n = A(this, i.domElement);
  10631. return m.addClass(n, "folder"),
  10632. i
  10633. },
  10634. open: function() {
  10635. this.closed = !1
  10636. },
  10637. close: function() {
  10638. this.closed = !0
  10639. },
  10640. onResize: function() {
  10641. var t = this.getRoot();
  10642. if (t.scrollable) {
  10643. var e = m.getOffset(t.__ul).top
  10644. , i = 0;
  10645. v.each(t.__ul.childNodes, function(e) {
  10646. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10647. }),
  10648. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10649. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10650. t.__ul.style.height = "auto")
  10651. }
  10652. t.__resize_handle && v.defer(function() {
  10653. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10654. }),
  10655. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10656. },
  10657. remember: function() {
  10658. 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>'),
  10659. this.parent)
  10660. throw new Error("You can only call remember on a top level GUI.");
  10661. var t = this;
  10662. v.each(Array.prototype.slice.call(arguments), function(e) {
  10663. 0 == t.__rememberedObjects.length && function(i) {
  10664. var e = i.__save_row = document.createElement("li");
  10665. m.addClass(i.domElement, "has-save"),
  10666. i.__ul.insertBefore(e, i.__ul.firstChild),
  10667. m.addClass(e, "save-row");
  10668. var t = document.createElement("span");
  10669. t.innerHTML = "&nbsp;",
  10670. m.addClass(t, "button gears");
  10671. var n = document.createElement("span");
  10672. n.innerHTML = "Save",
  10673. m.addClass(n, "button"),
  10674. m.addClass(n, "save");
  10675. var r = document.createElement("span");
  10676. r.innerHTML = "New",
  10677. m.addClass(r, "button"),
  10678. m.addClass(r, "save-as");
  10679. var o = document.createElement("span");
  10680. o.innerHTML = "Revert",
  10681. m.addClass(o, "button"),
  10682. m.addClass(o, "revert");
  10683. var a = i.__preset_select = document.createElement("select");
  10684. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10685. E(i, t, t == i.preset)
  10686. }) : E(i, T, !1),
  10687. m.bind(a, "change", function() {
  10688. for (var e = 0; e < i.__preset_select.length; e++)
  10689. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10690. i.preset = this.value
  10691. }),
  10692. e.appendChild(a),
  10693. e.appendChild(t),
  10694. e.appendChild(n),
  10695. e.appendChild(r),
  10696. e.appendChild(o),
  10697. x) {
  10698. var s = document.getElementById("dg-save-locally")
  10699. , l = document.getElementById("dg-local-explain");
  10700. s.style.display = "block";
  10701. var c = document.getElementById("dg-local-storage");
  10702. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10703. var h = function() {
  10704. l.style.display = i.useLocalStorage ? "block" : "none"
  10705. };
  10706. h(),
  10707. m.bind(c, "change", function() {
  10708. i.useLocalStorage = !i.useLocalStorage,
  10709. h()
  10710. })
  10711. }
  10712. var u = document.getElementById("dg-new-constructor");
  10713. m.bind(u, "keydown", function(e) {
  10714. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10715. }),
  10716. m.bind(t, "click", function() {
  10717. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10718. b.show(),
  10719. u.focus(),
  10720. u.select()
  10721. }),
  10722. m.bind(n, "click", function() {
  10723. i.save()
  10724. }),
  10725. m.bind(r, "click", function() {
  10726. var e = prompt("Enter a new preset name.");
  10727. e && i.saveAs(e)
  10728. }),
  10729. m.bind(o, "click", function() {
  10730. i.revert()
  10731. })
  10732. }(t),
  10733. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10734. }),
  10735. this.autoPlace && l(this, this.width)
  10736. },
  10737. getRoot: function() {
  10738. for (var e = this; e.parent; )
  10739. e = e.parent;
  10740. return e
  10741. },
  10742. getSaveObject: function() {
  10743. var i = this.load;
  10744. return i.closed = this.closed,
  10745. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10746. i.remembered || (i.remembered = {}),
  10747. i.remembered[this.preset] = a(this)),
  10748. i.folders = {},
  10749. v.each(this.__folders, function(e, t) {
  10750. i.folders[t] = e.getSaveObject()
  10751. }),
  10752. i
  10753. },
  10754. save: function() {
  10755. this.load.remembered || (this.load.remembered = {}),
  10756. this.load.remembered[this.preset] = a(this),
  10757. _(this, !1),
  10758. this.saveToLocalStorageIfPossible()
  10759. },
  10760. saveAs: function(e) {
  10761. this.load.remembered || (this.load.remembered = {},
  10762. this.load.remembered[T] = a(this, !0)),
  10763. this.load.remembered[e] = a(this),
  10764. this.preset = e,
  10765. E(this, e, !0),
  10766. this.saveToLocalStorageIfPossible()
  10767. },
  10768. revert: function(t) {
  10769. v.each(this.__controllers, function(e) {
  10770. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10771. }, this),
  10772. v.each(this.__folders, function(e) {
  10773. e.revert(e)
  10774. }),
  10775. t || _(this.getRoot(), !1)
  10776. },
  10777. listen: function(e) {
  10778. var t = 0 == this.__listening.length;
  10779. this.__listening.push(e),
  10780. t && function e(t) {
  10781. 0 != t.length && r(function() {
  10782. e(t)
  10783. }),
  10784. v.each(t, function(e) {
  10785. e.updateDisplay()
  10786. })
  10787. }(this.__listening)
  10788. }
  10789. }),
  10790. R
  10791. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10792. u = ee.controllers.NumberControllerBox,
  10793. d = ee.controllers.NumberControllerSlider,
  10794. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10795. y = ee.dom.dom,
  10796. A = ee.utils.common,
  10797. (C = function(e, t) {
  10798. function i() {
  10799. n.setValue(n.__input.value)
  10800. }
  10801. C.superclass.call(this, e, t);
  10802. var n = this;
  10803. this.__input = document.createElement("input"),
  10804. this.__input.setAttribute("type", "text"),
  10805. y.bind(this.__input, "keyup", i),
  10806. y.bind(this.__input, "change", i),
  10807. y.bind(this.__input, "blur", function() {
  10808. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10809. }),
  10810. y.bind(this.__input, "keydown", function(e) {
  10811. 13 === e.keyCode && this.blur()
  10812. }),
  10813. this.updateDisplay(),
  10814. this.domElement.appendChild(this.__input)
  10815. }
  10816. ).superclass = v,
  10817. A.extend(C.prototype, v.prototype, {
  10818. updateDisplay: function() {
  10819. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10820. C.superclass.prototype.updateDisplay.call(this)
  10821. }
  10822. }),
  10823. C),
  10824. f = ee.controllers.FunctionController,
  10825. g = ee.controllers.BooleanController,
  10826. m = ee.utils.common,
  10827. function(e, t) {
  10828. var i = e[t];
  10829. 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,{
  10830. min: arguments[2],
  10831. max: arguments[3]
  10832. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10833. }
  10834. ), 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) {
  10835. function f(t, i, n, r) {
  10836. t.style.background = "",
  10837. p.each(o, function(e) {
  10838. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10839. })
  10840. }
  10841. var g = function(e, t) {
  10842. function i(e) {
  10843. a(e),
  10844. h.bind(window, "mousemove", a),
  10845. h.bind(window, "mouseup", n)
  10846. }
  10847. function n() {
  10848. h.unbind(window, "mousemove", a),
  10849. h.unbind(window, "mouseup", n)
  10850. }
  10851. function r() {
  10852. var e = d(this.value);
  10853. !1 !== e ? (l.__color.__state = e,
  10854. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10855. }
  10856. function o() {
  10857. h.unbind(window, "mousemove", s),
  10858. h.unbind(window, "mouseup", o)
  10859. }
  10860. function a(e) {
  10861. e.preventDefault();
  10862. var t = h.getWidth(l.__saturation_field)
  10863. , i = h.getOffset(l.__saturation_field)
  10864. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10865. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10866. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10867. 1 < n ? n = 1 : n < 0 && (n = 0),
  10868. l.__color.v = r,
  10869. l.__color.s = n,
  10870. l.setValue(l.__color.toOriginal()),
  10871. !1
  10872. }
  10873. function s(e) {
  10874. e.preventDefault();
  10875. var t = h.getHeight(l.__hue_field)
  10876. , i = h.getOffset(l.__hue_field)
  10877. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10878. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10879. l.__color.h = 360 * n,
  10880. l.setValue(l.__color.toOriginal()),
  10881. !1
  10882. }
  10883. g.superclass.call(this, e, t),
  10884. this.__color = new u(this.getValue()),
  10885. this.__temp = new u(0);
  10886. var l = this;
  10887. this.domElement = document.createElement("div"),
  10888. h.makeSelectable(this.domElement, !1),
  10889. this.__selector = document.createElement("div"),
  10890. this.__selector.className = "selector",
  10891. this.__saturation_field = document.createElement("div"),
  10892. this.__saturation_field.className = "saturation-field",
  10893. this.__field_knob = document.createElement("div"),
  10894. this.__field_knob.className = "field-knob",
  10895. this.__field_knob_border = "2px solid ",
  10896. this.__hue_knob = document.createElement("div"),
  10897. this.__hue_knob.className = "hue-knob",
  10898. this.__hue_field = document.createElement("div"),
  10899. this.__hue_field.className = "hue-field",
  10900. this.__input = document.createElement("input"),
  10901. this.__input.type = "text",
  10902. this.__input_textShadow = "0 1px 1px ",
  10903. h.bind(this.__input, "keydown", function(e) {
  10904. 13 === e.keyCode && r.call(this)
  10905. }),
  10906. h.bind(this.__input, "blur", r),
  10907. h.bind(this.__selector, "mousedown", function(e) {
  10908. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10909. h.removeClass(l.__selector, "drag")
  10910. })
  10911. });
  10912. var c = document.createElement("div");
  10913. p.extend(this.__selector.style, {
  10914. width: "122px",
  10915. height: "102px",
  10916. padding: "3px",
  10917. backgroundColor: "#222",
  10918. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10919. }),
  10920. p.extend(this.__field_knob.style, {
  10921. position: "absolute",
  10922. width: "12px",
  10923. height: "12px",
  10924. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10925. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10926. borderRadius: "12px",
  10927. zIndex: 1
  10928. }),
  10929. p.extend(this.__hue_knob.style, {
  10930. position: "absolute",
  10931. width: "15px",
  10932. height: "2px",
  10933. borderRight: "4px solid #fff",
  10934. zIndex: 1
  10935. }),
  10936. p.extend(this.__saturation_field.style, {
  10937. width: "100px",
  10938. height: "100px",
  10939. border: "1px solid #555",
  10940. marginRight: "3px",
  10941. display: "inline-block",
  10942. cursor: "pointer"
  10943. }),
  10944. p.extend(c.style, {
  10945. width: "100%",
  10946. height: "100%",
  10947. background: "none"
  10948. }),
  10949. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10950. p.extend(this.__hue_field.style, {
  10951. width: "15px",
  10952. height: "100px",
  10953. display: "inline-block",
  10954. border: "1px solid #555",
  10955. cursor: "ns-resize"
  10956. }),
  10957. function(e) {
  10958. e.style.background = "",
  10959. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10960. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10961. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10962. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10963. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10964. }(this.__hue_field),
  10965. p.extend(this.__input.style, {
  10966. outline: "none",
  10967. textAlign: "center",
  10968. color: "#fff",
  10969. border: 0,
  10970. fontWeight: "bold",
  10971. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10972. }),
  10973. h.bind(this.__saturation_field, "mousedown", i),
  10974. h.bind(this.__field_knob, "mousedown", i),
  10975. h.bind(this.__hue_field, "mousedown", function(e) {
  10976. s(e),
  10977. h.bind(window, "mousemove", s),
  10978. h.bind(window, "mouseup", o)
  10979. }),
  10980. this.__saturation_field.appendChild(c),
  10981. this.__selector.appendChild(this.__field_knob),
  10982. this.__selector.appendChild(this.__saturation_field),
  10983. this.__selector.appendChild(this.__hue_field),
  10984. this.__hue_field.appendChild(this.__hue_knob),
  10985. this.domElement.appendChild(this.__input),
  10986. this.domElement.appendChild(this.__selector),
  10987. this.updateDisplay()
  10988. };
  10989. g.superclass = e,
  10990. p.extend(g.prototype, e.prototype, {
  10991. updateDisplay: function() {
  10992. var t = d(this.getValue());
  10993. if (!1 !== t) {
  10994. var i = !1;
  10995. p.each(u.COMPONENTS, function(e) {
  10996. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10997. return i = !0,
  10998. {}
  10999. }, this),
  11000. i && p.extend(this.__color.__state, t)
  11001. }
  11002. p.extend(this.__temp.__state, this.__color.__state),
  11003. this.__temp.a = 1;
  11004. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11005. , n = 255 - e;
  11006. p.extend(this.__field_knob.style, {
  11007. marginLeft: 100 * this.__color.s - 7 + "px",
  11008. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11009. backgroundColor: this.__temp.toString(),
  11010. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11011. }),
  11012. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11013. this.__temp.s = 1,
  11014. this.__temp.v = 1,
  11015. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11016. p.extend(this.__input.style, {
  11017. backgroundColor: this.__input.value = this.__color.toString(),
  11018. color: "rgb(" + e + "," + e + "," + e + ")",
  11019. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11020. })
  11021. }
  11022. });
  11023. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11024. return g
  11025. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11026. a = ee.color.math = {
  11027. hsv_to_rgb: function(e, t, i) {
  11028. var n = Math.floor(e / 60) % 6
  11029. , r = e / 60 - Math.floor(e / 60)
  11030. , o = i * (1 - t)
  11031. , a = i * (1 - r * t)
  11032. , s = i * (1 - (1 - r) * t)
  11033. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11034. return {
  11035. r: 255 * l[0],
  11036. g: 255 * l[1],
  11037. b: 255 * l[2]
  11038. }
  11039. },
  11040. rgb_to_hsv: function(e, t, i) {
  11041. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11042. return 0 == o ? {
  11043. h: NaN,
  11044. s: 0,
  11045. v: 0
  11046. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11047. (n /= 6) < 0 && (n += 1),
  11048. {
  11049. h: 360 * n,
  11050. s: a / o,
  11051. v: o / 255
  11052. })
  11053. },
  11054. rgb_to_hex: function(e, t, i) {
  11055. var n = this.hex_with_component(0, 2, e);
  11056. return n = this.hex_with_component(n, 1, t),
  11057. this.hex_with_component(n, 0, i)
  11058. },
  11059. component_from_hex: function(e, t) {
  11060. return e >> 8 * t & 255
  11061. },
  11062. hex_with_component: function(e, t, i) {
  11063. return i << (c = 8 * t) | e & ~(255 << c)
  11064. }
  11065. },
  11066. s = ee.color.toString,
  11067. l = ee.utils.common,
  11068. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11069. l.extend(ae.prototype, {
  11070. toString: function() {
  11071. return s(this)
  11072. },
  11073. toOriginal: function() {
  11074. return this.__state.conversion.write(this)
  11075. }
  11076. }),
  11077. ie(ae.prototype, "r", 2),
  11078. ie(ae.prototype, "g", 1),
  11079. ie(ae.prototype, "b", 0),
  11080. ne(ae.prototype, "h"),
  11081. ne(ae.prototype, "s"),
  11082. ne(ae.prototype, "v"),
  11083. Object.defineProperty(ae.prototype, "a", {
  11084. get: function() {
  11085. return this.__state.a
  11086. },
  11087. set: function(e) {
  11088. this.__state.a = e
  11089. }
  11090. }),
  11091. Object.defineProperty(ae.prototype, "hex", {
  11092. get: function() {
  11093. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11094. this.__state.hex
  11095. },
  11096. set: function(e) {
  11097. this.__state.space = "HEX",
  11098. this.__state.hex = e
  11099. }
  11100. }),
  11101. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11102. window.setTimeout(e, 1e3 / 60)
  11103. }
  11104. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11105. r = ee.utils.common,
  11106. te.prototype.show = function() {
  11107. var e = this;
  11108. this.backgroundElement.style.display = "block",
  11109. this.domElement.style.display = "block",
  11110. this.domElement.style.opacity = 0,
  11111. this.domElement.style.webkitTransform = "scale(1.1)",
  11112. this.layout(),
  11113. r.defer(function() {
  11114. e.backgroundElement.style.opacity = 1,
  11115. e.domElement.style.opacity = 1,
  11116. e.domElement.style.webkitTransform = "scale(1)"
  11117. })
  11118. }
  11119. ,
  11120. te.prototype.hide = function() {
  11121. var e = this
  11122. , t = function() {
  11123. e.domElement.style.display = "none",
  11124. e.backgroundElement.style.display = "none",
  11125. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11126. n.unbind(e.domElement, "transitionend", t),
  11127. n.unbind(e.domElement, "oTransitionEnd", t)
  11128. };
  11129. n.bind(this.domElement, "webkitTransitionEnd", t),
  11130. n.bind(this.domElement, "transitionend", t),
  11131. n.bind(this.domElement, "oTransitionEnd", t),
  11132. this.backgroundElement.style.opacity = 0,
  11133. this.domElement.style.opacity = 0,
  11134. this.domElement.style.webkitTransform = "scale(1.1)"
  11135. }
  11136. ,
  11137. te.prototype.layout = function() {
  11138. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11139. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11140. }
  11141. ,
  11142. te), ee.dom.dom, ee.utils.common)
  11143. }
  11144. , {}],
  11145. 94: [function(e, t, i) {
  11146. (function(J) {
  11147. "use strict";
  11148. function i(e) {
  11149. function t(e, t) {
  11150. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11151. for (var a = 1; a <= e[o]; a++)
  11152. r[t[n]] = [],
  11153. r[t[n]][0] = i,
  11154. r[t[n]][1] = o,
  11155. n++,
  11156. i++;
  11157. i *= 2
  11158. }
  11159. return r
  11160. }
  11161. function _(e) {
  11162. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11163. t & 1 << i && (B |= 1 << V),
  11164. i--,
  11165. --V < 0 && (255 == B ? (b(255),
  11166. b(0)) : b(B),
  11167. V = 7,
  11168. B = 0)
  11169. }
  11170. function b(e) {
  11171. F.push(e)
  11172. }
  11173. function w(e) {
  11174. b(e >> 8 & 255),
  11175. b(255 & e)
  11176. }
  11177. function T(e, t, i, n, r) {
  11178. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11179. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11180. for (h = 0; h < 8; ++h) {
  11181. i = e[d],
  11182. n = e[d + 1],
  11183. r = e[d + 2],
  11184. o = e[d + 3],
  11185. a = e[d + 4],
  11186. s = e[d + 5],
  11187. l = e[d + 6];
  11188. var p = i + (c = e[d + 7])
  11189. , f = i - c
  11190. , g = n + l
  11191. , m = n - l
  11192. , v = r + s
  11193. , y = r - s
  11194. , A = o + a
  11195. , C = o - a
  11196. , I = p + A
  11197. , E = p - A
  11198. , _ = g + v
  11199. , b = g - v;
  11200. e[d] = I + _,
  11201. e[d + 4] = I - _;
  11202. var w = .707106781 * (b + E);
  11203. e[d + 2] = E + w,
  11204. e[d + 6] = E - w;
  11205. var T = .382683433 * ((I = C + y) - (b = m + f))
  11206. , x = .5411961 * I + T
  11207. , S = 1.306562965 * b + T
  11208. , M = .707106781 * (_ = y + m)
  11209. , R = f + M
  11210. , P = f - M;
  11211. e[d + 5] = P + x,
  11212. e[d + 3] = P - x,
  11213. e[d + 1] = R + S,
  11214. e[d + 7] = R - S,
  11215. d += 8
  11216. }
  11217. for (h = d = 0; h < 8; ++h) {
  11218. i = e[d],
  11219. n = e[d + 8],
  11220. r = e[d + 16],
  11221. o = e[d + 24],
  11222. a = e[d + 32],
  11223. s = e[d + 40],
  11224. l = e[d + 48];
  11225. var O = i + (c = e[d + 56])
  11226. , L = i - c
  11227. , D = n + l
  11228. , N = n - l
  11229. , F = r + s
  11230. , B = r - s
  11231. , V = o + a
  11232. , k = o - a
  11233. , U = O + V
  11234. , H = O - V
  11235. , z = D + F
  11236. , G = D - F;
  11237. e[d] = U + z,
  11238. e[d + 32] = U - z;
  11239. var W = .707106781 * (G + H);
  11240. e[d + 16] = H + W,
  11241. e[d + 48] = H - W;
  11242. var j = .382683433 * ((U = k + B) - (G = N + L))
  11243. , Y = .5411961 * U + j
  11244. , q = 1.306562965 * G + j
  11245. , X = .707106781 * (z = B + N)
  11246. , Z = L + X
  11247. , K = L - X;
  11248. e[d + 40] = K + Y,
  11249. e[d + 24] = K - Y,
  11250. e[d + 8] = Z + q,
  11251. e[d + 56] = Z - q,
  11252. d++
  11253. }
  11254. for (h = 0; h < 64; ++h)
  11255. u = e[h] * t[h],
  11256. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11257. return Q
  11258. }(e, t), c = 0; c < 64; ++c)
  11259. A[C[c]] = l[c];
  11260. var h = A[0] - i;
  11261. i = A[0],
  11262. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11263. _(v[o]));
  11264. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11265. ;
  11266. if (0 == u)
  11267. return _(a),
  11268. i;
  11269. for (var d, p = 1; p <= u; ) {
  11270. for (var f = p; 0 == A[p] && p <= u; ++p)
  11271. ;
  11272. var g = p - f;
  11273. if (16 <= g) {
  11274. d = g >> 4;
  11275. for (var m = 1; m <= d; ++m)
  11276. _(s);
  11277. g &= 15
  11278. }
  11279. o = 32767 + A[p],
  11280. _(r[(g << 4) + y[o]]),
  11281. _(v[o]),
  11282. p++
  11283. }
  11284. return 63 != u && _(a),
  11285. i
  11286. }
  11287. function x(e) {
  11288. if (e <= 0 && (e = 1),
  11289. 100 < e && (e = 100),
  11290. i != e) {
  11291. (function(e) {
  11292. 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++) {
  11293. var n = u((t[i] * e + 50) / 100);
  11294. n < 1 ? n = 1 : 255 < n && (n = 255),
  11295. O[C[i]] = n
  11296. }
  11297. 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++) {
  11298. var a = u((r[o] * e + 50) / 100);
  11299. a < 1 ? a = 1 : 255 < a && (a = 255),
  11300. L[C[o]] = a
  11301. }
  11302. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11303. for (var h = 0; h < 8; h++)
  11304. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11305. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11306. l++
  11307. }
  11308. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11309. i = e
  11310. }
  11311. }
  11312. var S, M, R, P, i, u = (Math.round,
  11313. 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];
  11314. this.encode = function(e, t) {
  11315. var i = ((new Date).getTime(),
  11316. t.quality);
  11317. i && x(i),
  11318. F = new Array,
  11319. B = 0,
  11320. V = 7,
  11321. w(65496),
  11322. w(65504),
  11323. w(16),
  11324. b(74),
  11325. b(70),
  11326. b(73),
  11327. b(70),
  11328. b(0),
  11329. b(1),
  11330. b(1),
  11331. b(0),
  11332. w(1),
  11333. w(1),
  11334. b(0),
  11335. b(0),
  11336. function() {
  11337. w(65499),
  11338. w(132),
  11339. b(0);
  11340. for (var e = 0; e < 64; e++)
  11341. b(O[e]);
  11342. b(1);
  11343. for (var t = 0; t < 64; t++)
  11344. b(L[t])
  11345. }(),
  11346. function(e, t) {
  11347. w(65472),
  11348. w(17),
  11349. b(8),
  11350. w(t),
  11351. w(e),
  11352. b(3),
  11353. b(1),
  11354. b(17),
  11355. b(0),
  11356. b(2),
  11357. b(17),
  11358. b(1),
  11359. b(3),
  11360. b(17),
  11361. b(1)
  11362. }(e.width, e.height),
  11363. function() {
  11364. w(65476),
  11365. w(418),
  11366. b(0);
  11367. for (var e = 0; e < 16; e++)
  11368. b(G[e + 1]);
  11369. for (var t = 0; t <= 11; t++)
  11370. b(W[t]);
  11371. b(16);
  11372. for (var i = 0; i < 16; i++)
  11373. b(j[i + 1]);
  11374. for (var n = 0; n <= 161; n++)
  11375. b(Y[n]);
  11376. b(1);
  11377. for (var r = 0; r < 16; r++)
  11378. b(q[r + 1]);
  11379. for (var o = 0; o <= 11; o++)
  11380. b(X[o]);
  11381. b(17);
  11382. for (var a = 0; a < 16; a++)
  11383. b(Z[a + 1]);
  11384. for (var s = 0; s <= 161; s++)
  11385. b(K[s])
  11386. }(),
  11387. w(65498),
  11388. w(12),
  11389. b(3),
  11390. b(1),
  11391. b(0),
  11392. b(2),
  11393. b(17),
  11394. b(3),
  11395. b(17),
  11396. b(0),
  11397. b(63),
  11398. b(0);
  11399. var n = 0
  11400. , r = 0
  11401. , o = 0;
  11402. B = 0,
  11403. V = 7,
  11404. this.encode.displayName = "_encode_";
  11405. 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; ) {
  11406. for (a = 0; a < A; ) {
  11407. for (u = h = A * C + a,
  11408. d = -1,
  11409. f = p = 0; f < 64; f++)
  11410. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11411. v <= C + p && (u -= A * (C + 1 + p - v)),
  11412. A <= a + d && (u -= a + d - A + 4),
  11413. s = g[u++],
  11414. l = g[u++],
  11415. c = g[u++],
  11416. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11417. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11418. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11419. n = T(k, D, n, S, R),
  11420. r = T(U, N, r, M, P),
  11421. o = T(H, N, o, M, P),
  11422. a += 32
  11423. }
  11424. C += I
  11425. }
  11426. if (0 <= V) {
  11427. var E = [];
  11428. E[1] = V + 1,
  11429. E[0] = (1 << V + 1) - 1,
  11430. _(E)
  11431. }
  11432. return w(65497),
  11433. new J(F)
  11434. }
  11435. ,
  11436. (new Date).getTime(),
  11437. e = e || 50,
  11438. function() {
  11439. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11440. n[t] = e(t)
  11441. }(),
  11442. S = t(G, W),
  11443. M = t(q, X),
  11444. R = t(j, Y),
  11445. P = t(Z, K),
  11446. function() {
  11447. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11448. for (var n = e; n < t; n++)
  11449. y[32767 + n] = i,
  11450. v[32767 + n] = [],
  11451. v[32767 + n][1] = i,
  11452. v[32767 + n][0] = n;
  11453. for (var r = -(t - 1); r <= -e; r++)
  11454. y[32767 + r] = i,
  11455. v[32767 + r] = [],
  11456. v[32767 + r][1] = i,
  11457. v[32767 + r][0] = t - 1 + r;
  11458. e <<= 1,
  11459. t <<= 1
  11460. }
  11461. }(),
  11462. function() {
  11463. for (var e = 0; e < 256; e++)
  11464. z[e] = 19595 * e,
  11465. z[e + 256 >> 0] = 38470 * e,
  11466. z[e + 512 >> 0] = 7471 * e + 32768,
  11467. z[e + 768 >> 0] = -11059 * e,
  11468. z[e + 1024 >> 0] = -21709 * e,
  11469. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11470. z[e + 1536 >> 0] = -27439 * e,
  11471. z[e + 1792 >> 0] = -5329 * e
  11472. }(),
  11473. x(e),
  11474. (new Date).getTime()
  11475. }
  11476. t.exports.encode = function(e, t) {
  11477. return (t = t || {}).quality = t.quality || 50,
  11478. {
  11479. data: new i(t.quality).encode(e, t),
  11480. width: e.width,
  11481. height: e.height
  11482. }
  11483. }
  11484. }
  11485. ).call(this, e("buffer").Buffer)
  11486. }
  11487. , {
  11488. buffer: 198
  11489. }],
  11490. 95: [function(e, t, i) {
  11491. "use strict";
  11492. !function() {
  11493. if ("performance"in window == 0 && (window.performance = {}),
  11494. Date.now = Date.now || function() {
  11495. return (new Date).getTime()
  11496. }
  11497. ,
  11498. "now"in window.performance == 0) {
  11499. var e = Date.now();
  11500. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11501. window.performance.now = function() {
  11502. return Date.now() - e
  11503. }
  11504. }
  11505. }()
  11506. }
  11507. , {}],
  11508. 96: [function(e, t, i) {
  11509. "use strict";
  11510. var a = e("three");
  11511. a.EffectComposer = function(e, t) {
  11512. if (this.renderer = e,
  11513. void 0 === t) {
  11514. var i = {
  11515. minFilter: a.LinearFilter,
  11516. magFilter: a.LinearFilter,
  11517. format: a.RGBAFormat,
  11518. stencilBuffer: !1
  11519. }
  11520. , n = e.getSize();
  11521. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11522. }
  11523. this.renderTarget1 = t,
  11524. this.renderTarget2 = t.clone(),
  11525. this.writeBuffer = this.renderTarget1,
  11526. this.readBuffer = this.renderTarget2,
  11527. this.passes = [],
  11528. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11529. this.copyPass = new a.ShaderPass(a.CopyShader)
  11530. }
  11531. ,
  11532. a.EffectComposer.prototype = {
  11533. swapBuffers: function() {
  11534. var e = this.readBuffer;
  11535. this.readBuffer = this.writeBuffer,
  11536. this.writeBuffer = e
  11537. },
  11538. addPass: function(e) {
  11539. this.passes.push(e)
  11540. },
  11541. insertPass: function(e, t) {
  11542. this.passes.splice(t, 0, e)
  11543. },
  11544. render: function(e) {
  11545. this.writeBuffer = this.renderTarget1,
  11546. this.readBuffer = this.renderTarget2;
  11547. var t, i, n = !1, r = this.passes.length;
  11548. for (i = 0; i < r; i++)
  11549. if ((t = this.passes[i]).enabled) {
  11550. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11551. t.needsSwap) {
  11552. if (n) {
  11553. var o = this.renderer.context;
  11554. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11555. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11556. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11557. }
  11558. this.swapBuffers()
  11559. }
  11560. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11561. }
  11562. },
  11563. reset: function(e) {
  11564. if (void 0 === e) {
  11565. var t = this.renderer.getSize();
  11566. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11567. }
  11568. this.renderTarget1.dispose(),
  11569. this.renderTarget2.dispose(),
  11570. this.renderTarget1 = e,
  11571. this.renderTarget2 = e.clone(),
  11572. this.writeBuffer = this.renderTarget1,
  11573. this.readBuffer = this.renderTarget2
  11574. },
  11575. setSize: function(e, t) {
  11576. this.renderTarget1.setSize(e, t),
  11577. this.renderTarget2.setSize(e, t)
  11578. this.passes.forEach(a=>{//add for TransitionPass
  11579. a.setSize && a.setSize(e, t)
  11580. })
  11581. }
  11582. }
  11583. }
  11584. , {
  11585. three: 217
  11586. }],
  11587. 97: [function(e, t, i) {
  11588. "use strict";
  11589. var n = e("three");
  11590. n.MaskPass = function(e, t) {
  11591. this.scene = e,
  11592. this.camera = t,
  11593. this.enabled = !0,
  11594. this.clear = !0,
  11595. this.needsSwap = !1,
  11596. this.inverse = !1
  11597. }
  11598. ,
  11599. n.MaskPass.prototype = {
  11600. render: function(e, t, i, n) {
  11601. var r, o, a = e.context;
  11602. a.colorMask(!1, !1, !1, !1),
  11603. a.depthMask(!1),
  11604. o = this.inverse ? (r = 0,
  11605. 1) : (r = 1,
  11606. 0),
  11607. a.enable(a.STENCIL_TEST),
  11608. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11609. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11610. a.clearStencil(o),
  11611. e.render(this.scene, this.camera, i, this.clear),
  11612. e.render(this.scene, this.camera, t, this.clear),
  11613. a.colorMask(!0, !0, !0, !0),
  11614. a.depthMask(!0),
  11615. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11616. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11617. }
  11618. },
  11619. n.ClearMaskPass = function() {
  11620. this.enabled = !0
  11621. }
  11622. ,
  11623. n.ClearMaskPass.prototype = {
  11624. render: function(e, t, i, n) {
  11625. var r = e.context;
  11626. r.disable(r.STENCIL_TEST)
  11627. }
  11628. }
  11629. }
  11630. , {
  11631. three: 217
  11632. }],
  11633. 98: [function(e, t, i) {
  11634. "use strict";
  11635. var o = e("three");
  11636. o.RenderPass = function(e, t, i, n, r) {
  11637. this.scene = e,
  11638. this.camera = t,
  11639. this.overrideMaterial = i,
  11640. this.clearColor = n,
  11641. this.clearAlpha = void 0 !== r ? r : 1,
  11642. this.oldClearColor = new o.Color,
  11643. this.oldClearAlpha = 1,
  11644. this.enabled = !0,
  11645. this.clear = !0,
  11646. this.needsSwap = !1
  11647. }
  11648. ,
  11649. o.RenderPass.prototype = {
  11650. render: function(e, t, i, n) {
  11651. this.scene.overrideMaterial = this.overrideMaterial,
  11652. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11653. this.oldClearAlpha = e.getClearAlpha(),
  11654. e.setClearColor(this.clearColor, this.clearAlpha)),
  11655. e.render(this.scene, this.camera, i, this.clear),
  11656. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11657. this.scene.overrideMaterial = null
  11658. }
  11659. }
  11660. }
  11661. , {
  11662. three: 217
  11663. }],
  11664. 99: [function(e, t, i) {
  11665. "use strict";
  11666. var n = e("three");
  11667. n.ShaderPass = function(e, t) {
  11668. this.textureID = void 0 !== t ? t : "tDiffuse",
  11669. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11670. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11671. this.material = new n.ShaderMaterial({
  11672. defines: e.defines || {},
  11673. uniforms: this.uniforms,
  11674. vertexShader: e.vertexShader,
  11675. fragmentShader: e.fragmentShader
  11676. })),
  11677. this.renderToScreen = !1,
  11678. this.enabled = !0,
  11679. this.needsSwap = !0,
  11680. this.clear = !1,
  11681. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11682. this.scene = new n.Scene,
  11683. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11684. this.scene.add(this.quad)
  11685. }
  11686. ,
  11687. n.ShaderPass.prototype = {
  11688. render: function(e, t, i, n) {
  11689. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11690. this.quad.material = this.material,
  11691. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11692. }
  11693. }
  11694. }
  11695. , {
  11696. three: 217
  11697. }],
  11698. 100: [function(e, t, i) {
  11699. "use strict";
  11700. e("three").CopyShader = {
  11701. uniforms: {
  11702. tDiffuse: {
  11703. type: "t",
  11704. value: null
  11705. },
  11706. opacity: {
  11707. type: "f",
  11708. value: 1
  11709. }
  11710. },
  11711. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11712. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11713. }
  11714. }
  11715. , {
  11716. three: 217
  11717. }],
  11718. 101: [function(e, t, i) {
  11719. "use strict";
  11720. e("three").HorizontalBlurShader = {
  11721. uniforms: {
  11722. tDiffuse: {
  11723. type: "t",
  11724. value: null
  11725. },
  11726. h: {
  11727. type: "f",
  11728. value: 1 / 512
  11729. }
  11730. },
  11731. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11732. 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")
  11733. }
  11734. }
  11735. , {
  11736. three: 217
  11737. }],
  11738. 102: [function(e, t, i) {
  11739. "use strict";
  11740. e("three").VerticalBlurShader = {
  11741. uniforms: {
  11742. tDiffuse: {
  11743. type: "t",
  11744. value: null
  11745. },
  11746. v: {
  11747. type: "f",
  11748. value: 1 / 512
  11749. }
  11750. },
  11751. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11752. 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")
  11753. }
  11754. }
  11755. , {
  11756. three: 217
  11757. }],
  11758. 103: [function(e, t, i) {
  11759. "use strict";
  11760. var z = e("three");
  11761. !function() {
  11762. if ("performance"in window == 0 && (window.performance = {}),
  11763. "now"in window.performance == 0) {
  11764. var e = Date.now();
  11765. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11766. window.performance.now = function() {
  11767. return Date.now() - e
  11768. }
  11769. }
  11770. }(),
  11771. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11772. var t, i = this.extensions, n = this.context;
  11773. if (e === z.RepeatWrapping)
  11774. return n.REPEAT;
  11775. if (e === z.ClampToEdgeWrapping)
  11776. return n.CLAMP_TO_EDGE;
  11777. if (e === z.MirroredRepeatWrapping)
  11778. return n.MIRRORED_REPEAT;
  11779. if (e === z.NearestFilter)
  11780. return n.NEAREST;
  11781. if (e === z.NearestMipMapNearestFilter)
  11782. return n.NEAREST_MIPMAP_NEAREST;
  11783. if (e === z.NearestMipMapLinearFilter)
  11784. return n.NEAREST_MIPMAP_LINEAR;
  11785. if (e === z.LinearFilter)
  11786. return n.LINEAR;
  11787. if (e === z.LinearMipMapNearestFilter)
  11788. return n.LINEAR_MIPMAP_NEAREST;
  11789. if (e === z.LinearMipMapLinearFilter)
  11790. return n.LINEAR_MIPMAP_LINEAR;
  11791. if (e === z.UnsignedByteType)
  11792. return n.UNSIGNED_BYTE;
  11793. if (e === z.UnsignedShort4444Type)
  11794. return n.UNSIGNED_SHORT_4_4_4_4;
  11795. if (e === z.UnsignedShort5551Type)
  11796. return n.UNSIGNED_SHORT_5_5_5_1;
  11797. if (e === z.UnsignedShort565Type)
  11798. return n.UNSIGNED_SHORT_5_6_5;
  11799. if (e === z.ByteType)
  11800. return n.BYTE;
  11801. if (e === z.ShortType)
  11802. return n.SHORT;
  11803. if (e === z.UnsignedShortType)
  11804. return n.UNSIGNED_SHORT;
  11805. if (e === z.IntType)
  11806. return n.INT;
  11807. if (e === z.UnsignedIntType)
  11808. return n.UNSIGNED_INT;
  11809. if (e === z.FloatType)
  11810. return n.FLOAT;
  11811. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11812. return t.HALF_FLOAT_OES;
  11813. if (e === z.AlphaFormat)
  11814. return n.ALPHA;
  11815. if (e === z.RGBFormat)
  11816. return n.RGB;
  11817. if (e === z.RGBAFormat)
  11818. return n.RGBA;
  11819. if (e === z.LuminanceFormat)
  11820. return n.LUMINANCE;
  11821. if (e === z.LuminanceAlphaFormat)
  11822. return n.LUMINANCE_ALPHA;
  11823. if (e === z.AddEquation)
  11824. return n.FUNC_ADD;
  11825. if (e === z.SubtractEquation)
  11826. return n.FUNC_SUBTRACT;
  11827. if (e === z.ReverseSubtractEquation)
  11828. return n.FUNC_REVERSE_SUBTRACT;
  11829. if (e === z.ZeroFactor)
  11830. return n.ZERO;
  11831. if (e === z.OneFactor)
  11832. return n.ONE;
  11833. if (e === z.SrcColorFactor)
  11834. return n.SRC_COLOR;
  11835. if (e === z.OneMinusSrcColorFactor)
  11836. return n.ONE_MINUS_SRC_COLOR;
  11837. if (e === z.SrcAlphaFactor)
  11838. return n.SRC_ALPHA;
  11839. if (e === z.OneMinusSrcAlphaFactor)
  11840. return n.ONE_MINUS_SRC_ALPHA;
  11841. if (e === z.DstAlphaFactor)
  11842. return n.DST_ALPHA;
  11843. if (e === z.OneMinusDstAlphaFactor)
  11844. return n.ONE_MINUS_DST_ALPHA;
  11845. if (e === z.DstColorFactor)
  11846. return n.DST_COLOR;
  11847. if (e === z.OneMinusDstColorFactor)
  11848. return n.ONE_MINUS_DST_COLOR;
  11849. if (e === z.SrcAlphaSaturateFactor)
  11850. return n.SRC_ALPHA_SATURATE;
  11851. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11852. if (e === z.RGB_S3TC_DXT1_Format)
  11853. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11854. if (e === z.RGBA_S3TC_DXT1_Format)
  11855. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11856. if (e === z.RGBA_S3TC_DXT3_Format)
  11857. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11858. if (e === z.RGBA_S3TC_DXT5_Format)
  11859. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11860. }
  11861. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11862. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11863. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11864. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11865. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11866. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11867. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11868. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11869. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11870. }
  11871. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11872. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11873. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11874. if (e === z.MinEquation)
  11875. return t.MIN_EXT;
  11876. if (e === z.MaxEquation)
  11877. return t.MAX_EXT
  11878. }
  11879. return 0
  11880. }
  11881. ,
  11882. z.WebGLState = function(l, i, c) {
  11883. var n = this
  11884. , r = new z.Vector4
  11885. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11886. , o = new Uint8Array(e)
  11887. , a = new Uint8Array(e)
  11888. , s = new Uint8Array(e)
  11889. , t = {}
  11890. , h = null
  11891. , u = null
  11892. , d = null
  11893. , p = null
  11894. , f = null
  11895. , g = null
  11896. , m = null
  11897. , v = null
  11898. , y = !1
  11899. , A = null
  11900. , C = null
  11901. , I = null
  11902. , E = null
  11903. , _ = null
  11904. , b = null
  11905. , w = null
  11906. , T = null
  11907. , x = null
  11908. , S = null
  11909. , M = null
  11910. , R = null
  11911. , P = null
  11912. , O = null
  11913. , L = null
  11914. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11915. , N = void 0
  11916. , F = {}
  11917. , B = new z.Vector4
  11918. , V = null
  11919. , k = null
  11920. , U = new z.Vector4
  11921. , H = new z.Vector4;
  11922. this.init = function() {
  11923. this.clearColor(0, 0, 0, 1),
  11924. this.clearDepth(1),
  11925. this.clearStencil(0),
  11926. this.enable(l.DEPTH_TEST),
  11927. l.depthFunc(l.LEQUAL),
  11928. l.frontFace(l.CCW),
  11929. l.cullFace(l.BACK),
  11930. this.enable(l.CULL_FACE),
  11931. this.enable(l.BLEND),
  11932. l.blendEquation(l.FUNC_ADD),
  11933. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11934. }
  11935. ,
  11936. this.initAttributes = function() {
  11937. for (var e = 0, t = o.length; e < t; e++)
  11938. o[e] = 0
  11939. }
  11940. ,
  11941. this.enableAttribute = function(e) {
  11942. o[e] = 1,
  11943. 0 === a[e] && (l.enableVertexAttribArray(e),
  11944. a[e] = 1),
  11945. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11946. s[e] = 0)
  11947. }
  11948. ,
  11949. this.enableAttributeAndDivisor = function(e, t, i) {
  11950. o[e] = 1,
  11951. 0 === a[e] && (l.enableVertexAttribArray(e),
  11952. a[e] = 1),
  11953. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11954. s[e] = t)
  11955. }
  11956. ,
  11957. this.disableUnusedAttributes = function() {
  11958. for (var e = 0, t = a.length; e < t; e++)
  11959. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11960. a[e] = 0)
  11961. }
  11962. ,
  11963. this.enable = function(e) {
  11964. !0 !== t[e] && (l.enable(e),
  11965. t[e] = !0)
  11966. }
  11967. ,
  11968. this.disable = function(e) {
  11969. !1 !== t[e] && (l.disable(e),
  11970. t[e] = !1)
  11971. }
  11972. ,
  11973. this.getCompressedTextureFormats = function() {
  11974. if (null === h && (h = [],
  11975. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11976. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11977. h.push(e[t]);
  11978. return h
  11979. }
  11980. ,
  11981. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11982. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11983. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11984. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11985. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11986. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11987. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11988. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11989. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11990. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11991. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11992. u = e,
  11993. y = s),
  11994. e === z.CustomBlending ? (r = r || t,
  11995. o = o || i,
  11996. a = a || n,
  11997. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11998. d = t,
  11999. g = r),
  12000. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12001. p = i,
  12002. f = n,
  12003. m = o,
  12004. v = a)) : v = m = g = f = p = d = null
  12005. }
  12006. ,
  12007. this.setDepthFunc = function(e) {
  12008. if (A !== e) {
  12009. if (e)
  12010. switch (e) {
  12011. case z.NeverDepth:
  12012. l.depthFunc(l.NEVER);
  12013. break;
  12014. case z.AlwaysDepth:
  12015. l.depthFunc(l.ALWAYS);
  12016. break;
  12017. case z.LessDepth:
  12018. l.depthFunc(l.LESS);
  12019. break;
  12020. case z.LessEqualDepth:
  12021. l.depthFunc(l.LEQUAL);
  12022. break;
  12023. case z.EqualDepth:
  12024. l.depthFunc(l.EQUAL);
  12025. break;
  12026. case z.GreaterEqualDepth:
  12027. l.depthFunc(l.GEQUAL);
  12028. break;
  12029. case z.GreaterDepth:
  12030. l.depthFunc(l.GREATER);
  12031. break;
  12032. case z.NotEqualDepth:
  12033. l.depthFunc(l.NOTEQUAL);
  12034. break;
  12035. default:
  12036. l.depthFunc(l.LEQUAL)
  12037. }
  12038. else
  12039. l.depthFunc(l.LEQUAL);
  12040. A = e
  12041. }
  12042. }
  12043. ,
  12044. this.setDepthTest = function(e) {
  12045. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12046. }
  12047. ,
  12048. this.setDepthWrite = function(e) {
  12049. C !== e && (l.depthMask(e),
  12050. C = e)
  12051. }
  12052. ,
  12053. this.setColorWrite = function(e) {
  12054. I !== e && (l.colorMask(e, e, e, e),
  12055. I = e)
  12056. }
  12057. ,
  12058. this.setStencilFunc = function(e, t, i) {
  12059. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12060. _ = e,
  12061. b = t,
  12062. w = i)
  12063. }
  12064. ,
  12065. this.setStencilOp = function(e, t, i) {
  12066. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12067. T = e,
  12068. x = t,
  12069. S = i)
  12070. }
  12071. ,
  12072. this.setStencilTest = function(e) {
  12073. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12074. }
  12075. ,
  12076. this.setStencilWrite = function(e) {
  12077. E !== e && (l.stencilMask(e),
  12078. E = e)
  12079. }
  12080. ,
  12081. this.setFlipSided = function(e) {
  12082. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12083. M = e)
  12084. }
  12085. ,
  12086. this.setLineWidth = function(e) {
  12087. e !== R && (l.lineWidth(e),
  12088. R = e)
  12089. }
  12090. ,
  12091. this.setPolygonOffset = function(e, t, i) {
  12092. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12093. !e || P === t && O === i || (l.polygonOffset(t, i),
  12094. P = t,
  12095. O = i)
  12096. }
  12097. ,
  12098. this.getScissorTest = function() {
  12099. return L
  12100. }
  12101. ,
  12102. this.setScissorTest = function(e) {
  12103. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12104. }
  12105. ,
  12106. this.activeTexture = function(e) {
  12107. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12108. N !== e && (l.activeTexture(e),
  12109. N = e)
  12110. }
  12111. ,
  12112. this.bindTexture = function(e, t) {
  12113. void 0 === N && n.activeTexture();
  12114. var i = F[N];
  12115. void 0 === i && (i = {
  12116. type: void 0,
  12117. texture: void 0
  12118. },
  12119. F[N] = i),
  12120. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12121. i.type = e,
  12122. i.texture = t)
  12123. }
  12124. ,
  12125. this.compressedTexImage2D = function() {
  12126. try {
  12127. l.compressedTexImage2D.apply(l, arguments)
  12128. } catch (e) {
  12129. console.error(e)
  12130. }
  12131. }
  12132. ,
  12133. this.texImage2D = function() {
  12134. try {
  12135. l.texImage2D.apply(l, arguments)
  12136. } catch (e) {
  12137. console.error(e)
  12138. }
  12139. }
  12140. ,
  12141. this.clearColor = function(e, t, i, n) {
  12142. r.set(e, t, i, n),
  12143. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12144. B.copy(r))
  12145. }
  12146. ,
  12147. this.clearDepth = function(e) {
  12148. V !== e && (l.clearDepth(e),
  12149. V = e)
  12150. }
  12151. ,
  12152. this.clearStencil = function(e) {
  12153. k !== e && (l.clearStencil(e),
  12154. k = e)
  12155. }
  12156. ,
  12157. this.scissor = function(e) {
  12158. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12159. U.copy(e))
  12160. }
  12161. ,
  12162. this.viewport = function(e) {
  12163. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12164. H.copy(e))
  12165. }
  12166. ,
  12167. this.reset = function() {
  12168. for (var e = 0; e < a.length; e++)
  12169. 1 === a[e] && (l.disableVertexAttribArray(e),
  12170. a[e] = 0);
  12171. t = {},
  12172. N = void 0,
  12173. F = {},
  12174. M = E = C = I = u = h = null
  12175. }
  12176. }
  12177. }
  12178. , {
  12179. three: 217
  12180. }],
  12181. 104: [function(a, h, e) {
  12182. (function(i, e) {
  12183. "use strict";
  12184. function t(e) {
  12185. this.urls = e;
  12186. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12187. this.builder = n.loadProto(t),
  12188. this.decoder = this.builder.build("binary_mesh")
  12189. }
  12190. var s = a("three")
  12191. , n = a("protobufjs")
  12192. , r = a("../util/logger")
  12193. , o = (a("../util/common"),
  12194. a("../util/ajax"))
  12195. , l = a("../objects/Chunk")
  12196. , c = new r(e);
  12197. t.prototype = {
  12198. constructor: t,
  12199. load: function(t, i, n, r) {
  12200. return c.time("download"),
  12201. o.get(t, {
  12202. responseType: "arraybuffer"
  12203. }).done(function(e) {
  12204. c.timeEnd("download"),
  12205. this.parse(e, t, i, n, r)
  12206. }
  12207. .bind(this)).fail(r)
  12208. },
  12209. parse: function(e, t, i, n, r) {
  12210. var o = this.readProtobuf(e);
  12211. if (!o)
  12212. return r();
  12213. try {
  12214. c.time("convert to webgl"),
  12215. this.convertProtobufToSceneObject(o, t, i, n, r),
  12216. c.timeEnd("convert to webgl")
  12217. } catch (e) {
  12218. return c.error("failed parsing .dam"),
  12219. c.error(e.message),
  12220. r()
  12221. }
  12222. },
  12223. readProtobuf: function(e) {
  12224. var t;
  12225. try {
  12226. c.time("parse proto"),
  12227. t = this.decoder.decode(e),
  12228. c.timeEnd("parse proto")
  12229. } catch (e) {
  12230. return c.error("failed parsing proto for .dam"),
  12231. c.error(e.message),
  12232. null
  12233. }
  12234. return t
  12235. },
  12236. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12237. if (0 === e.chunk.length)
  12238. return c.warn("No chunks in damfile..."),
  12239. t([]);
  12240. var o = new s.Matrix4;
  12241. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12242. var a = e.chunk.map(function(e) {
  12243. var t = new s.BufferGeometry;
  12244. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12245. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12246. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12247. t.applyMatrix(o),
  12248. t.computeBoundingBox(),
  12249. new l({
  12250. geometry: t,
  12251. textureName: e.material_name,
  12252. name: e.chunk_name,
  12253. meshUrl: i
  12254. })
  12255. });
  12256. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12257. r())
  12258. }
  12259. },
  12260. h.exports = t
  12261. }
  12262. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12263. }
  12264. , {
  12265. "../objects/Chunk": 144,
  12266. "../util/ajax": 181,
  12267. "../util/common": 185,
  12268. "../util/logger": 189,
  12269. buffer: 198,
  12270. protobufjs: 214,
  12271. three: 217
  12272. }],
  12273. 105: [function(n, r, e) {
  12274. (function(e) {
  12275. "use strict";
  12276. var t = (n("three"),
  12277. n("../settings"),
  12278. n("../util/browser"),
  12279. n("./DamLoader"))
  12280. , i = n("../util/logger")
  12281. , u = (n("../ab"),
  12282. new i(e));
  12283. r.exports = {
  12284. getLoaders: function() {
  12285. return [["_50k", ".dam", t], ["", ".dam", t]]
  12286. },
  12287. load: function(e, t, i, n, r, o) {
  12288. var a = this.getLoaders()[o = o || 0];
  12289. if (a) {
  12290. var s = a[0]
  12291. , l = a[1]
  12292. , c = new a[2](t)
  12293. , h = t.get(e + s + l);
  12294. h ? (u.debug("Trying " + s + l),
  12295. c.load(h, i, n, function() {
  12296. this.load(e, t, i, n, r, ++o)
  12297. }
  12298. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12299. this.load(e, t, i, n, r, ++o))
  12300. } else
  12301. r && r("No suitable model file found...")
  12302. }
  12303. }
  12304. }
  12305. ).call(this, "/js/loaders/ModelLoader.js")
  12306. }
  12307. , {
  12308. "../ab": 3,
  12309. "../settings": 166,
  12310. "../util/browser": 182,
  12311. "../util/logger": 189,
  12312. "./DamLoader": 104,
  12313. three: 217
  12314. }],
  12315. 106: [function(i, n, e) {
  12316. (function(e) {
  12317. "use strict";
  12318. var l = i("../util/common")
  12319. , c = i("../util/texture")
  12320. , h = i("../util/browser")
  12321. , t = i("../util/logger")
  12322. , u = i("../settings")
  12323. , d = new t(e);
  12324. n.exports = {
  12325. load: function(i, n) {
  12326. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12327. return $.when();
  12328. var r = l.countUnique(i.chunks.map(function(e) {
  12329. return e.textureName
  12330. }))
  12331. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12332. , t = "_50k" == e ? "high" : "low";
  12333. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12334. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12335. t = "low"));
  12336. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12337. , a = $.Deferred()
  12338. , s = 0;
  12339. return i.chunks.forEach(function(e) {
  12340. if (!e.material.map && e.textureName) {
  12341. var t = i.urls.get(o + e.textureName);
  12342. e.setTextureMap(c.load(t, function(e, t) {
  12343. e || (n.push(t),
  12344. s++,
  12345. a.notify(s, r),
  12346. s === r && a.resolve())
  12347. }
  12348. .bind(this, c.isLoaded(t))))
  12349. }
  12350. }),
  12351. a.promise()
  12352. }
  12353. }
  12354. }
  12355. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12356. }
  12357. , {
  12358. "../settings": 166,
  12359. "../util/browser": 182,
  12360. "../util/common": 185,
  12361. "../util/logger": 189,
  12362. "../util/texture": 194
  12363. }],
  12364. 107: [function(s, l, e) {
  12365. (function(n, e) {
  12366. "use strict";
  12367. function t(e) {
  12368. this.model = e,
  12369. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12370. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12371. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12372. , i = r.loadProto(t);
  12373. this.decoder = i.build("VisionModeldata")
  12374. }
  12375. var r = s("protobufjs")
  12376. , i = s("../util/ajax")
  12377. , o = (s("../util/common"),
  12378. s("../util/math"))
  12379. , a = new (s("../util/logger"))(e);
  12380. t.prototype.load = function() {
  12381. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12382. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12383. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12384. $.when([]))
  12385. }
  12386. ,
  12387. t.prototype.loadVisionModelData = function() {
  12388. return i.get(this.modelDataPath, {
  12389. responseType: "arraybuffer"
  12390. }).then(function(e) {
  12391. var t;
  12392. try {
  12393. t = this.decoder.decode(e)
  12394. } catch (e) {
  12395. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12396. this.loadSweepLocationsCSV()
  12397. }
  12398. var i = t.sweepLocations.map(function(e) {
  12399. return {
  12400. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12401. position: {
  12402. x: e.pose.translation.x,
  12403. y: e.pose.translation.y,
  12404. z: e.pose.translation.z
  12405. },
  12406. quaternion: {
  12407. x: e.pose.rotation.x,
  12408. y: e.pose.rotation.y,
  12409. z: e.pose.rotation.z,
  12410. w: e.pose.rotation.w
  12411. },
  12412. puck: {
  12413. x: e.puck.x,
  12414. y: e.puck.y,
  12415. z: e.puck.z
  12416. },
  12417. floor: e.group,
  12418. neighbours: e.visibles,
  12419. alignmentType: e.alignment_type
  12420. }
  12421. }).map(function(e) {
  12422. return e.position = o.convertVisionVector(e.position),
  12423. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12424. e.puck = o.convertVisionVector(e.puck),
  12425. e
  12426. });
  12427. return i.forEach(function(e) {
  12428. if(e.neighbours.find(a=>a==-1)){
  12429. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12430. }
  12431. e.neighbours = e.neighbours.filter(e=>i[e])
  12432. e.neighbours = e.neighbours.map(function(e) {
  12433. return i[e].uuid
  12434. })
  12435. }),
  12436. i
  12437. }
  12438. .bind(this), function() {
  12439. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12440. this.loadSweepLocationsCSV()
  12441. }
  12442. .bind(this))
  12443. }
  12444. ,
  12445. t.prototype.loadSweepLocationsCSV = function() {
  12446. return i.get(this.sweepLocationsPath).then(function(e) {
  12447. return e.split("\n").map(function(e) {
  12448. return e.split(", ")
  12449. }).filter(function(e) {
  12450. return 1 < e.length
  12451. }).map(function(e) {
  12452. return {
  12453. uuid: e[0],
  12454. position: {
  12455. x: parseFloat(e[1]),
  12456. y: parseFloat(e[2]),
  12457. z: parseFloat(e[3])
  12458. },
  12459. quaternion: {
  12460. x: parseFloat(e[4]),
  12461. y: parseFloat(e[5]),
  12462. z: parseFloat(e[6]),
  12463. w: parseFloat(e[7])
  12464. }
  12465. }
  12466. }).map(function(e) {
  12467. return e.position = o.convertVisionVector(e.position),
  12468. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12469. e
  12470. })
  12471. }).fail(function() {
  12472. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12473. })
  12474. }
  12475. ,
  12476. l.exports = t
  12477. }
  12478. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12479. }
  12480. , {
  12481. "../util/ajax": 181,
  12482. "../util/common": 185,
  12483. "../util/logger": 189,
  12484. "../util/math": 190,
  12485. buffer: 198,
  12486. protobufjs: 214
  12487. }],
  12488. 108: [function(s, l, e) {
  12489. (function(e) {
  12490. "use strict";
  12491. function t() {
  12492. this.locale = null
  12493. }
  12494. var i = s("../settings")
  12495. , n = s("../util/common")
  12496. , r = s("../util/logger")
  12497. , o = s("../enum/Locale")
  12498. , a = new r(e);
  12499. t.prototype.init = function() {
  12500. var e;
  12501. switch (i.languageTag) {
  12502. case null:
  12503. case "en":
  12504. case o.EN_US:
  12505. this.locale = o.EN_US,
  12506. e = s("./strings-en-US");
  12507. break;
  12508. case "es":
  12509. case o.ES_MX:
  12510. this.locale = o.ES_MX,
  12511. e = s("./strings-es-MX");
  12512. break;
  12513. case "fr":
  12514. case o.FR_FR:
  12515. this.locale = o.FR_FR,
  12516. e = s("./strings-fr-FR");
  12517. break;
  12518. case "de":
  12519. case o.DE_DE:
  12520. this.locale = o.DE_DE,
  12521. e = s("./strings-de-DE");
  12522. break;
  12523. case "ru":
  12524. case o.RU_RU:
  12525. this.locale = o.RU_RU,
  12526. e = s("./strings-ru-RU");
  12527. break;
  12528. case "cn":
  12529. case o.CN_CN:
  12530. this.locale = o.CN_CN,
  12531. e = s("./strings-cn-CN");
  12532. break;
  12533. case "jp":
  12534. case o.JP_JP:
  12535. this.locale = o.JP_JP,
  12536. e = s("./strings-jp-JP");
  12537. break;
  12538. default:
  12539. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12540. this.locale = o.EN_US,
  12541. e = s("./strings-en-US")
  12542. }
  12543. a.info("Using locale '" + this.locale + "'"),
  12544. n.extendObject(this, e)
  12545. }
  12546. ,
  12547. t.prototype.localizeGUI = function() {
  12548. var e = document.querySelector("#gui-parent");
  12549. this.localizeTree(e),
  12550. this.localizeLoadingText()
  12551. }
  12552. ,
  12553. t.prototype.localizeLoadingText = function() {
  12554. document.querySelector("#help-dialog").classList.add(this.locale),
  12555. document.querySelector("#interaction-modal").classList.add(this.locale),
  12556. document.querySelector("#gui").classList.add(this.locale)
  12557. }
  12558. ,
  12559. t.prototype.localizeTree = function(e) {
  12560. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12561. if (e.nodeType === Node.TEXT_NODE)
  12562. (t = e.data.match(n)) && (i = t[1],
  12563. e.data = this.localizeText(i) || i);
  12564. else if (e.nodeType === Node.ELEMENT_NODE) {
  12565. var r = e.getAttribute("title");
  12566. r && ((t = r.match(n)) && (i = t[1],
  12567. e.setAttribute("title", this.localizeText(i) || i)))
  12568. }
  12569. for (e = e.firstChild; e; )
  12570. this.localizeTree(e),
  12571. e = e.nextSibling
  12572. }
  12573. ,
  12574. t.prototype.localizeText = function(e) {
  12575. var t = this[e];
  12576. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12577. t = s("./strings-en-US")[e]),
  12578. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12579. t
  12580. }
  12581. ,
  12582. l.exports = new t
  12583. }
  12584. ).call(this, "/js/localization/localize.js")
  12585. }
  12586. , {
  12587. "../enum/Locale": 31,
  12588. "../settings": 166,
  12589. "../util/common": 185,
  12590. "../util/logger": 189,
  12591. "./strings-cn-CN": 109,
  12592. "./strings-de-DE": 110,
  12593. "./strings-en-US": 111,
  12594. "./strings-es-MX": 112,
  12595. "./strings-fr-FR": 113,
  12596. "./strings-jp-JP": 114,
  12597. "./strings-ru-RU": 115
  12598. }],
  12599. 109: [function(e, t, i) {
  12600. "use strict";
  12601. t.exports = {
  12602. PAGE_TITLE: "",
  12603. LOADING: "正在加载",
  12604. PRESENTED_BY_CAPS: "呈现者:",
  12605. POWERED_BY: "技术支持:",
  12606. POWERED_BY_CAPS: "技术支持:",
  12607. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12608. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12609. PRESENTED_BY: "呈现者:",
  12610. MORE: "更多 ",
  12611. LESS: "更少 ",
  12612. TAG_CONTENT: "tag™ 内容",
  12613. SHOW: "显示",
  12614. HIDE: "隐藏",
  12615. DOLLHOUSE: "场景屋",
  12616. FLOOR_PLAN: "楼层平面图",
  12617. OPEN_HIGHLIGHTS: "打开精彩片段",
  12618. CLOSE_HIGHLIGHTS: "关闭",
  12619. PREVIOUS: "上一个",
  12620. PLAY: "播放",
  12621. PAUSE: "暂停",
  12622. NEXT: "下一个",
  12623. EXPLORE_3D_SPACE: "探索 3D 空间",
  12624. VIEW_DOLLHOUSE: "观看场景屋",
  12625. SOCIAL_SHARING: "分享这个空间",
  12626. VIEW_IN_VR: "以 VR 观看",
  12627. VIEW_FULLSCREEN: "全屏观看",
  12628. EXIT_FULLSCREEN: " 退出全屏",
  12629. ZOOM_IN: "放大",
  12630. ZOOM_OUT: "缩小",
  12631. FLOOR_NAME: "楼层",
  12632. FLOOR_ALL: "ALL",
  12633. FLOOR_Lang: ["Floor", ""],
  12634. TERMS: "条款",
  12635. PORT_TERMS: "port 条款",
  12636. TERMS_OF_USE: "使用条款",
  12637. CLOSE_TERMS: "关闭",
  12638. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12639. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12640. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12641. WEBVR_ENTER_WEBVR: "进入 VR",
  12642. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12643. WEBVR_LEARN_MORE: "了解更多",
  12644. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12645. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12646. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12647. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12648. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12649. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12650. VR_LEARN_MORE_CAPS: "了解更多",
  12651. VR_PREVIOUS_CAPS: "上一个’,",
  12652. VR_NEXT_CAPS: "下一个",
  12653. VR_GOT_IT_CAPS: "明白了",
  12654. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12655. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12656. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12657. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12658. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12659. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12660. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12661. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12662. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12663. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12664. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12665. VR_APP: "port VR 应用程序",
  12666. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12667. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12668. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12669. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12670. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12671. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12672. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12673. VR_ANDROID_DVICES: "Android 设备",
  12674. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12675. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12676. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12677. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12678. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12679. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12680. VR_DOWNLOAD_HERE: "在此下载",
  12681. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12682. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12683. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12684. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12685. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12686. SHARE_TO: "分享到",
  12687. SHARE_LINK: "直接链接",
  12688. SHARE_EXPLORE: "探索",
  12689. SHARE_AT: "在",
  12690. SHARE_WITH: "使用",
  12691. SHARE_3D: "以 3D",
  12692. SHARE_COPIED: "已复制!",
  12693. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12694. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12695. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12696. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12697. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12698. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12699. ERROR_GENERIC_ACTIONS_3: " 或",
  12700. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12701. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12702. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12703. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12704. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12705. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12706. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12707. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12708. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12709. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12710. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12711. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12712. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12713. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12714. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12715. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12716. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12717. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12718. LINK_TO_LOCATION: "地点链接",
  12719. MENU_COPY: "复制",
  12720. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12721. ROTATE: "旋转",
  12722. MOVE: "移动",
  12723. INSIDE: "内部",
  12724. ZOOM: "缩放",
  12725. HELP: "小帮手",
  12726. HELP_NAVIGATION_TAB: "导航",
  12727. HELP_MORE_HELP_TAB: "更多帮助",
  12728. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12729. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12730. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12731. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12732. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12733. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12734. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12735. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12736. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12737. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12738. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12739. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12740. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12741. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12742. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12743. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12744. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12745. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12746. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12747. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12748. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12749. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12750. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12751. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12752. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12753. HELP_MORE_HLR_A: "精彩片段集锦",
  12754. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12755. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12756. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12757. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12758. HELP_MORE_FLOORS_A: "楼层选择器",
  12759. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12760. HELP_MORE_TAG_A: "tag™ 贴文",
  12761. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12762. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12763. HELP_MORE_ZOOM_A: "缩放控件",
  12764. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12765. HELP_MORE_TOUR_A: "导览控件",
  12766. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12767. HELP_MORE_INSIDE_A: "内部视图",
  12768. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12769. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12770. HELP_MORE_VR_A: "VR 模式",
  12771. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12772. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12773. HELP_MORE_360_A: "360° 视图",
  12774. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12775. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12776. HELP_MORE_FULLSCREEN_A: "全屏",
  12777. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12778. CLOSE: "关闭"
  12779. }
  12780. }
  12781. , {}],
  12782. 110: [function(e, t, i) {
  12783. "use strict";
  12784. t.exports = {
  12785. PAGE_TITLE: "",
  12786. LOADING: "Lädt",
  12787. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12788. POWERED_BY: "Angetrieben von",
  12789. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12790. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12791. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12792. PRESENTED_BY: "Präsentiert von ",
  12793. MORE: "Mehr ",
  12794. LESS: "Weniger ",
  12795. TAG_CONTENT: "tag™ Inhalt",
  12796. SHOW: "Anzeigen",
  12797. HIDE: "Verbergen",
  12798. DOLLHOUSE: "Puppenhaus",
  12799. FLOOR_PLAN: "Grundriss",
  12800. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12801. CLOSE_HIGHLIGHTS: "Schließen",
  12802. PREVIOUS: "Vorheriges",
  12803. PLAY: "Abspielen",
  12804. PAUSE: "Pausieren",
  12805. NEXT: "Nächstes",
  12806. EXPLORE_3D_SPACE: "Innenraum betreten",
  12807. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12808. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12809. VIEW_IN_VR: "In VR ansehen",
  12810. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12811. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12812. ZOOM_IN: "Vergrößern",
  12813. ZOOM_OUT: "Verkleinern",
  12814. FLOOR_NAME: "Etage ",
  12815. FLOOR_ALL: "Alle",
  12816. TERMS: "Bedingungen",
  12817. PORT_TERMS: "port Bedingungen",
  12818. TERMS_OF_USE: "Nutzungsbedingungen",
  12819. TERMS_TEXT_FILE: "terms-de-DE.html",
  12820. CLOSE_TERMS: "Schließen",
  12821. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12822. HELP: "Hilfe",
  12823. HELP_NAVIGATION_TAB: "Navigation",
  12824. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12825. CLOSE: "Schließen",
  12826. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12827. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12828. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12829. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12830. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12831. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12832. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12833. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12834. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12835. 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.",
  12836. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12837. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12838. 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.",
  12839. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12840. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12841. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12842. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12843. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12844. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12845. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12846. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12847. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12848. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12849. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12850. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12851. HELP_MORE_HLR_A: "Liste das Highlight",
  12852. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12853. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12854. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12855. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12856. HELP_MORE_FLOORS_A: "Etage auswählen",
  12857. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12858. HELP_MORE_TAG_A: "tag™ Posts",
  12859. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12860. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12861. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12862. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12863. HELP_MORE_TOUR_A: "Tour Steuerung",
  12864. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12865. HELP_MORE_INSIDE_A: "Innenansicht",
  12866. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12867. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12868. HELP_MORE_VR_A: "VR Modus",
  12869. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12870. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12871. HELP_MORE_360_A: "360° Views Ansicht ",
  12872. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12873. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12874. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12875. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12876. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12877. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12878. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12879. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12880. WEBVR_LEARN_MORE: "Mehr Infos",
  12881. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12882. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12883. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12884. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12885. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12886. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12887. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12888. VR_APP: "port VR App",
  12889. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12890. 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",
  12891. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12892. VR_APP_FOR_ANDROID: "port VR app für Android",
  12893. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12894. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12895. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12896. VR_PREVIOUS_CAPS: "ZURÜCK",
  12897. VR_NEXT_CAPS: "WEITER",
  12898. VR_GOT_IT_CAPS: "VERSTANDEN",
  12899. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12900. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12901. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12902. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12903. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12904. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12905. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12906. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12907. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12908. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12909. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12910. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12911. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12912. VR_ANDROID_DVICES: "Android Geräte",
  12913. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12914. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12915. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12916. VR_DOWNLOAD_HERE: "Hier runterladen",
  12917. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12918. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12919. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12920. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12921. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12922. SHARE_TO: "Teilen auf",
  12923. SHARE_LINK: "Direkter Link",
  12924. SHARE_EXPLORE: "Umsehen",
  12925. SHARE_AT: "auf",
  12926. SHARE_WITH: "mit",
  12927. SHARE_3D: "in 3D",
  12928. SHARE_COPIED: "Kopiert!",
  12929. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12930. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12931. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12932. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12933. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12934. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12935. ERROR_GENERIC_ACTIONS_3: " oder ",
  12936. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12937. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12938. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12939. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12940. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12941. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12942. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12943. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12944. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12945. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12946. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12947. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12948. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12949. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12950. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12951. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12952. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12953. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12954. LINK_TO_LOCATION: "Link zu",
  12955. MENU_COPY: "Kopieren",
  12956. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12957. ROTATE: "Drehen",
  12958. INSIDE: "Drinnen",
  12959. MOVE: "Bewegen",
  12960. ZOOM: "Vergrößern"
  12961. }
  12962. }
  12963. , {}],
  12964. 111: [function(e, t, i) {
  12965. "use strict";
  12966. t.exports = {
  12967. PAGE_TITLE: "",
  12968. LOADING: "Loading",
  12969. PRESENTED_BY_CAPS: "PRESENTED BY",
  12970. POWERED_BY: "powered by ",
  12971. POWERED_BY_CAPS: "POWERED BY",
  12972. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12973. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12974. PRESENTED_BY: "Presented by ",
  12975. MORE: "More ",
  12976. LESS: "Less ",
  12977. TAG_CONTENT: "tag™ Content",
  12978. SHOW: "Show",
  12979. HIDE: "Hide",
  12980. DOLLHOUSE: "Dollhouse",
  12981. FLOOR_PLAN: "Floor plan",
  12982. OPEN_HIGHLIGHTS: "Open Highlights",
  12983. CLOSE_HIGHLIGHTS: "Close",
  12984. PREVIOUS: "Previous",
  12985. PLAY: "Play",
  12986. PAUSE: "Pause",
  12987. NEXT: "Next",
  12988. EXPLORE_3D_SPACE: "Explore 3D Space",
  12989. VIEW_DOLLHOUSE: "View dollhouse",
  12990. SOCIAL_SHARING: "Share this Space",
  12991. VIEW_IN_VR: "View in VR",
  12992. VIEW_FULLSCREEN: "全屏",
  12993. EXIT_FULLSCREEN: "退出全屏",
  12994. ZOOM_IN: "Zoom in",
  12995. ZOOM_OUT: "Zoom out",
  12996. FLOOR_NAME: "Floor ",
  12997. FLOOR_ALL: "全部",
  12998. TERMS: "Terms",
  12999. PORT_TERMS: "port terms",
  13000. TERMS_OF_USE: "Terms of Use",
  13001. TERMS_TEXT_FILE: "terms-en-US.html",
  13002. CLOSE_TERMS: "Close",
  13003. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13004. HELP: "Help",
  13005. HELP_NAVIGATION_TAB: "Navigation",
  13006. HELP_MORE_HELP_TAB: "More Help",
  13007. CLOSE: "Close",
  13008. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13009. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13010. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13011. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13012. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13013. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13014. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13015. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13016. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13017. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13018. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13019. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13020. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13021. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13022. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13023. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13024. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13025. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13026. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13027. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13028. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13029. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13030. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13031. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13032. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13033. HELP_MORE_HLR_A: "Highlight Reel",
  13034. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13035. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13036. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13037. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13038. HELP_MORE_FLOORS_A: "Floor Selector",
  13039. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13040. HELP_MORE_TAG_A: "tag™ Posts",
  13041. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13042. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13043. HELP_MORE_ZOOM_A: "Zoom Controls",
  13044. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13045. HELP_MORE_TOUR_A: "Tour Controls",
  13046. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13047. HELP_MORE_INSIDE_A: "Inside View",
  13048. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13049. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13050. HELP_MORE_VR_A: "VR Mode",
  13051. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13052. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13053. HELP_MORE_360_A: "360° Views",
  13054. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13055. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13056. HELP_MORE_FULLSCREEN_A: "Full screen",
  13057. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13058. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13059. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13060. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13061. WEBVR_ENTER_WEBVR: "ENTER VR",
  13062. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13063. WEBVR_LEARN_MORE: "Learn more",
  13064. WEBVR_VIEW_SPACE: "View Space in VR",
  13065. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13066. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13067. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13068. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13069. VR_PREVIOUS_CAPS: "PREVIOUS",
  13070. VR_NEXT_CAPS: "NEXT",
  13071. VR_GOT_IT_CAPS: "GOT IT",
  13072. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13073. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13074. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13075. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13076. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13077. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13078. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13079. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13080. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13081. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13082. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13083. VR_APP: "port VR App",
  13084. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13085. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13086. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13087. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13088. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13089. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13090. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13091. VR_ANDROID_DVICES: "Android Devices",
  13092. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13093. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13094. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13095. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13096. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13097. VR_APP_OPEN: "Open with the port VR app instead",
  13098. VR_DOWNLOAD_HERE: "Download here",
  13099. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13100. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13101. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13102. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13103. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13104. SHARE_TO: "Share to",
  13105. SHARE_LINK: "Direct Link",
  13106. SHARE_EXPLORE: "Explore ",
  13107. SHARE_AT: "at",
  13108. SHARE_WITH: "with",
  13109. SHARE_3D: " in 3D",
  13110. SHARE_COPIED: "Copied!",
  13111. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13112. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13113. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13114. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13115. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13116. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13117. ERROR_GENERIC_ACTIONS_3: " or ",
  13118. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13119. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13120. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13121. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13122. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13123. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13124. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13125. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13126. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13127. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13128. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13129. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13130. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13131. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13132. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13133. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13134. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13135. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13136. LINK_TO_LOCATION: "Link to location",
  13137. MENU_COPY: "Copy",
  13138. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13139. ROTATE: "Rotate",
  13140. INSIDE: "Inside",
  13141. MOVE: "Move",
  13142. ZOOM: "Zoom"
  13143. }
  13144. }
  13145. , {}],
  13146. 112: [function(e, t, i) {
  13147. "use strict";
  13148. t.exports = {
  13149. PAGE_TITLE: "",
  13150. LOADING: "Cargando",
  13151. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13152. POWERED_BY: "potenciando por ",
  13153. POWERED_BY_CAPS: "POTENCIADO POR ",
  13154. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13155. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13156. PRESENTED_BY: "Presentado por ",
  13157. MORE: "Más ",
  13158. LESS: "Menos ",
  13159. TAG_CONTENT: "Contenido de tag™",
  13160. SHOW: "Mostrar",
  13161. HIDE: "Ocultar",
  13162. DOLLHOUSE: "Dollhouse",
  13163. FLOOR_PLAN: "Planos",
  13164. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13165. CLOSE_HIGHLIGHTS: "Cerrar",
  13166. PREVIOUS: "Anterior",
  13167. PLAY: "Play",
  13168. PAUSE: "Pausa",
  13169. NEXT: "Siguiente",
  13170. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13171. VIEW_DOLLHOUSE: "Ver dollhouse",
  13172. SOCIAL_SHARING: "Compartir este espacio",
  13173. VIEW_IN_VR: "Ver en realidad virtual",
  13174. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13175. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13176. ZOOM_IN: "Acercar",
  13177. ZOOM_OUT: "Alejar",
  13178. FLOOR_NAME: "Piso ",
  13179. FLOOR_ALL: "Todas",
  13180. TERMS: "Condiciones",
  13181. PORT_TERMS: "port términos de uso",
  13182. TERMS_OF_USE: "Términos de uso",
  13183. TERMS_TEXT_FILE: "terms-es-MX.html",
  13184. CLOSE_TERMS: "Cerrar",
  13185. 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.",
  13186. HELP: "Ayuda",
  13187. HELP_NAVIGATION_TAB: "Navegación",
  13188. HELP_MORE_HELP_TAB: "Más Ayuda",
  13189. CLOSE: "Cerrar",
  13190. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13191. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13192. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13193. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13194. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13195. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13196. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13197. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13198. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13199. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13200. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13201. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13202. 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.",
  13203. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13204. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13205. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13206. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13207. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13208. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13209. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13210. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13211. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13212. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13213. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13214. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13215. HELP_MORE_HLR_A: "Galería destacada",
  13216. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13217. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13218. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13219. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13220. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13221. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13222. HELP_MORE_TAG_A: "tag™ Posts",
  13223. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13224. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13225. HELP_MORE_ZOOM_A: "Controles de zoom",
  13226. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13227. HELP_MORE_TOUR_A: "Controles de recorrido",
  13228. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13229. HELP_MORE_INSIDE_A: "Vista interior",
  13230. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13231. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13232. HELP_MORE_VR_A: "Modo de realidad virtual",
  13233. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13234. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13235. HELP_MORE_360_A: "360° Views",
  13236. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13237. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13238. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13239. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13240. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13241. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13242. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13243. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13244. WEBVR_LEARN_MORE: "Más información",
  13245. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13246. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13247. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13248. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13249. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13250. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13251. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13252. VR_APP: "port VR App",
  13253. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13254. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13255. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13256. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13257. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13258. VR_PREVIOUS_CAPS: "ANTERIOR",
  13259. VR_NEXT_CAPS: "SIGUIENTE",
  13260. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13261. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13262. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13263. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13264. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13265. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13266. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13267. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13268. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13269. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13270. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13271. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13272. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13273. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13274. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13275. VR_ANDROID_DVICES: "Dispositivos Android",
  13276. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13277. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13278. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13279. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13280. VR_DOWNLOAD_HERE: "Descargar aquí",
  13281. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13282. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13283. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13284. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13285. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13286. SHARE_TO: "Compartir en",
  13287. SHARE_LINK: "Enlace directo",
  13288. SHARE_EXPLORE: "Explorar ",
  13289. SHARE_AT: "en",
  13290. SHARE_WITH: "con",
  13291. SHARE_3D: " en 3D",
  13292. SHARE_COPIED: "¡Copiado!",
  13293. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13294. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13295. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13296. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13297. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13298. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13299. ERROR_GENERIC_ACTIONS_3: " o ",
  13300. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13301. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13302. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13303. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13304. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13305. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13306. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13307. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13308. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13309. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13310. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13311. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13312. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13313. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13314. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13315. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13316. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13317. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13318. LINK_TO_LOCATION: "Enlace a la ubicación",
  13319. MENU_COPY: "Copiar",
  13320. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13321. ROTATE: "Girar",
  13322. INSIDE: "Interior",
  13323. MOVE: "Moverse",
  13324. ZOOM: "Acercar o alejar"
  13325. }
  13326. }
  13327. , {}],
  13328. 113: [function(e, t, i) {
  13329. "use strict";
  13330. t.exports = {
  13331. PAGE_TITLE: "",
  13332. LOADING: "Chargement",
  13333. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13334. POWERED_BY: "alimenté par ",
  13335. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13336. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13337. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13338. PRESENTED_BY: "Présenté par ",
  13339. MORE: "Plus ",
  13340. LESS: "Moins ",
  13341. TAG_CONTENT: "Contenu tag™",
  13342. SHOW: "Montrer",
  13343. HIDE: "Cacher",
  13344. DOLLHOUSE: "Dollhouse",
  13345. FLOOR_PLAN: "Plan de sol",
  13346. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13347. CLOSE_HIGHLIGHTS: "Fermer",
  13348. PREVIOUS: "Précédent",
  13349. PLAY: "Lecture",
  13350. PAUSE: "Pause",
  13351. NEXT: "Suivant",
  13352. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13353. VIEW_DOLLHOUSE: "Voir dollhouse",
  13354. SOCIAL_SHARING: "Partager cet espace",
  13355. VIEW_IN_VR: "Voir en VR",
  13356. VIEW_FULLSCREEN: "Plein écran",
  13357. EXIT_FULLSCREEN: "Fermer plein écran",
  13358. ZOOM_IN: "Zoom avant",
  13359. ZOOM_OUT: "Zoom arrière",
  13360. FLOOR_NAME: "Étage ",
  13361. FLOOR_ALL: "Tous",
  13362. TERMS: "Mentions légales",
  13363. PORT_TERMS: "port mentions légales",
  13364. TERMS_OF_USE: "Conditions d'utilisation",
  13365. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13366. CLOSE_TERMS: "Fermer",
  13367. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13368. HELP: "Aide",
  13369. HELP_NAVIGATION_TAB: "Navigation",
  13370. HELP_MORE_HELP_TAB: "Aide",
  13371. CLOSE: "Fermer",
  13372. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13373. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13374. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13375. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13376. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13377. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13378. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13379. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13380. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13381. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13382. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13383. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13384. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13385. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13386. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13387. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13388. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13389. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13390. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13391. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13392. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13393. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13394. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13395. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13396. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13397. HELP_MORE_HLR_A: "Carrousel",
  13398. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13399. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13400. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13401. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13402. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13403. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13404. HELP_MORE_TAG_A: "tag™ Posts",
  13405. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13406. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13407. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13408. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13409. HELP_MORE_TOUR_A: "Commandes de la visite",
  13410. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13411. HELP_MORE_INSIDE_A: "Vue intérieure",
  13412. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13413. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13414. HELP_MORE_VR_A: "Mode RV",
  13415. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13416. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13417. HELP_MORE_360_A: "Vues 360°",
  13418. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13419. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13420. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13421. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13422. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13423. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13424. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13425. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13426. WEBVR_LEARN_MORE: "En savoir plus",
  13427. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13428. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13429. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13430. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13431. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13432. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13433. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13434. VR_NEXT_CAPS: "SUIVANT",
  13435. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13436. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13437. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13438. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13439. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13440. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13441. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13442. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13443. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13444. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13445. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13446. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13447. VR_APP: "port VR App",
  13448. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13449. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13450. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13451. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13452. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13453. 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",
  13454. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13455. VR_ANDROID_DVICES: "Appareils Android",
  13456. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13457. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13458. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13459. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13460. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13461. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13462. VR_DOWNLOAD_HERE: "Télécharger ici",
  13463. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13464. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13465. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13466. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13467. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13468. SHARE_TO: "Partager sur",
  13469. SHARE_LINK: "Lien direct",
  13470. SHARE_EXPLORE: "Explorer ",
  13471. SHARE_AT: "à",
  13472. SHARE_WITH: "avec",
  13473. SHARE_3D: " en 3D",
  13474. SHARE_COPIED: "Copié!",
  13475. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13476. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13477. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13478. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13479. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13480. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13481. ERROR_GENERIC_ACTIONS_3: " ou ",
  13482. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13483. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13484. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13485. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13486. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13487. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13488. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13489. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13490. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13491. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13492. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13493. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13494. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13495. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13496. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13497. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13498. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13499. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13500. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13501. MENU_COPY: "Copie",
  13502. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13503. ROTATE: "Faire pivoter",
  13504. INSIDE: "Intérieure",
  13505. MOVE: "Se déplacer",
  13506. ZOOM: "Zoom"
  13507. }
  13508. }
  13509. , {}],
  13510. 114: [function(e, t, i) {
  13511. "use strict";
  13512. t.exports = {
  13513. PAGE_TITLE: "",
  13514. LOADING: "読み込み中",
  13515. PRESENTED_BY_CAPS: "PRESENTED BY",
  13516. POWERED_BY: "powered by",
  13517. POWERED_BY_CAPS: "POWERED BY",
  13518. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13519. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13520. PRESENTED_BY: "Presented by ",
  13521. MORE: "全て表示 ",
  13522. LESS: "閉じる ",
  13523. TAG_CONTENT: "tag™コンテンツ ",
  13524. SHOW: "表示",
  13525. HIDE: "非表示",
  13526. DOLLHOUSE: "ドールハウス",
  13527. FLOOR_PLAN: "フロアプラン",
  13528. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13529. CLOSE_HIGHLIGHTS: "閉じる",
  13530. PREVIOUS: "前へ",
  13531. PLAY: "再生",
  13532. PAUSE: "一時停止",
  13533. NEXT: "次へ",
  13534. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13535. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13536. SOCIAL_SHARING: "このSpaceを共有する",
  13537. VIEW_IN_VR: "VRで表示",
  13538. VIEW_FULLSCREEN: "フルスクリーン表示",
  13539. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13540. ZOOM_IN: "ズームイン",
  13541. ZOOM_OUT: "ズームアウト",
  13542. FLOOR_NAME: "フロア ",
  13543. FLOOR_ALL: "すべて",
  13544. TERMS: "規約",
  13545. PORT_TERMS: "port規約",
  13546. TERMS_OF_USE: "利用規約",
  13547. CLOSE_TERMS: "閉じる",
  13548. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13549. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13550. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13551. WEBVR_ENTER_WEBVR: "VRに入る",
  13552. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13553. WEBVR_LEARN_MORE: "もっと詳しく",
  13554. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13555. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13556. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13557. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13558. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13559. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13560. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13561. VR_PREVIOUS_CAPS: "前へ",
  13562. VR_NEXT_CAPS: "次へ",
  13563. VR_GOT_IT_CAPS: "了解",
  13564. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13565. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13566. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13567. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13568. VR_WHAT_YOU_NEED: "必要なもの",
  13569. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13570. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13571. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13572. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13573. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13574. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13575. VR_APP: "port VRアプリ",
  13576. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13577. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13578. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13579. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13580. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13581. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13582. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13583. VR_ANDROID_DVICES: "Androidデバイス",
  13584. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13585. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13586. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13587. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13588. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13589. VR_APP_OPEN: "port VRアプリで開く",
  13590. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13591. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13592. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13593. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13594. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13595. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13596. SHARE_TO: "共有先",
  13597. SHARE_LINK: "ダイレクトリンク",
  13598. SHARE_EXPLORE: "探索",
  13599. SHARE_AT: "場所",
  13600. SHARE_WITH: "使用アプリ",
  13601. SHARE_3D: "3Dで",
  13602. SHARE_COPIED: "コピーされました!",
  13603. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13604. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13605. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13606. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13607. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13608. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13609. ERROR_GENERIC_ACTIONS_3: "または",
  13610. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13611. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13612. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13613. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13614. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13615. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13616. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13617. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13618. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13619. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13620. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13621. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13622. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13623. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13624. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13625. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13626. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13627. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13628. LINK_TO_LOCATION: "ロケーションへのリンク",
  13629. MENU_COPY: "コピー",
  13630. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13631. ROTATE: "回転",
  13632. MOVE: "移動",
  13633. INSIDE: "内側",
  13634. ZOOM: "ズーム",
  13635. HELP: "ヘルプ",
  13636. HELP_NAVIGATION_TAB: "ナビゲーション",
  13637. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13638. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13639. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13640. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13641. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13642. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13643. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13644. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13645. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13646. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13647. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13648. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13649. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13650. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13651. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13652. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13653. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13654. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13655. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13656. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13657. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13658. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13659. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13660. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13661. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13662. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13663. HELP_MORE_HLR_A: "ハイライト",
  13664. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13665. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13666. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13667. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13668. HELP_MORE_FLOORS_A: "フロアセレクター",
  13669. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13670. HELP_MORE_TAG_A: "tag™ Posts",
  13671. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13672. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13673. HELP_MORE_ZOOM_A: "ズームコントロール",
  13674. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13675. HELP_MORE_TOUR_A: "ツアーコントロール",
  13676. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13677. HELP_MORE_INSIDE_A: "内側ビュー",
  13678. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13679. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13680. HELP_MORE_VR_A: "VRモード",
  13681. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13682. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13683. HELP_MORE_360_A: "360° Views",
  13684. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13685. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13686. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13687. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13688. CLOSE: "閉じる"
  13689. }
  13690. }
  13691. , {}],
  13692. 115: [function(e, t, i) {
  13693. "use strict";
  13694. t.exports = {
  13695. PAGE_TITLE: "",
  13696. LOADING: "Загрузка",
  13697. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13698. POWERED_BY: "разработано на платформе ",
  13699. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13700. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13701. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13702. PRESENTED_BY: "Представлено ",
  13703. MORE: "Больше ",
  13704. LESS: "Меньше ",
  13705. TAG_CONTENT: "tag™ Контент",
  13706. SHOW: "Показать",
  13707. HIDE: "Скрыть",
  13708. DOLLHOUSE: "Dollhouse",
  13709. FLOOR_PLAN: "Планировка",
  13710. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13711. CLOSE_HIGHLIGHTS: "Закрыть",
  13712. PREVIOUS: "Предыдущий",
  13713. PLAY: "Воспроизвести",
  13714. PAUSE: "Пауза",
  13715. NEXT: "Следующий",
  13716. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13717. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13718. SOCIAL_SHARING: "Поделиться этой моделью",
  13719. VIEW_IN_VR: "Посмотреть в VR",
  13720. VIEW_FULLSCREEN: "Полный экран",
  13721. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13722. ZOOM_IN: "Увеличить",
  13723. ZOOM_OUT: "Уменьшить",
  13724. FLOOR_NAME: "Этаж ",
  13725. FLOOR_ALL: "Все",
  13726. TERMS: "Условия",
  13727. PORT_TERMS: "Правила пользования",
  13728. TERMS_OF_USE: "Условия использования",
  13729. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13730. CLOSE_TERMS: "Закрыть",
  13731. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13732. HELP: "Помощь",
  13733. HELP_NAVIGATION_TAB: "Навигация",
  13734. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13735. CLOSE: "Закрыть",
  13736. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13737. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13738. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13739. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13740. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13741. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13742. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13743. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13744. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13745. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13746. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13747. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13748. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13749. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13750. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13751. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13752. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13753. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13754. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13755. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13756. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13757. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13758. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13759. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13760. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13761. HELP_MORE_HLR_A: "Фотоколлаж",
  13762. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13763. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13764. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13765. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13766. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13767. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13768. HELP_MORE_TAG_A: "tag™ Posts",
  13769. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13770. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13771. HELP_MORE_ZOOM_A: "Масштаб",
  13772. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13773. HELP_MORE_TOUR_A: "Управление Туром",
  13774. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13775. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13776. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13777. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13778. HELP_MORE_VR_A: "Режим VR",
  13779. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13780. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13781. HELP_MORE_360_A: "360° Views",
  13782. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13783. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13784. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13785. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13786. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13787. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13788. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13789. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13790. WEBVR_LEARN_MORE: "Узнать больше",
  13791. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13792. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13793. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13794. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13795. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13796. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13797. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13798. VR_APP: "port VR App",
  13799. VR_APP_OPEN: "Или открыть через приложение port VR",
  13800. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13801. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13802. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13803. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13804. VR_VIEW_SPACE: "Запустить модель в VR",
  13805. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13806. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13807. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13808. VR_GOT_IT_CAPS: "ЯСНО",
  13809. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13810. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13811. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13812. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13813. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13814. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13815. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13816. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13817. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13818. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13819. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13820. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13821. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13822. VR_ANDROID_DVICES: "Android устройства",
  13823. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13824. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13825. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13826. VR_DOWNLOAD_HERE: "Скачать здесь",
  13827. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13828. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13829. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13830. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13831. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13832. SHARE_TO: "Поделиться",
  13833. SHARE_LINK: "Прямая ссылка",
  13834. SHARE_EXPLORE: "просмотреть",
  13835. SHARE_AT: "на",
  13836. SHARE_WITH: "с",
  13837. SHARE_3D: "в 3D",
  13838. SHARE_COPIED: "Скопировано!",
  13839. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13840. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13841. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13842. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13843. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13844. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13845. ERROR_GENERIC_ACTIONS_3: " или ",
  13846. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13847. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13848. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13849. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13850. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13851. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13852. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13853. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13854. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13855. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13856. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13857. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13858. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13859. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13860. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13861. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13862. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13863. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13864. LINK_TO_LOCATION: "Ссылка на местоположение",
  13865. MENU_COPY: "Копировать",
  13866. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13867. ROTATE: "Вращать",
  13868. MOVE: "Передвигаться",
  13869. INSIDE: "Вид изнутри",
  13870. ZOOM: "Масштаб"
  13871. }
  13872. }
  13873. , {}],
  13874. 116: [function(r, e, t) {
  13875. (function(i) {
  13876. "use strict";
  13877. function re(e) {
  13878. console.log("e1:" + e),
  13879. e = Math.round(.4 * e * 100),
  13880. console.log("e2:" + e);
  13881. var t = $(".progressbar");
  13882. t.find(".bar").css("width", e + "%"),
  13883. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13884. t.find(".perc").text(e + "%")
  13885. }
  13886. $("#gui-loading").fadeIn(200),
  13887. re(.1);
  13888. var e = g_version ? "modeldata.js" : "someData.json";
  13889. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13890. dataType: "json"
  13891. }).done(function(e) {
  13892. var t = matcher(e);
  13893. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13894. t.user = {
  13895. is_authenticated: !1,
  13896. 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"]
  13897. }
  13898. try{//处理一下导览数据
  13899. t.model.images = t.model.images.filter(e=>{
  13900. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  13901. if(e.locations)e.locations = e.locations.filter(e=>e)
  13902. if(e.locations && e.locations.length == 0)return;
  13903. return e
  13904. })
  13905. }catch(e){console.log(e) }
  13906. window.editTool = new EditTools()
  13907. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  13908. window.DATA = t
  13909. t.model.summary = t.summary
  13910. t.model.name = t.name
  13911. for(let i in t){
  13912. t[i] == "false" && (t[i] = false)
  13913. }
  13914. re(.7),
  13915. function() {
  13916. function y(e) {
  13917. t.update(e)
  13918. }
  13919. function A(e, t) {
  13920. ne.error(t),
  13921. n.error(t),
  13922. N.report(e, "error-" + t)
  13923. }
  13924. function C(e, t, i) {
  13925. try {
  13926. e.start(t)
  13927. } catch (e) {
  13928. throw ne.warn(e.message),
  13929. function(e) {
  13930. var t = O.details();
  13931. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13932. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13933. N.report(e, "error-webgl-generic"))
  13934. }(i.sid),
  13935. e
  13936. }
  13937. }
  13938. function I(e) {
  13939. e.stopPropagation(),
  13940. e.preventDefault()
  13941. }
  13942. window.DATA.hoticon && (g_HotImage = {
  13943. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13944. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13945. });
  13946. if (window.DATA.backgroundMusic) {
  13947. if(window.isLocal){
  13948. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  13949. }else{
  13950. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  13951. }
  13952. $("#volume").show();
  13953. }else if (g_version === "one"){
  13954. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  13955. $("#volume").show();
  13956. }
  13957. //隐藏公司logo
  13958. window.DATA.loadlogo && showLogo();
  13959. r("./lib/three75-shim"),
  13960. r("./lib/array-polyfill"),
  13961. r("./lib/performance-polyfill"),
  13962. r("./lib/shaders/CopyShader.js"),
  13963. r("./lib/shaders/HorizontalBlurShader.js"),
  13964. r("./lib/shaders/VerticalBlurShader.js"),
  13965. r("./lib/postprocessing/EffectComposer.js"),
  13966. r("./lib/postprocessing/RenderPass.js"),
  13967. r("./lib/postprocessing/MaskPass.js"),
  13968. r("./lib/postprocessing/ShaderPass.js"),
  13969. window.Promise || (window.Promise = r("promise-polyfill"));
  13970. var E = r("three")
  13971. , _ = r("three")
  13972. , b = (r("./util/sentry"),
  13973. r("./player"))
  13974. , w = r("./director")
  13975. , T = r("./controls/CameraControls")
  13976. , x = r("./model/ModelManager")
  13977. , S = r("./DisplayController")
  13978. , M = r("./label/LabelDisplayController")
  13979. , R = r("./enum/Viewmode")
  13980. , e = r("./util/logger")
  13981. , P = r("./showcase")
  13982. , O = r("./util/browser")
  13983. , L = r("./settings")
  13984. , D = r("./gui/gui")
  13985. , n = r("./gui/error")
  13986. , N = r("./analytics")
  13987. , F = r("./util/transitions")
  13988. , B = r("./effects")
  13989. , V = r("./objects/Skybox")
  13990. , k = (r("./util/common"),
  13991. r("./util/PanoramaCollection"),
  13992. r("./util/math"),
  13993. r("./util/showcase"))
  13994. , U = r("./util/camera")
  13995. , H = (r("./objects/Panorama"),
  13996. r("./cameras/PanoramaCamera"),
  13997. r("./preloaders"))
  13998. , z = r("events").EventEmitter
  13999. , G = r("./featureflags")
  14000. , W = (r("./util/lerp"),
  14001. r("./util/ajax"),
  14002. r("./ab"))
  14003. , j = r("./sdk/automation.js")
  14004. , Y = r("./scene/SceneRenderer")
  14005. , q = r("./scene/QuickstartManager")
  14006. , X = r("./tile/QualityManager.js")
  14007. , Z = r("./localization/localize")
  14008. , K = r("./tag/tagManager")
  14009. , Q = r("./tile/TileDownloader")
  14010. , J = r("./tile/PanoRenderer")
  14011. , ee = (r("./enum/PanoSizeClass"),
  14012. r("./enum/PanoramaEvents"),
  14013. r("./enum/SceneRendererEvents"))
  14014. , t = r("./gui/memoryUsage")
  14015. , te = r("./enum/RenderLayers")
  14016. , ie = r("./TimingData")
  14017. , ne = new e(i);
  14018. e.level = L.logLevel,
  14019. e.consoleEnabled = L.console,
  14020. function() {
  14021. var e = window.number//k.getModelIDFromQueryString();
  14022. if (!e)
  14023. return A(null, "loading-failed");
  14024. var t = k.parseSidUrl(e)
  14025. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14026. , n = {
  14027. panoElementsToLoad: 6,
  14028. modelElementsToLoad: 0,
  14029. totalElementsLoaded: 0,
  14030. totalElementsToLoad: 0,
  14031. totalPercentageLoaded: 0,
  14032. progressCallback: null
  14033. }
  14034. , r = document.getElementById("player")
  14035. , o = L.quickstart.enabled
  14036. , a = null
  14037. , s = null
  14038. , l = null
  14039. , c = null
  14040. , h = null
  14041. , u = null
  14042. , d = null
  14043. , p = null
  14044. , f = null
  14045. , g = null
  14046. , m = null
  14047. , v = new ie;
  14048. !function(e) {
  14049. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14050. z.defaultMaxListeners = 1e3,
  14051. function(e) {
  14052. e.addEventListener("dragenter", I, !1),
  14053. e.addEventListener("dragover", I, !1)
  14054. }(e),
  14055. O.valueFromHash("title", !0) || $(document).ready(function() {
  14056. $(".model-title").hide()
  14057. })
  14058. }(r),
  14059. function(e) {
  14060. return G.loadFeatureFlags(e).done(function(e) {
  14061. G.updateDependentSettings(e, L)
  14062. })
  14063. }({
  14064. urlBase: t.urlBase
  14065. }).then(function() {
  14066. return Z.init(),
  14067. function(e, t) {
  14068. var i = P.getModel({
  14069. url: t,
  14070. floors: O.valueFromHash("f", !0),
  14071. autoload: !1
  14072. });
  14073. return $.when(i, y).then(null, function(e) {
  14074. return this
  14075. })
  14076. }(0, e)
  14077. }).then(function(e) {
  14078. return re(.9),
  14079. function(e, t, i, n, r) {
  14080. ne.info("Model data loaded"),
  14081. ne.debug("UUID: " + e.data.job.uuid),
  14082. W.init(G.getFlags()),
  14083. i && N.initKeen({
  14084. token: i,
  14085. appId: n
  14086. }),
  14087. N.initSegment({
  14088. model: e.sid,
  14089. version: "2.25.6-0-gd87e5b1",
  14090. startSource: r.startSource,
  14091. token: t,
  14092. autoplay: r.autoplay,
  14093. quickstart: r.quickstart
  14094. })
  14095. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14096. startSource: i,
  14097. autoplay: L.autoplay,
  14098. quickstart: o
  14099. }),
  14100. g.urls.init()
  14101. }).then(function() {
  14102. return g.loadPanos()
  14103. }).then(function() {
  14104. s = U.getStartCameraOptions(g, g.panos);
  14105. //初始画面
  14106. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14107. $("<img/>").attr("src", e).on("load", function() {
  14108. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14109. $(this).remove()
  14110. $(".screen .shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14111. })
  14112. }(window.DATA.camera_start.thumbImg);
  14113. {//初始化导览时间
  14114. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14115. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14116. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14117. /* if(DATA.tourWalkSpeed!=void 0){
  14118. let r = 100 / DATA.tourWalkSpeed;
  14119. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14120. window._settings.warp.flyTime = settings.flyTime * r
  14121. }else{
  14122. window._settings.warp.flyTime = settings.flyTime
  14123. } */
  14124. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14125. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14126. }
  14127. }
  14128. {//其他
  14129. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14130. }
  14131. d = function(e) {
  14132. var t = new E.PerspectiveCamera;
  14133. t.layers.enable(te.PANOMARKERS),
  14134. t.layers.enable(te.RETICULE),
  14135. t.layers.enable(te.TAG);
  14136. var o = new E.Scene
  14137. , i = new E.AmbientLight(16777215);
  14138. return o.add(i),
  14139. o.skybox = new V,
  14140. o.add(o.skybox),
  14141. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14142. side: E.DoubleSide
  14143. })),
  14144. o.plane.position.y = 0,
  14145. o.plane.rotateX(-Math.PI / 2),
  14146. o.plane.material.visible = !1,
  14147. o.add(o.plane),
  14148. o.updateMatrixWorld(),
  14149. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14150. if (e.metadata && e.metadata.camera_position) {
  14151. var t = e.metadata.camera_position
  14152. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14153. i.position = t.clone(),
  14154. o.add(i);
  14155. var n = e.metadata.camera_quaternion
  14156. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14157. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14158. }
  14159. }),
  14160. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14161. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14162. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14163. new Y(o,t,B)
  14164. }(g),
  14165. m = function(e, t) {
  14166. var i = e ? 1 : 1e3
  14167. , n = W.tilegen || W.imgopt ? 6 : 2;
  14168. n = O.valueFromHash("tileconc", n);
  14169. var r = new X
  14170. , o = new Q({
  14171. concurrentDownloads: n
  14172. })
  14173. , a = new J
  14174. , s = new x
  14175. , l = new w
  14176. , c = new b(t)
  14177. , h = new T
  14178. , u = new S(i)
  14179. , d = new M
  14180. , p = new K;
  14181. return {
  14182. qualityManager: r,
  14183. panoRenderer: a,
  14184. tileDownloader: o,
  14185. player: c,
  14186. director: l,
  14187. modelManager: s,
  14188. tagManager: p,
  14189. displayController: u,
  14190. labelDisplayController: d,
  14191. controls: h
  14192. }
  14193. }(o, s.mode),
  14194. l = m.controls,
  14195. c = m.player,
  14196. h = m.director,
  14197. u = m.tagManager,
  14198. p = m.tileDownloader,
  14199. f = m.qualityManager,
  14200. m.panoRenderer,
  14201. function(e, t, i, n) {
  14202. var r = i.controls
  14203. , o = i.qualityManager
  14204. , a = i.panoRenderer
  14205. , s = i.tileDownloader
  14206. , l = i.modelManager;
  14207. r.init(n, l),
  14208. j.init(i.director, r, i.player, l, t),
  14209. o.init(l),
  14210. s.init(o),
  14211. a.init(t, s, o),
  14212. l.init(s, a, o),
  14213. l.addModel(e),
  14214. t.addComponent(F)
  14215. }(g, d, m, r),
  14216. c.director = h,
  14217. g.supportsTiles && p.start(),
  14218. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14219. o = !1);
  14220. var e = null;
  14221. if (o) {
  14222. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14223. var t = l.controls[R.PANORAMA];
  14224. a = new q(f,d.scene,d.camera,t,r),
  14225. C(d, r, g),
  14226. e = a.load(s).then(function() {
  14227. d.addComponent(a),
  14228. d.once(ee.AfterRender, function() {
  14229. ne.warn("First render after quickstart load finished.")
  14230. })
  14231. })
  14232. }
  14233. return window.flyToFirst = function() {
  14234. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14235. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14236. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14237. c.flyToPano({
  14238. pano: e,
  14239. lookAtPoint: i
  14240. })
  14241. }
  14242. ,
  14243. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14244. }).then(function() {
  14245. return function(e, t, i, n, r) {
  14246. return r.progressCallback = t,
  14247. N.sessionStart(),
  14248. e.load(n).progress(function(e, t) {
  14249. e.modelElementsToLoad = t[1],
  14250. function(e) {
  14251. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14252. }(e),
  14253. function(e) {
  14254. e.totalElementsLoaded++,
  14255. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14256. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14257. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14258. console.log("pro:" + e.totalPercentageLoaded),
  14259. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14260. }(e)
  14261. }
  14262. .bind(this, r))
  14263. }(g, D.onProgress, 0, !o, n)
  14264. }).then(function() {
  14265. s.quickstart = o,
  14266. function(e, t, i, n) {
  14267. var r = i.qualityManager
  14268. , o = i.panoRenderer
  14269. , a = i.tileDownloader
  14270. , s = i.modelManager
  14271. , l = i.player
  14272. , c = i.director
  14273. , h = i.tagManager
  14274. , u = i.displayController
  14275. , d = i.labelDisplayController
  14276. , p = i.controls;
  14277. t.scene.add(e),
  14278. t.qualityManager = r;
  14279. var f = {
  14280. camera: t.camera,
  14281. director: c,
  14282. modelManager: s,
  14283. tileDownloader: a,
  14284. panoRenderer: o,
  14285. qualityManager: r,
  14286. tagManager: h,
  14287. container: n,
  14288. controls: p
  14289. };
  14290. l.init(f),
  14291. l.setScene(t.scene),
  14292. h.init(s, l),
  14293. c.init(l, s),
  14294. u.init(c, l, s, h, n),
  14295. d.init(l, s, n),
  14296. B.bindEvents(l),
  14297. t.addComponent(h),
  14298. t.addComponent(l),
  14299. t.addComponent(o),
  14300. l.sceneRenderer = t
  14301. }(g, d, m, r),
  14302. d.started || C(d, r, g),
  14303. N.modelLoaded(g, c, l, L.autoplay),
  14304. function(e, t, i, n) {
  14305. return ne.info("Starting player in " + i.mode),
  14306. N.report(t.sid, "started-playing", n, i.quickstart),
  14307. e.start(i)
  14308. }(c, g, s, L.autoplay).done(function() {
  14309. h.autoTour()
  14310. }),
  14311. g.supportsTiles || new H(g,c).start();
  14312. o && (d.removeComponent(a),
  14313. a.destroy(),
  14314. s.pano.enter()),
  14315. D.init(g, h, c, l, d, s, N.getSessionId()),
  14316. D.endLoading(g, h, u),
  14317. d.once(ee.AfterRender, function() {
  14318. v.setAppReadyTime();
  14319. var e = v.calcFullLoadingTime();
  14320. ne.warn("Total load time: " + e / 1e3),
  14321. N.loadComplete(e),
  14322. ne.warn("First render after model load finished.");
  14323. editTool.loadDone('data', window.DATA)
  14324. }),
  14325. d.on(ee.MemoryUsageUpdated, y)
  14326. }).fail(A.bind(this, e))
  14327. }()
  14328. }()
  14329. }).fail(e=>{
  14330. alert("缺少someData文件,请检查场景码是否正确。")
  14331. })
  14332. }
  14333. ).call(this, "/js/main.js")
  14334. }
  14335. , {
  14336. "./DisplayController": 1,
  14337. "./TimingData": 2,
  14338. "./ab": 3,
  14339. "./analytics": 4,
  14340. "./cameras/PanoramaCamera": 7,
  14341. "./controls/CameraControls": 9,
  14342. "./director": 15,
  14343. "./effects": 16,
  14344. "./enum/PanoSizeClass": 36,
  14345. "./enum/PanoramaEvents": 37,
  14346. "./enum/RenderLayers": 41,
  14347. "./enum/SceneRendererEvents": 43,
  14348. "./enum/Viewmode": 51,
  14349. "./featureflags": 59,
  14350. "./gui/error": 64,
  14351. "./gui/gui": 65,
  14352. "./gui/memoryUsage": 73,
  14353. "./label/LabelDisplayController": 91,
  14354. "./lib/array-polyfill": 92,
  14355. "./lib/performance-polyfill": 95,
  14356. "./lib/postprocessing/EffectComposer.js": 96,
  14357. "./lib/postprocessing/MaskPass.js": 97,
  14358. "./lib/postprocessing/RenderPass.js": 98,
  14359. "./lib/postprocessing/ShaderPass.js": 99,
  14360. "./lib/shaders/CopyShader.js": 100,
  14361. "./lib/shaders/HorizontalBlurShader.js": 101,
  14362. "./lib/shaders/VerticalBlurShader.js": 102,
  14363. "./lib/three75-shim": 103,
  14364. "./localization/localize": 108,
  14365. "./tag/tagManager": 124,
  14366. "./model/ModelManager": 140,
  14367. "./objects/Panorama": 148,
  14368. "./objects/Skybox": 152,
  14369. "./player": 155,
  14370. "./preloaders": 156,
  14371. "./scene/QuickstartManager": 157,
  14372. "./scene/SceneRenderer": 158,
  14373. "./sdk/automation.js": 164,
  14374. "./settings": 166,
  14375. "./showcase": 168,
  14376. "./tile/PanoRenderer": 169,
  14377. "./tile/QualityManager.js": 170,
  14378. "./tile/TileDownloader": 171,
  14379. "./util/PanoramaCollection": 178,
  14380. "./util/ajax": 181,
  14381. "./util/browser": 182,
  14382. "./util/camera": 183,
  14383. "./util/common": 185,
  14384. "./util/lerp": 188,
  14385. "./util/logger": 189,
  14386. "./util/math": 190,
  14387. "./util/sentry": 192,
  14388. "./util/showcase": 193,
  14389. "./util/transitions": 195,
  14390. events: 202,
  14391. "promise-polyfill": 213,
  14392. three: 217
  14393. }],
  14394. 117: [function(e, t, i) {
  14395. "use strict";
  14396. function n(e) {
  14397. e = e || {},
  14398. r.RawShaderMaterial.call(this, a.extendObject({
  14399. fragmentShader: o.cube.fragmentShader,
  14400. vertexShader: o.cube.vertexShader,
  14401. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14402. name: "CubemapMaterial"
  14403. }, e))
  14404. }
  14405. var r = e("three")
  14406. , o = e("../shaders")
  14407. , a = e("../util/common");
  14408. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14409. t.exports = n
  14410. }
  14411. , {
  14412. "../shaders": 167,
  14413. "../util/common": 185,
  14414. three: 217
  14415. }],
  14416. 118: [function(e, t, i) {
  14417. "use strict";
  14418. function n(e) {
  14419. e = e || {},
  14420. r.RawShaderMaterial.call(this, a.extendObject({
  14421. fragmentShader: o.model.fragmentShader,
  14422. vertexShader: o.model.vertexShader,
  14423. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14424. name: "ModelTextureMaterial"
  14425. }, e))
  14426. }
  14427. var r = e("three")
  14428. , o = e("../shaders")
  14429. , a = e("../util/common");
  14430. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14431. i && (this.uniforms.progress.value = 0),
  14432. e.ensureSkyboxReadyForRender(),
  14433. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14434. this.uniforms.pano0Position.value.copy(e.position),
  14435. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14436. t.ensureSkyboxReadyForRender(),
  14437. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14438. this.uniforms.pano1Position.value.copy(t.position),
  14439. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14440. }
  14441. ,
  14442. t.exports = n
  14443. }
  14444. , {
  14445. "../shaders": 167,
  14446. "../util/common": 185,
  14447. three: 217
  14448. }],
  14449. 119: [function(m, v, e) {
  14450. (function(e) {
  14451. "use strict";
  14452. function t(e, t, i, n) {
  14453. this.div = null,
  14454. this.body = null,
  14455. this.label = e,
  14456. this.description = t,
  14457. this.parsedDescription = [],
  14458. this.media = i || {
  14459. type: null
  14460. },
  14461. this.loadingSpinner = null,
  14462. this.parser = new r({
  14463. supportLinks: !c.valueFromHash("mls"),
  14464. keepLinkLabels: !0
  14465. }),
  14466. this.state = g.CLOSED,
  14467. this.orientation = "",
  14468. this.initialTransform = "",
  14469. this.hovering = !1,
  14470. this.openTransition = null,
  14471. this.closeTransition = null,
  14472. this.openPromise = null,
  14473. this.closePromise = null,
  14474. this.animationTransition = null,
  14475. this.animationScale = 0
  14476. }
  14477. var r = m("../Parser/DescriptionParser")
  14478. , i = m("../Media/Link")
  14479. , n = m("../Media/Image")
  14480. , o = m("../Media/EmbedlyPlayer")
  14481. , a = m("../Media/EmbedlyEmbed")
  14482. , s = m("../../util/transitions")
  14483. , l = m("../../util/lerp")
  14484. , c = m("../../util/browser")
  14485. , b = m("./BillboardEvent")
  14486. , w = m("../Media/MediaEvent")
  14487. , h = m("../Parser/DescriptionChunkType")
  14488. , u = m("events").EventEmitter
  14489. , d = m("./billboardSettings")
  14490. , T = m("./overlaySettings")
  14491. , p = new (m("../../util/logger"))(e)
  14492. , f = document.getElementById("tag-billboards");
  14493. f.addEventListener("touchend", function(e) {
  14494. f.style.pointerEvents = "none"
  14495. }),
  14496. f.addEventListener("touchcancel", function(e) {
  14497. f.style.pointerEvents = "none"
  14498. });
  14499. var g = {
  14500. CLOSED: "closed",
  14501. OPENING: "opening",
  14502. OPEN: "open",
  14503. CLOSING: "closing",
  14504. ACTIVE: "active"
  14505. };
  14506. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14507. this.parsedDescription = this.parser.parse(this.description);
  14508. var t = document.createElement("div");
  14509. t.className = "tag-container has-hotzone",
  14510. this.div = t,
  14511. this.body = document.createElement("div"),
  14512. this.body.className = "tag-body";
  14513. var i = document.createElement("div");
  14514. i.classList.add("tag-content");
  14515. var n = document.createElement("div");
  14516. n.classList.add("tag-text-content");
  14517. var r = document.createElement("div");
  14518. r.className = "tag-label",
  14519. r.textContent = this.label,
  14520. n.appendChild(r);
  14521. var o = document.createElement("div");
  14522. o.className = "tag-desc",
  14523. n.appendChild(o),
  14524. i.appendChild(n),
  14525. this.body.appendChild(i),
  14526. this.appendDescriptionElements(this.parsedDescription, o),
  14527. this.appendMedia(),
  14528. t.appendChild(this.body),
  14529. f.appendChild(t),
  14530. this.bindEvents(t, this.body)
  14531. }
  14532. ,
  14533. t.prototype.bindEvents = function(i, e) {
  14534. function t(n) {
  14535. return function(e) {
  14536. if (!this.div.classList.contains("overlay")) {
  14537. var t, i = document.getElementById("player");
  14538. try {
  14539. t = new MouseEvent(n,e)
  14540. } catch (i) {
  14541. (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)
  14542. }
  14543. i.dispatchEvent(t)
  14544. }
  14545. }
  14546. }
  14547. e.addEventListener("mousedown", function(e) {
  14548. e.stopPropagation()
  14549. }),
  14550. e.addEventListener("mouseup", function(e) {
  14551. e.stopPropagation()
  14552. }),
  14553. i.addEventListener("touchstart", function(e) {
  14554. f.style.pointerEvents = "auto"
  14555. }),
  14556. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14557. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14558. e.addEventListener("mouseover", function(e) {
  14559. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14560. }
  14561. .bind(this)),
  14562. i.addEventListener("mouseenter", function(e) {
  14563. this.state !== g.CLOSING && (this.hovering = !0,
  14564. this.emit(b.ENTER))
  14565. }
  14566. .bind(this)),
  14567. i.addEventListener("mouseleave", function(e) {
  14568. this.hovering = !1,
  14569. this.emit(b.LEAVE)
  14570. }
  14571. .bind(this)),
  14572. i.addEventListener("gesturestart", function(e) {
  14573. e.preventDefault()
  14574. });
  14575. var n = i.querySelector(".tag-text-content")
  14576. , r = 0;
  14577. n.addEventListener("touchstart", function(e) {
  14578. r = e.changedTouches[0].clientY
  14579. }),
  14580. n.addEventListener("touchmove", function(t) {
  14581. function e(e) {
  14582. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14583. }
  14584. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14585. }),
  14586. i.addEventListener("touchmove", function(e) {
  14587. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14588. })
  14589. }
  14590. ,
  14591. t.prototype.appendDescriptionElements = function(e, i) {
  14592. 0 < e.length && this.div.classList.add("has-text"),
  14593. e.forEach(function(e, t) {
  14594. switch (e.type) {
  14595. case h.TEXT:
  14596. i.appendChild(this.createTextElement(e.text));
  14597. break;
  14598. case h.LINK:
  14599. i.appendChild(this.createLinkElement(e.link))
  14600. }
  14601. }
  14602. .bind(this))
  14603. }
  14604. ,
  14605. t.prototype.appendLoadingSpinner = function() {
  14606. this.loadingSpinner = document.createElement("div"),
  14607. this.loadingSpinner.classList.add("loading-spinner");
  14608. var e = document.createElement("div");
  14609. e.classList.add("gui-spinner-icon"),
  14610. this.loadingSpinner.appendChild(e),
  14611. this.body.appendChild(this.loadingSpinner)
  14612. }
  14613. ,
  14614. t.prototype.onMediaLoadFinished = function() {
  14615. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14616. this.applyOrientation(this.orientation),
  14617. this.loadingSpinner = null)
  14618. }
  14619. ,
  14620. t.prototype.appendMedia = function() {
  14621. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14622. this.appendLoadingSpinner();
  14623. var e = document.createElement("div");
  14624. e.classList.add("tag-media-content");
  14625. var t = document.createElement("i");
  14626. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14627. t.classList.add(e)
  14628. }),
  14629. this.body.appendChild(t),
  14630. this.body.appendChild(e),
  14631. this.media.type) {
  14632. case h.IMAGE:
  14633. e.appendChild(this.createImageElement(this.media, this.body));
  14634. break;
  14635. case h.VIDEO:
  14636. e.appendChild(this.createVideoElement(this.media, this.body));
  14637. break;
  14638. case h.RICH:
  14639. e.appendChild(this.createEmbedElement(this.media, this.body))
  14640. }
  14641. }
  14642. }
  14643. ,
  14644. t.prototype.createTextElement = function(e) {
  14645. var t = document.createElement("span");
  14646. return t.textContent = e,
  14647. t
  14648. }
  14649. ,
  14650. t.prototype.createLinkElement = function(e) {
  14651. var t = new i(e);
  14652. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14653. t.createDomElement()
  14654. }
  14655. ,
  14656. t.prototype.createImageElement = function(t, C) {
  14657. function e() {
  14658. function e() {
  14659. p || (E.classList.remove("view-image"),
  14660. a.classList.add("overlay"),
  14661. t(),
  14662. window.addEventListener("resize", A),
  14663. a.addEventListener("click", i),
  14664. c.addEventListener("click", r),
  14665. o.addEventListener("click", n),
  14666. p = !0,
  14667. _.emit(w.IMAGE_OPENED))
  14668. }
  14669. function t() {
  14670. C.classList.add("show-info"),
  14671. s.classList.remove("collapsible"),
  14672. s.style.height = "";
  14673. var e = parseFloat(getComputedStyle(v).lineHeight)
  14674. , t = g + e
  14675. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14676. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14677. , r = n
  14678. , o = r * I.aspect;
  14679. i < o && (r = (o = i) / I.aspect),
  14680. n < r && (o = (r = n) * I.aspect),
  14681. o += m,
  14682. r += m + t,
  14683. C.style.width = o + "px",
  14684. C.style.height = r + "px",
  14685. l.style.paddingTop = e + m + "px",
  14686. 0 < _.description.length && (s.classList.add("collapsible"),
  14687. s.style.height = s.clientHeight + 12 + "px",
  14688. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14689. }
  14690. function i(e) {
  14691. e.target === a && n()
  14692. }
  14693. function n() {
  14694. p && (p = !1,
  14695. E.classList.add("view-image"),
  14696. a.classList.remove("overlay"),
  14697. s.style.height = "",
  14698. l.style.paddingTop = "",
  14699. C.style.width = "",
  14700. C.style.height = "",
  14701. window.removeEventListener("resize", A),
  14702. a.removeEventListener("click", i),
  14703. c.removeEventListener("click", r),
  14704. o.removeEventListener("click", n),
  14705. _.emit(w.IMAGE_CLOSED),
  14706. _.close(!0))
  14707. }
  14708. function r(e) {
  14709. C.classList.toggle("show-info")
  14710. }
  14711. var a = _.div
  14712. , s = a.getElementsByClassName("tag-content")[0]
  14713. , l = a.getElementsByClassName("tag-media-content")[0]
  14714. , o = C.getElementsByClassName("close")[0]
  14715. , c = s.getElementsByClassName("tag-label")[0];
  14716. a.classList.add("has-image"),
  14717. E.classList.add("view-image"),
  14718. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14719. _.applyOrientation(_.orientation);
  14720. 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,
  14721. function() {
  14722. clearInterval(h),
  14723. clearTimeout(u),
  14724. h = setInterval(function() {
  14725. var e = a.clientHeight;
  14726. d !== e && (t(),
  14727. d = e)
  14728. }, 100),
  14729. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14730. }
  14731. );
  14732. I.on(w.IMAGE_OPENING, e),
  14733. _.on(b.ACTIVATE, e),
  14734. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14735. _.on(b.CLOSING, n)
  14736. }
  14737. var I = new n
  14738. , E = I.createDomElement();
  14739. this.once(b.OPENED, function() {
  14740. I.load(t.src).then(e).catch(function(e) {
  14741. p.warn("Failed to load image:", t.src),
  14742. p.warn("with error:", e)
  14743. }).then(this.onMediaLoadFinished.bind(this))
  14744. });
  14745. var _ = this;
  14746. return E
  14747. }
  14748. ,
  14749. t.prototype.createVideoElement = function(t, e) {
  14750. var i = new o({
  14751. autoPlay: !0,
  14752. autoResume: !0,
  14753. startMuted: !1,
  14754. loop: !1
  14755. })
  14756. , n = i.createDomElement();
  14757. return this.once(b.OPENED, function() {
  14758. i.load(t.src).then(function() {
  14759. this.div.classList.add("has-video"),
  14760. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14761. i.play()),
  14762. this.on(b.OPENING, i.show.bind(i)),
  14763. this.on(b.OPENED, i.play.bind(i)),
  14764. this.on(b.CLOSING, i.pause.bind(i)),
  14765. this.on(b.CLOSED, i.hide.bind(i))
  14766. }
  14767. .bind(this)).catch(function(e) {
  14768. p.warn("Failed to embed video:", t.src),
  14769. p.warn("with error:", e)
  14770. }).then(this.onMediaLoadFinished.bind(this))
  14771. }
  14772. .bind(this)),
  14773. n
  14774. }
  14775. ,
  14776. t.prototype.createEmbedElement = function(t, e) {
  14777. var i = new a
  14778. , n = i.createDomElement();
  14779. return this.once(b.OPENED, function() {
  14780. i.load(t.src).then(function() {
  14781. this.div.classList.add("has-embed"),
  14782. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14783. this.applyOrientation(this.orientation),
  14784. this.on(b.OPENING, i.show.bind(i)),
  14785. this.on(b.CLOSED, i.hide.bind(i))
  14786. }
  14787. .bind(this)).catch(function(e) {
  14788. p.warn("Failed to embed:", t.src),
  14789. p.warn("with error:", e)
  14790. }).then(this.onMediaLoadFinished.bind(this))
  14791. }
  14792. .bind(this)),
  14793. n
  14794. }
  14795. ,
  14796. t.prototype.open = function(e) {
  14797. return this.openPromise = $.Deferred(),
  14798. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14799. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14800. this.state !== g.OPEN && (this.emit(b.OPENING),
  14801. e && this.emit(b.ACTIVATING),
  14802. this.state = g.OPENING,
  14803. this.animateOpen(function() {
  14804. e && this.setActiveState(),
  14805. this.openPromise.resolve()
  14806. }
  14807. .bind(this)))
  14808. }
  14809. .bind(this), d.animation.openDelay),
  14810. s.cancel(this.closeTransition),
  14811. this.closePromise && this.closePromise.reject(),
  14812. this.closeTransition = void 0,
  14813. this.openPromise.promise())
  14814. }
  14815. ,
  14816. t.prototype.close = function(e) {
  14817. return this.closePromise = $.Deferred(),
  14818. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14819. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14820. this.state = g.CLOSING,
  14821. this.animateClose())
  14822. }
  14823. .bind(this), d.animation.closeDelay)),
  14824. s.cancel(this.openTransition),
  14825. this.openPromise && this.openPromise.reject(),
  14826. this.openTransition = void 0,
  14827. this.closePromise.resolve(),
  14828. this.closePromise.promise())
  14829. }
  14830. ,
  14831. t.prototype.setActiveState = function() {
  14832. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14833. this.emit(b.ACTIVATE),
  14834. this.div.classList.remove("has-hotzone"))
  14835. }
  14836. ,
  14837. t.prototype.animateOpen = function(e) {
  14838. if (this.state === g.OPENING) {
  14839. if (s.cancel(this.animationTransition),
  14840. c.detectSamsungNative())
  14841. return this.boardOrientation = null,
  14842. this.div.style.visibility = "visible",
  14843. this.emit(b.OPENED),
  14844. this.state = g.OPEN,
  14845. void (e && e());
  14846. this.div.style.webkitTransform = "scale(0)",
  14847. this.div.style.transform = "scale(0)",
  14848. this.div.style.visibility = "visible",
  14849. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14850. this.emit(b.OPENED),
  14851. this.state = g.OPEN,
  14852. e && e()
  14853. }
  14854. .bind(this))
  14855. }
  14856. }
  14857. ,
  14858. t.prototype.animateClose = function(e) {
  14859. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14860. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14861. this.emit(b.CLOSED),
  14862. this.state = g.CLOSED,
  14863. this.div.style.visibility = "hidden",
  14864. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14865. e && e()
  14866. }
  14867. .bind(this)))
  14868. }
  14869. ,
  14870. t.prototype.needsUpdate = function() {
  14871. return this.state !== g.CLOSED
  14872. }
  14873. ,
  14874. t.prototype.update = function(e, t) {
  14875. if (this.needsUpdate()) {
  14876. var i = (this.updateOrientation(e),
  14877. this.calcScale(t))
  14878. , n = {
  14879. x: (e.x + 1) * $("#player").width() / 2,
  14880. y: (e.y + 1) * $("#player").height() / 2
  14881. };
  14882. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14883. this.div.style.webkitTransform = this.div.screenTransform,
  14884. this.div.style.transform = this.div.screenTransform
  14885. }
  14886. }
  14887. ,
  14888. t.prototype.getDimensions = function() {
  14889. return this.div.getBoundingClientRect()
  14890. }
  14891. ,
  14892. t.prototype.calcScale = function(e) {
  14893. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14894. }
  14895. ,
  14896. t.prototype.updateOrientation = function(e) {
  14897. if (this.state !== g.ACTIVE) {
  14898. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14899. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14900. , n = "";
  14901. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14902. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14903. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14904. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14905. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14906. }
  14907. }
  14908. ,
  14909. t.prototype.applyOrientation = function(e) {
  14910. this.div.style.transform = this.div.style.webkitTransform = "",
  14911. this.div.classList.remove("tag-container-" + this.orientation),
  14912. this.div.classList.add("tag-container-" + e);
  14913. var t = window.getComputedStyle(this.div);
  14914. this.initialTransform = t.transform || t.webkitTransform,
  14915. "none" === this.initialTransform && (this.initialTransform = "");
  14916. var i = t.transform.slice(7, -1).split(",")
  14917. , n = -i[4]
  14918. , r = -i[5];
  14919. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14920. this.div.style.transformOrigin = n + "px " + r + "px",
  14921. this.orientation = e
  14922. }
  14923. ,
  14924. v.exports = t
  14925. }
  14926. ).call(this, "/js/tag/Billboard/Billboard.js")
  14927. }
  14928. , {
  14929. "../../util/browser": 182,
  14930. "../../util/lerp": 188,
  14931. "../../util/logger": 189,
  14932. "../../util/transitions": 195,
  14933. "../Media/EmbedlyEmbed": 125,
  14934. "../Media/EmbedlyPlayer": 126,
  14935. "../Media/Image": 128,
  14936. "../Media/Link": 129,
  14937. "../Media/MediaEvent": 131,
  14938. "../Parser/DescriptionChunkType": 133,
  14939. "../Parser/DescriptionParser": 134,
  14940. "./BillboardEvent": 120,
  14941. "./billboardSettings": 121,
  14942. "./overlaySettings": 122,
  14943. events: 202
  14944. }],
  14945. 120: [function(e, t, i) {
  14946. "use strict";
  14947. t.exports = Object.freeze({
  14948. ENTER: "billboard.enter",
  14949. LEAVE: "billboard.leave",
  14950. OPENING: "billboard.opening",
  14951. OPENED: "billboard.open",
  14952. CLOSING: "billboard.closing",
  14953. CLOSED: "billboard.closed",
  14954. ACTIVATING: "billboard.activating",
  14955. ACTIVATE: "billboard.activate"
  14956. })
  14957. }
  14958. , {}],
  14959. 121: [function(e, t, i) {
  14960. "use strict";
  14961. t.exports = Object.freeze({
  14962. animation: Object.freeze({
  14963. hoverOnClosing: !1,
  14964. openDelay: 100,
  14965. closeDelay: 50,
  14966. openDuration: 200,
  14967. closeDuration: 100
  14968. }),
  14969. boardToDiscRatio: 1.2
  14970. })
  14971. }
  14972. , {}],
  14973. 122: [function(e, t, i) {
  14974. "use strict";
  14975. t.exports = Object.freeze({
  14976. boundaryWidth: 30,
  14977. boundaryHeight: 0
  14978. })
  14979. }
  14980. , {}],
  14981. 123: [function(M, R, e) {
  14982. (function(e) {
  14983. "use strict";
  14984. function d(e, t, i) {
  14985. var n = i.version || "0";
  14986. "0" !== n && w.info("tag defined using version " + n),
  14987. this.model = e,
  14988. this.sid = t,
  14989. this.color = (new f.Color).set(i.color || o.tagDefault),
  14990. this.hoverColor = o._darken(this.color, .2),
  14991. this.floor = null,
  14992. this.floorIndex = i.floor,
  14993. this.mode = m.PANORAMA,
  14994. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  14995. this.obj3d = null,
  14996. this.disc = null,
  14997. this.materials = {
  14998. disc: null,
  14999. pole: null
  15000. },
  15001. this.position = (new f.Vector3).copy(i.position),
  15002. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15003. this.discWorldPosition = null,
  15004. this.discScale = .05,
  15005. this.poleEnabled = i.stem.enabled,
  15006. this.billboard = new r(i.label,i.description,i.media,this),
  15007. this.visibleTransition = null,
  15008. this.hoveringDisc = !1
  15009. }
  15010. 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"),
  15011. 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);
  15012. d.prototype = Object.create(b.prototype),
  15013. d.raycaster = new f.Raycaster,
  15014. d.prototype.bindEvents = function() {
  15015. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15016. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15017. }
  15018. ,
  15019. d.prototype.build = function() {
  15020. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15021. this.floor && (this.billboard.build(this.model.sid),
  15022. this.obj3d = this.buildObject3D(),
  15023. this.floor.add(this.obj3d)),
  15024. this
  15025. }
  15026. ,
  15027. d.prototype.buildObject3D = function() {
  15028. var e = new f.Object3D;
  15029. e.position.copy(this.position);
  15030. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15031. t.bg.value = x,
  15032. t.mask.value = T,
  15033. t.color.value.copy(this.color),
  15034. this.materials.disc = new f.RawShaderMaterial({
  15035. transparent: !0,
  15036. vertexShader: A.tagDisc.vertexShader,
  15037. fragmentShader: A.tagDisc.fragmentShader,
  15038. uniforms: t
  15039. }),
  15040. this.disc = new f.Mesh(S,this.materials.disc),
  15041. this.disc.layers.set(a.TAG),
  15042. this.disc.position.copy(this.discPosition),
  15043. this.disc.renderOrder = s.tagDisc;
  15044. var i = (this.disc.tag = this).buildPole();
  15045. return i.layers.set(a.TAG),
  15046. i.renderOrder = s.tagStem,
  15047. e.add(i),
  15048. e.layers.set(a.TAG),
  15049. e.add(this.disc)
  15050. }
  15051. ,
  15052. d.prototype.buildPole = function() {
  15053. var e = new f.BufferGeometry
  15054. , t = new Float32Array(6);
  15055. return t[0] = t[1] = t[2] = 0,
  15056. t[3] = this.discPosition.x,
  15057. t[4] = this.discPosition.y,
  15058. t[5] = this.discPosition.z,
  15059. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15060. this.materials.pole = new f.LineBasicMaterial({
  15061. linewidth: g.tags.pole.width,
  15062. color: g.tags.pole.color,
  15063. opacity: 0,
  15064. visible: this.poleEnabled,
  15065. transparent: !0,
  15066. depthWrite: !1
  15067. }),
  15068. new f.Line(e,this.materials.pole)
  15069. }
  15070. ,
  15071. d.prototype.setFreeState = function(e) {
  15072. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15073. this.materials.disc.uniforms.color.value = this.color
  15074. }
  15075. .bind(this))
  15076. }
  15077. ,
  15078. d.prototype.setHoverState = function(e) {
  15079. this.billboard.open(e),
  15080. this.materials.disc.uniforms.color.value = this.hoverColor
  15081. }
  15082. ,
  15083. d.prototype.hide = function(e, t) {
  15084. var i = $.Deferred();
  15085. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15086. return i.resolve().promise();
  15087. e = e || 0,
  15088. t = t || 0,
  15089. C.cancel(this.visibleTransition);
  15090. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15091. return this.visibleTransition = C.start((n = this,
  15092. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15093. o = I.property(n.materials.pole, "opacity", 0),
  15094. function(e) {
  15095. r(e),
  15096. n.materials.pole && o(e)
  15097. }
  15098. ), s * a, function() {
  15099. i.resolve()
  15100. }, l, E[g.warp.blendEasing]),
  15101. i.promise()
  15102. }
  15103. ,
  15104. d.prototype.show = function(e, t) {
  15105. var i = $.Deferred();
  15106. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15107. return i.resolve().promise();
  15108. e = e || 0,
  15109. t = t || 0,
  15110. C.cancel(this.visibleTransition);
  15111. 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;
  15112. return this.visibleTransition = C.start((n = this,
  15113. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15114. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15115. function(e) {
  15116. r(e),
  15117. n.materials.pole && o(e)
  15118. }
  15119. ), s * a, function() {
  15120. i.resolve()
  15121. }, l, E[g.warp.blendEasing]),
  15122. i.promise()
  15123. }
  15124. ,
  15125. d.prototype.closestPanoTowardTag = function(e, t) {
  15126. var i = []
  15127. , n = []
  15128. , r = this.disc.getWorldPosition();
  15129. if (e === m.PANORAMA) {
  15130. var o = t.position.clone().sub(r).normalize();
  15131. i.push(y.filters.isPanoAligned()),
  15132. i.push(y.filters.inPanoDirection(r, o, .5)),
  15133. i.push(y.filters.isNeighbourPanoTo(t)),
  15134. n.push(y.scoreFunctions.direction(r, o))
  15135. }
  15136. var a = new f.Vector3;
  15137. i.push(function(e) {
  15138. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15139. }, function(e) {
  15140. a.copy(r).sub(e.position);
  15141. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15142. , i = g.tags.navigate.tiltTolerance;
  15143. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15144. }),
  15145. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15146. var s = this.model.panos.sortByScore(i, n);
  15147. if (g.tags.navigate.lineOfSight) {
  15148. for (var l = 0; l < s.length; l++) {
  15149. var c = s[l].pano
  15150. , h = c.position.distanceTo(r);
  15151. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15152. return null;
  15153. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15154. var u = d.raycaster.intersectObjects(this.model.colliders);
  15155. if (0 === u.length || u[0].distance > h)
  15156. return c
  15157. }
  15158. return null
  15159. }
  15160. return 0 < s.length && s[0].pano
  15161. }
  15162. ,
  15163. d.prototype.examine = function(i) {
  15164. if(!player.currentPano)return;
  15165. var e = i.mode
  15166. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15167. , t = this.disc.getWorldPosition();
  15168. this.billboard.setActiveState();
  15169. var r = function() {
  15170. var e = this.billboard.getDimensions()
  15171. , t = new f.Vector3;
  15172. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15173. t.unproject(i.camera),
  15174. i.flyToPano({
  15175. pano: n,
  15176. lookAtPoint: t
  15177. })
  15178. }
  15179. .bind(this);
  15180. if (e === m.PANORAMA)
  15181. if (n !== i.currentPano) {
  15182. var o = {
  15183. pano: n,
  15184. lookAtPoint: t,
  15185. duration: null,
  15186. maxDistanceOverride: null,
  15187. skipWarpingCheck: !1
  15188. };
  15189. i.flyToPano(o, r)
  15190. } else
  15191. setTimeout(function() {
  15192. this.billboard.open().then(function() {
  15193. r()
  15194. })
  15195. }
  15196. .bind(this), 0);
  15197. else {
  15198. var a = {
  15199. pano: n
  15200. };
  15201. if (t) {
  15202. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15203. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15204. }
  15205. a.callback = r,
  15206. a.duration = 1500,
  15207. a.mode = m.PANORAMA,
  15208. i.flyToNewMode(a)
  15209. }
  15210. }
  15211. ,
  15212. d.prototype.update = (n = new f.Vector3,
  15213. function(e, t) {
  15214. this.discWorldPosition = this.disc.getWorldPosition(),
  15215. this.updateDisc(e, t),
  15216. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15217. n.z < 1 && (n.y *= -1,
  15218. this.billboard.update(n, this.getDiscRadius(n, t))))
  15219. }
  15220. ),
  15221. d.prototype.updateDisc = (l = new f.Vector3,
  15222. c = new f.Vector3,
  15223. h = new f.Vector3,
  15224. u = new f.Vector3,
  15225. p = new f.Vector3,
  15226. function(e, t) {
  15227. var i = g.tags.visibility
  15228. , n = g.tags.disc.scale
  15229. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15230. 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)),
  15231. this.obj3d.visible) {
  15232. this.disc.quaternion.copy(t.quaternion);
  15233. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15234. l.copy(this.discWorldPosition).project(t),
  15235. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15236. h.set(o / 2, 0, 0).add(c),
  15237. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15238. p.copy(u).unproject(t);
  15239. var a = p.distanceTo(this.discWorldPosition)
  15240. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15241. this.discScale = a * s,
  15242. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15243. }
  15244. }
  15245. ),
  15246. d.prototype.getDiscRadius = (i = new f.Vector3,
  15247. function(e, t) {
  15248. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15249. Math.abs(e.x - i.x) * $("#player").width()
  15250. }
  15251. ),
  15252. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15253. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15254. }
  15255. ,
  15256. d.prototype.offScreen = function(e, t) {
  15257. var i = e.getWorldPosition().project(t);
  15258. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15259. }
  15260. ,
  15261. d.viewportScale = function() {
  15262. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15263. d.viewportHeight = $("#player").height(),
  15264. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15265. d.currentViewportScale
  15266. }
  15267. ,
  15268. R.exports = d
  15269. }
  15270. ).call(this, "/js/tag/tag.js")
  15271. }
  15272. , {
  15273. "../enum/Colors": 19,
  15274. "../enum/RenderLayers": 41,
  15275. "../enum/RenderOrder": 42,
  15276. "../enum/Viewmode": 51,
  15277. "../objects/Panorama": 148,
  15278. "../settings": 166,
  15279. "../shaders": 167,
  15280. "../util/common": 185,
  15281. "../util/easing": 186,
  15282. "../util/lerp": 188,
  15283. "../util/logger": 189,
  15284. "../util/math": 190,
  15285. "../util/texture": 194,
  15286. "../util/transitions": 195,
  15287. "./Billboard/Billboard": 119,
  15288. "./Billboard/BillboardEvent": 120,
  15289. events: 202,
  15290. three: 217
  15291. }],
  15292. 124: [function(M, R, e) {
  15293. (function(e) {
  15294. "use strict";
  15295. function t() {
  15296. this.tagState = T.IDLE,
  15297. this.intersectTag = null,
  15298. this.hoveredTag = null,
  15299. this.activeTag = null,
  15300. this.tagDiscs = [],
  15301. this.raycaster = new i.Raycaster,
  15302. this.modelManager = null,
  15303. this.player = null,
  15304. this.totaltags = 0,
  15305. this.navigatingViaTag = !1,
  15306. this.enabled = !1
  15307. }
  15308. 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"),
  15309. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15310. r.extend(t, x),
  15311. t.prototype.init = function(e, t) {
  15312. this.modelManager = e,
  15313. this.player = t,
  15314. this.updateModel(),
  15315. this.bindEvents()
  15316. }
  15317. ,
  15318. t.prototype.update = function(e) {
  15319. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15320. }
  15321. ,
  15322. t.prototype.updateTags = function(e, t, i, n) {
  15323. for (var r in this.model.tags)
  15324. this.model.tags[r].update(e, t, i, n)
  15325. }
  15326. ,
  15327. t.prototype.updateModel = function() {
  15328. this.model = this.modelManager.getActiveModel(),
  15329. this.gettagsFromModel(),
  15330. this.totaltags = Object.keys(this.model.tags).length
  15331. }
  15332. ,
  15333. t.prototype.gettagsFromModel = function() {
  15334. for (var e in this.tagDiscs = [],
  15335. this.model.tags) {
  15336. var t = this.model.tags[e].disc;
  15337. t && this.tagDiscs.push(t)
  15338. }
  15339. }
  15340. ,
  15341. t.prototype.bindEvents = function() {
  15342. function e() {
  15343. Object.keys(this.model.tags).forEach(function(e) {
  15344. var t = this.model.tags[e];
  15345. t.bindEvents(),
  15346. t.billboard.on(y.LINK_CLICK, function(e) {
  15347. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15348. }
  15349. .bind(this)),
  15350. t.billboard.on(y.IMAGE_OPENED, function() {
  15351. this.tagState = T.EXAMINE,
  15352. this.emit(y.IMAGE_OPENED)
  15353. }
  15354. .bind(this)),
  15355. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15356. }
  15357. .bind(this))
  15358. }
  15359. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15360. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15361. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15362. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15363. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15364. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15365. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15366. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15367. e.call(this)
  15368. }
  15369. ,
  15370. t.prototype.navigateViaLink = function(e) {
  15371. var t = a.deserialize(e);
  15372. if (t)
  15373. if (t.mode === C.PANORAMA) {
  15374. try {
  15375. this.player.model.panos.get(t.panoId)
  15376. } catch (e) {
  15377. return void S.warn("Unable to find panorama location", t.panoId)
  15378. }
  15379. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15380. } else {
  15381. var i = {
  15382. cameraMode: t.mode,
  15383. position: t.position,
  15384. quaternion: t.quaternion,
  15385. scanId: t.panoId,
  15386. orthoZoom: t.zoom,
  15387. floorVisibility: t.floorVisibility,
  15388. thumbUrl: null,
  15389. name: null
  15390. };
  15391. this.player.flyToNewMode({
  15392. mode: t.mode,
  15393. duration: m.warp.outsideTime,
  15394. warpDest: new g(i),
  15395. force: !0
  15396. })
  15397. }
  15398. }
  15399. ,
  15400. t.prototype.handleWarpStart = function(e, t, i, n) {
  15401. this.dismissExaminedTag(),
  15402. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15403. e && (i = E.END),
  15404. this.hideShowTagsForBlackoutStyle(i, n))
  15405. }
  15406. ,
  15407. t.prototype.handleWarpInterruption = function(e, t, i) {
  15408. null != i || (i = m.warp.teleportTime),
  15409. this.hideShowTagsForBlackoutStyle(t, i)
  15410. }
  15411. ,
  15412. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15413. var i = 0
  15414. , n = 0
  15415. , r = t / 2;
  15416. switch (null != e || (e = E.MIDDLE),
  15417. e) {
  15418. case E.END:
  15419. this.hideAlltags(r);
  15420. break;
  15421. case E.BEGINNING:
  15422. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15423. break;
  15424. case E.NONE:
  15425. break;
  15426. case E.MIDDLE:
  15427. n = i = r,
  15428. this.hideAlltags(n),
  15429. setTimeout(function() {
  15430. this.showAlltags(i)
  15431. }
  15432. .bind(this), n);
  15433. break;
  15434. case E.FADEIN:
  15435. setTimeout(function() {
  15436. this.showAlltags(r)
  15437. }
  15438. .bind(this), r)
  15439. }
  15440. }
  15441. ,
  15442. t.prototype.onPlayerModeChanging = function(e, t) {
  15443. t !== C.PANORAMA && this.dismissExaminedTag(),
  15444. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15445. var i = t !== C.OUTDOOR;
  15446. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15447. }
  15448. ,
  15449. t.prototype.onPanoChange = function(e, t) {
  15450. var i = this.navigatingViaTag;
  15451. if (this.navigatingViaTag = !1,
  15452. !i) {
  15453. this.dismissExaminedTag();
  15454. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15455. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15456. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15457. }
  15458. }
  15459. ,
  15460. t.prototype.onPlayerReady = function(e, t, i) {
  15461. this.startAlltags(e, t ? i : null)
  15462. }
  15463. ,
  15464. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15465. this.updateClosestTags(e)
  15466. }
  15467. ,
  15468. t.prototype.dismissExaminedTag = function() {
  15469. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15470. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15471. this.hoveredTag = null)
  15472. }
  15473. ,
  15474. t.prototype.startAlltags = function(e, t) {
  15475. this.model.shouldShowtags = m.tags.enabled,
  15476. this.enabled = !0,
  15477. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15478. t && setTimeout(function() {
  15479. this.activateTag(this.model.getTagBySid(t))
  15480. }
  15481. .bind(this), m.tags.startup.fadeInDuration / 2))
  15482. }
  15483. ,
  15484. t.prototype.showAlltags = function(e, t, i) {
  15485. function n() {
  15486. ++o === this.totaltags && (this.model.tagsShown = !0,
  15487. r.resolve())
  15488. }
  15489. var r = $.Deferred();
  15490. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15491. return r.resolve().promise();
  15492. var o = 0;
  15493. for (var a in this.model.tags) {
  15494. this.model.tags[a].show(e, t).done(n.bind(this))
  15495. }
  15496. return r.promise()
  15497. }
  15498. ,
  15499. t.prototype.hideAlltags = function(e, t) {
  15500. function i() {
  15501. ++r === this.totaltags && (this.model.tagsShown = !1,
  15502. n.resolve())
  15503. }
  15504. var n = $.Deferred()
  15505. , r = 0;
  15506. for (var o in this.model.tags) {
  15507. var a = this.model.tags[o];
  15508. a.hide(e, t).done(i.bind(this)),
  15509. a === this.activeTag && this.dismissActiveTag()
  15510. }
  15511. return n.promise()
  15512. }
  15513. ,
  15514. t.prototype.enableHovering = function() {
  15515. this.enabled = !0
  15516. }
  15517. ,
  15518. t.prototype.disableHovering = function() {
  15519. this.enabled = !1
  15520. }
  15521. ,
  15522. t.prototype.activateTag = function(e, t) {
  15523. t = t || T.EXAMINE,
  15524. this.activeTag = e,
  15525. this.activeTag.hoveringDisc = !0,
  15526. this.activeTag.setHoverState(t === T.EXAMINE),
  15527. this.tagState = t,
  15528. this.emit(b.TagActivated, e)
  15529. }
  15530. ,
  15531. t.prototype.dismissActiveTag = function() {
  15532. this.activeTag.hoveringDisc = !1,
  15533. this.activeTag.setFreeState(!0);
  15534. var e = this.activeTag;
  15535. this.activeTag = null,
  15536. this.tagState = T.IDLE,
  15537. this.emit(b.TagDismissed, e)
  15538. }
  15539. ,
  15540. t.prototype.clickedOnTag = function(e) {
  15541. var t = function() {
  15542. this.navigatingViaTag = !0,
  15543. this.activeTag.examine(this.player),
  15544. this.emit(b.TagNavigation, this.activeTag)
  15545. }
  15546. .bind(this);
  15547. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15548. this.activeTag = this.intersectTag,
  15549. t(),
  15550. !0) : (this.dismissActiveTag(),
  15551. !1)
  15552. }
  15553. ,
  15554. t.prototype.intersecttag = (s = new i.Vector3,
  15555. l = new i.Vector3,
  15556. c = new i.Vector3,
  15557. function(e, t, i) {
  15558. if (!this.enabled)
  15559. return null;
  15560. var n = null
  15561. , r = this.tagDiscs.filter(function(e) {
  15562. return e.parent.visible
  15563. });
  15564. if (0 < r.length) {
  15565. var o = this.model.floors.reduce(function(e, t) {
  15566. return t.hidden ? e : e.concat(t.collider.children)
  15567. }, r);
  15568. s.set(e.x, e.y, -1).unproject(i),
  15569. l.set(e.x, e.y, 1).unproject(i),
  15570. c.copy(l).sub(s).normalize(),
  15571. this.raycaster.set(s, c);
  15572. var a = this.raycaster.intersectObjects(o);
  15573. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15574. }
  15575. return this.intersectTag = n,
  15576. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15577. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15578. this.hoveredTag = n
  15579. }
  15580. .bind(this)),
  15581. n.billboard.on(v.LEAVE, function() {
  15582. this.hoveredTag = null
  15583. }
  15584. .bind(this))),
  15585. this.activateTag(n, T.BROWSE))),
  15586. n
  15587. }
  15588. ),
  15589. t.prototype.rankedtagInDirection = (h = [],
  15590. u = [],
  15591. d = new i.Vector3,
  15592. p = new i.Vector3,
  15593. f = new i.Vector3,
  15594. function(e, t, i, n) {
  15595. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15596. var a = this.closesttags[o];
  15597. p.copy(a.position),
  15598. p.add(a.discPosition),
  15599. d.copy(t),
  15600. d.sub(p).negate(),
  15601. d.normalize();
  15602. var s = d.dot(n);
  15603. if (0 <= s && (f.copy(p),
  15604. f.project(i),
  15605. this.intersecttag(f, !1, i))) {
  15606. if (r >= h.length)
  15607. for (var l = 0; l < 64; l++)
  15608. h.push({
  15609. tag: a,
  15610. dot: s
  15611. });
  15612. var c = h[r];
  15613. c.tag = a,
  15614. c.dot = s,
  15615. c.position = math.projectPositionToCanvas(p, i),
  15616. u.push(c),
  15617. r++
  15618. }
  15619. }
  15620. return u.sort(function(e, t) {
  15621. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15622. }),
  15623. e < u.length ? u[e].tag : null
  15624. }
  15625. ),
  15626. t.prototype.updateClosestTags = (o = new i.Vector3,
  15627. function(e) {
  15628. this.closesttags || (this.closesttags = []),
  15629. this.closesttags.length = 0;
  15630. var t = this.model.tags;
  15631. if (t)
  15632. for (var i in t)
  15633. if (t.hasOwnProperty(i)) {
  15634. var n = t[i]
  15635. , r = n.position;
  15636. o.copy(e),
  15637. o.sub(r).negate(),
  15638. o.lengthSq() < 30 && this.closesttags.push(n)
  15639. }
  15640. }
  15641. ),
  15642. R.exports = t
  15643. }
  15644. ).call(this, "/js/tag/tagManager.js")
  15645. }
  15646. , {
  15647. "../controls/serializer": 14,
  15648. "../enum/BlackoutStyle": 18,
  15649. "../enum/tagEvents": 32,
  15650. "../enum/ModelManagerEvents": 33,
  15651. "../enum/PlayerEvents": 40,
  15652. "../enum/TagStates": 44,
  15653. "../enum/Viewmode": 51,
  15654. "../enum/WarpStyle": 52,
  15655. "../objects/Snapshot": 153,
  15656. "../settings": 166,
  15657. "../util/common": 185,
  15658. "../util/lerp": 188,
  15659. "../util/logger": 189,
  15660. "./Billboard/BillboardEvent": 120,
  15661. "./Media/LinkType": 130,
  15662. "./Media/MediaEvent": 131,
  15663. events: 202,
  15664. three: 217
  15665. }],
  15666. 125: [function(r, o, e) {
  15667. (function(e) {
  15668. "use strict";
  15669. function t() {
  15670. this.embedWrapper = null,
  15671. this.embedElement = null
  15672. }
  15673. var i = r("../../util/ajax")
  15674. , a = r("./mediaSettings")
  15675. , n = r("../../settings")
  15676. , s = new (r("../../util/logger"))(e);
  15677. t.prototype.createDomElement = function() {
  15678. return this.embedWrapper = document.createElement("div"),
  15679. this.embedWrapper.classList.add("tag-embed"),
  15680. this.embedWrapper.classList.add("hidden"),
  15681. this.embedWrapper
  15682. }
  15683. ,
  15684. t.prototype.load = function(e) {
  15685. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15686. return new Promise(function(r, o) {
  15687. i.get(t).then(function(e) {
  15688. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15689. this.embedWrapper.innerHTML = e.html;
  15690. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15691. if (this.embedWrapper.style.width = t + "px",
  15692. e.height) {
  15693. var i = e.height / e.width;
  15694. this.embedWrapper.style.height = t * i + "px"
  15695. }
  15696. this.embedElement = this.embedWrapper.firstChild;
  15697. var n = [];
  15698. try {
  15699. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15700. } catch (e) {
  15701. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15702. }
  15703. n.forEach(function(e) {
  15704. e.setAttribute("target", "_blank")
  15705. }),
  15706. this.embedElement.classList.add("hidden"),
  15707. this.embedWrapper.classList.remove("hidden"),
  15708. r()
  15709. } else
  15710. o("Not a valid embed")
  15711. }
  15712. .bind(this), function(e) {
  15713. o(e.response)
  15714. })
  15715. }
  15716. .bind(this))
  15717. }
  15718. ,
  15719. t.prototype.show = function() {
  15720. this.embedElement && this.embedElement.classList.remove("hidden")
  15721. }
  15722. ,
  15723. t.prototype.hide = function() {
  15724. this.embedElement && this.embedElement.classList.add("hidden")
  15725. }
  15726. ,
  15727. o.exports = t
  15728. }
  15729. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15730. }
  15731. , {
  15732. "../../settings": 166,
  15733. "../../util/ajax": 181,
  15734. "../../util/logger": 189,
  15735. "./mediaSettings": 132
  15736. }],
  15737. 126: [function(a, s, e) {
  15738. (function(e) {
  15739. "use strict";
  15740. function t(e) {
  15741. r.call(this),
  15742. this.options = e,
  15743. this.playerControls = null,
  15744. this.state = o.NOT_READY
  15745. }
  15746. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15747. Object.freeze({
  15748. NOT_READY: "player.not.ready",
  15749. CUED: "player.cued",
  15750. PLAYING: "player.playing",
  15751. PAUSED: "player.paused"
  15752. }));
  15753. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15754. return this.embedWrapper = document.createElement("div"),
  15755. this.embedWrapper.classList.add("tag-video"),
  15756. this.embedWrapper.classList.add("hidden"),
  15757. this.embedWrapper
  15758. }
  15759. ,
  15760. t.prototype.load = function(e) {
  15761. var t = function() {
  15762. function e(e) {
  15763. this.playerState = e
  15764. }
  15765. this.playerControls = new playerjs.Player(this.embedElement),
  15766. this.playerControls.on("ready", function(e) {
  15767. this.playerState = o.CUED,
  15768. this.options.startMuted && this.playerControls.mute()
  15769. }
  15770. .bind(this)),
  15771. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15772. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15773. this.playerControls.on("ended", function(e) {
  15774. this.playerControls.setCurrentTime(0),
  15775. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15776. }
  15777. .bind(this))
  15778. }
  15779. .bind(this);
  15780. return r.prototype.load.call(this, e).then(t.bind(this))
  15781. }
  15782. ,
  15783. t.prototype.play = (i = n.isMobile(),
  15784. function() {
  15785. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15786. }
  15787. ),
  15788. t.prototype.pause = function() {
  15789. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15790. }
  15791. ,
  15792. s.exports = t
  15793. }
  15794. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15795. }
  15796. , {
  15797. "../../util/browser": 182,
  15798. "../../util/logger": 189,
  15799. "./EmbedlyEmbed": 125
  15800. }],
  15801. 127: [function(t, i, e) {
  15802. (function(e) {
  15803. "use strict";
  15804. var r = t("../../util/ajax")
  15805. , o = new (t("./mediaSettings"),
  15806. t("../../util/logger"))(e)
  15807. , a = Promise.resolve();
  15808. i.exports.enqueue = function(i) {
  15809. function n() {}
  15810. return a = new Promise(function(e, t) {
  15811. a.catch(n).then(function() {
  15812. (o.debug("requesting file from embedly:", i.href),
  15813. r.get(i.href, {
  15814. responseType: i.responseType
  15815. }).then(function(e) {
  15816. return o.debug("requesting file finished:", i.href),
  15817. e
  15818. })).then(e, t)
  15819. })
  15820. }
  15821. )
  15822. }
  15823. }
  15824. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15825. }
  15826. , {
  15827. "../../util/ajax": 181,
  15828. "../../util/logger": 189,
  15829. "./mediaSettings": 132
  15830. }],
  15831. 128: [function(s, l, e) {
  15832. (function(e) {
  15833. "use strict";
  15834. function t() {
  15835. this.imageWrapper = null,
  15836. this.width = 0,
  15837. this.height = 0,
  15838. this.aspect = 1
  15839. }
  15840. var i = s("./MediaEvent")
  15841. , n = s("./EmbedlyQueue")
  15842. , r = s("events").EventEmitter
  15843. , o = s("../../util/logger")
  15844. , a = s("../../settings");
  15845. new o(e),
  15846. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15847. return this.imageWrapper = document.createElement("div"),
  15848. this.imageWrapper.classList.add("tag-image"),
  15849. this.imageWrapper.classList.add("hidden"),
  15850. this.imageWrapper.addEventListener("click", function(e) {
  15851. e.stopPropagation(),
  15852. this.emit(i.IMAGE_OPENING),
  15853. this.imageWrapper.style.pointerEvents = "none"
  15854. }
  15855. .bind(this)),
  15856. this.imageWrapper
  15857. }
  15858. ,
  15859. t.prototype.onClosed = function() {
  15860. this.imageWrapper.style.pointerEvents = "auto"
  15861. }
  15862. ,
  15863. t.prototype.load = function(e) {
  15864. var t = Math.max(window.screen.height, window.screen.width)
  15865. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15866. return new Promise(function(o, e) {
  15867. n.enqueue({
  15868. href: i,
  15869. responseType: "arraybuffer"
  15870. }).then(function(e) {
  15871. var t = new Uint8Array(e)
  15872. , i = new Blob([t])
  15873. , n = new window.Image;
  15874. n.addEventListener("load", function(e) {
  15875. var t = e.target;
  15876. this.width = t.naturalWidth,
  15877. this.height = t.naturalHeight,
  15878. this.aspect = this.width / this.height;
  15879. var i = e.target.src;
  15880. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15881. this.imageWrapper.style.width = this.width + "px",
  15882. this.imageWrapper.style.height = this.height + "px",
  15883. this.imageWrapper.classList.remove("hidden"),
  15884. o()
  15885. }
  15886. .bind(this));
  15887. var r = URL.createObjectURL(i);
  15888. n.src = r
  15889. }
  15890. .bind(this), e)
  15891. }
  15892. .bind(this))
  15893. }
  15894. ,
  15895. l.exports = t
  15896. }
  15897. ).call(this, "/js/tag/Media/Image.js")
  15898. }
  15899. , {
  15900. "../../settings": 166,
  15901. "../../util/logger": 189,
  15902. "./EmbedlyQueue": 127,
  15903. "./MediaEvent": 131,
  15904. events: 202
  15905. }],
  15906. 129: [function(e, t, i) {
  15907. "use strict";
  15908. function n(e) {
  15909. this.label = e.label,
  15910. this.href = e.url,
  15911. this.type = this.updateLinkForType(),
  15912. this.domElement = null,
  15913. this.id = c++
  15914. }
  15915. var r = e("./LinkType")
  15916. , o = e("./MediaEvent")
  15917. , a = e("../../util/browser")
  15918. , s = e("../../analytics")
  15919. , l = e("events").EventEmitter
  15920. , c = 0;
  15921. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15922. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15923. 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,
  15924. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15925. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15926. r.MODEL) : r.EXT_LINK
  15927. }
  15928. ;
  15929. var h = {};
  15930. n.prototype.createDomElement = function() {
  15931. if (this.domElement = document.createElement("a"),
  15932. this.domElement.classList.add("tag-link"),
  15933. this.domElement.textContent = this.label,
  15934. this.type === r.EXT_LINK) {
  15935. this.domElement.textContent += " ";
  15936. var e = document.createElement("i");
  15937. e.classList.add("icon-ext-link"),
  15938. e.title = "Link to external web site",
  15939. this.domElement.appendChild(e)
  15940. }
  15941. return this.domElement.addEventListener("click", function(e) {
  15942. switch (e.stopPropagation(),
  15943. h[this.id] = !0,
  15944. s.trackAlways("click_tag_link", {
  15945. link_type: this.type,
  15946. link_count: c,
  15947. links_clicked: Object.keys(h).length
  15948. }),
  15949. this.type) {
  15950. case r.MODEL:
  15951. window.location.replace(this.href);
  15952. break;
  15953. case r.EXT_LINK:
  15954. window.open(this.href, "_blank")
  15955. }
  15956. this.emit(o.LINK_CLICK, {
  15957. type: this.type,
  15958. url: this.href
  15959. })
  15960. }
  15961. .bind(this)),
  15962. this.domElement
  15963. }
  15964. ,
  15965. t.exports = n
  15966. }
  15967. , {
  15968. "../../analytics": 4,
  15969. "../../util/browser": 182,
  15970. "./LinkType": 130,
  15971. "./MediaEvent": 131,
  15972. events: 202
  15973. }],
  15974. 130: [function(e, t, i) {
  15975. "use strict";
  15976. t.exports = {
  15977. NAVIGATION: "navigation",
  15978. MODEL: "model",
  15979. EXT_LINK: "ext-link"
  15980. }
  15981. }
  15982. , {}],
  15983. 131: [function(e, t, i) {
  15984. "use strict";
  15985. t.exports = Object.freeze({
  15986. LINK_CLICK: "mtmedia.link",
  15987. IMAGE_LOADED: "mtmedia.image.loaded",
  15988. IMAGE_OPENING: "mtmedia.image.opening",
  15989. IMAGE_OPENED: "mtmedia.image.opened",
  15990. IMAGE_CLOSING: "mtmedia.image.closing",
  15991. IMAGE_CLOSED: "mtmedia.image.closed",
  15992. VIDEO_START: "mtmedia.video.start",
  15993. VIDEO_PAUSE: "mtmedia.video.pause",
  15994. VIDEO_ENDED: "mtmedia.video.end"
  15995. })
  15996. }
  15997. , {}],
  15998. 132: [function(e, t, i) {
  15999. "use strict";
  16000. t.exports = Object.freeze({
  16001. maxEmbedWidth: 350,
  16002. defaultAspectRatio: .75
  16003. })
  16004. }
  16005. , {}],
  16006. 133: [function(e, t, i) {
  16007. "use strict";
  16008. t.exports = Object.freeze({
  16009. TEXT: "text",
  16010. LINK: "link",
  16011. IMAGE: "photo",
  16012. VIDEO: "video",
  16013. RICH: "rich"
  16014. })
  16015. }
  16016. , {}],
  16017. 134: [function(e, t, i) {
  16018. "use strict";
  16019. function n(e) {
  16020. this.capabilities = {
  16021. links: {
  16022. enable: e.supportLinks,
  16023. keepLabels: e.keepLinkLabels
  16024. }
  16025. }
  16026. }
  16027. var r = e("./DescriptionChunkType");
  16028. n.prototype.parse = function(e, i) {
  16029. var n = [];
  16030. return e.split("[").map(function(e, t) {
  16031. return 0 === t ? e : "[" + e
  16032. }).forEach(function(e) {
  16033. var t = this.findMarkdown(e);
  16034. if (t) {
  16035. if (-1 !== t.url.indexOf("javascript:"))
  16036. return;
  16037. this.addLinkChunk(n, t, i),
  16038. this.addTextChunk(n, e.slice(t.markdown.length))
  16039. } else
  16040. this.addTextChunk(n, e)
  16041. }
  16042. .bind(this)),
  16043. n
  16044. }
  16045. ,
  16046. n.prototype.findMarkdown = function(e) {
  16047. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16048. if (t) {
  16049. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16050. 0 !== n); )
  16051. r++;
  16052. var o = i.length - r;
  16053. return {
  16054. markdown: t[0].substring(0, t[0].length - o),
  16055. label: t[1],
  16056. url: t[2].substring(0, r)
  16057. }
  16058. }
  16059. }
  16060. ,
  16061. n.prototype.addTextChunk = function(e, t) {
  16062. 0 !== t.length && e.push({
  16063. type: r.TEXT,
  16064. text: t
  16065. })
  16066. }
  16067. ,
  16068. n.prototype.addLinkChunk = function(e, t) {
  16069. if (this.capabilities.links.enable) {
  16070. var i = {
  16071. label: t.label,
  16072. url: t.url
  16073. };
  16074. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16075. e.push({
  16076. type: r.LINK,
  16077. link: i
  16078. })
  16079. } else
  16080. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16081. }
  16082. ,
  16083. t.exports = n
  16084. }
  16085. , {
  16086. "./DescriptionChunkType": 133
  16087. }],
  16088. 135: [function(t, r, e) {
  16089. (function(e) {
  16090. "use strict";
  16091. var i = new (t("../util/logger"))(e)
  16092. , n = {
  16093. parseIdsFromChunkName: function(e, t) {
  16094. t.floorId = n.parseFloor(e),
  16095. t.roomId = n.parseRoom(e)
  16096. },
  16097. parseFloor: function(e) {
  16098. var t = e.match(/_group([0-9]+)/);
  16099. if (!t)
  16100. return 0;
  16101. try {
  16102. return parseInt(t[1], 10)
  16103. } catch (e) {
  16104. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16105. 0
  16106. }
  16107. },
  16108. parseRoom: function(e) {
  16109. var t = e.match(/_sub([0-9]+)/);
  16110. if (!t)
  16111. return -1;
  16112. try {
  16113. return parseInt(t[1], 10)
  16114. } catch (e) {
  16115. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16116. 0
  16117. }
  16118. }
  16119. };
  16120. r.exports = n
  16121. }
  16122. ).call(this, "/js/model/Chunks.js")
  16123. }
  16124. , {
  16125. "../util/logger": 189
  16126. }],
  16127. 136: [function(a, c, e) {
  16128. (function(e) {
  16129. "use strict";
  16130. function t(e) {
  16131. r.call(this),
  16132. this.model = e,
  16133. this.exploded = !1
  16134. }
  16135. var i = a("../objects/Floor")
  16136. , n = (a("../settings"),
  16137. a("../util/logger"))
  16138. , s = a("../util/transitions")
  16139. , r = a("../util/IndexedCollection")
  16140. , o = a("../util/common")
  16141. , l = a("../util/easing");
  16142. new n(e),
  16143. o.inherit(t, r),
  16144. t.prototype.add = function(e) {
  16145. r.prototype.add.call(this, e),
  16146. this.model.add(e)
  16147. }
  16148. ,
  16149. t.prototype.getIndex = function(e) {
  16150. return e.floorIndex
  16151. }
  16152. ,
  16153. t.prototype.build = function() {
  16154. this.list.forEach(function(e) {
  16155. e.build()
  16156. })
  16157. }
  16158. ,
  16159. t.prototype.size = function() {
  16160. return this.length
  16161. }
  16162. ,
  16163. t.prototype.sort = function() {
  16164. r.prototype.sort.call(this, function(e, t) {
  16165. return e.floorIndex - t.floorIndex
  16166. })
  16167. }
  16168. ,
  16169. t.prototype.nextFloor = function(e, t) {
  16170. return this.index[e.floorIndex + t] || null
  16171. }
  16172. ,
  16173. t.prototype.getFloorAtPoint = function(e) {
  16174. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16175. var r = this.list[n]
  16176. , o = r.distanceToPoint(e);
  16177. (!t || o < i) && (i = o,
  16178. t = r)
  16179. }
  16180. return t
  16181. }
  16182. ,
  16183. t.prototype.getOrMakeFloor = function(e) {
  16184. var t = this.index[e];
  16185. return t || (t = new i(this.model,e),
  16186. this.add(t)),
  16187. t
  16188. }
  16189. ,
  16190. t.prototype.hide = function() {
  16191. this.list.forEach(function(e) {
  16192. e.hide()
  16193. })
  16194. }
  16195. ,
  16196. t.prototype.show = function() {
  16197. this.list.forEach(function(e) {
  16198. e.show()
  16199. })
  16200. }
  16201. ,
  16202. t.prototype.names = function() {
  16203. return this.list.reduce(function(e, t) {
  16204. return e.concat(t.name)
  16205. }, [])
  16206. }
  16207. ,
  16208. t.prototype.toggleExplodeHorizontal = function() {
  16209. function i(e, t) {
  16210. a.copy(e.position),
  16211. e.position.x = r[e.floorIndex] * t,
  16212. e.position.y = 1 * e.floorIndex * t,
  16213. a.sub(e.position).multiplyScalar(-1),
  16214. e.panos.forEach(function(e) {
  16215. e.translate(a)
  16216. })
  16217. }
  16218. var n, r = [], o = 0;
  16219. this.list.forEach(function(e, t, i) {
  16220. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16221. o += n,
  16222. r[t] = o
  16223. }),
  16224. r = r.map(function(e) {
  16225. return e - o / 2
  16226. });
  16227. var a = this.list[0].position.clone();
  16228. this.exploded ? this.list.forEach(function(t) {
  16229. s.start(function(e) {
  16230. i(t, 1 - e)
  16231. }, 1500, null, 0, l.easeOutExpo)
  16232. }) : this.list.forEach(function(t) {
  16233. s.start(function(e) {
  16234. i(t, e)
  16235. }, 1500, null, 0, l.easeOutExpo)
  16236. }),
  16237. this.exploded = !this.exploded
  16238. }
  16239. ,
  16240. t.prototype.toggleExplodeVertical = function() {
  16241. function i(e, t) {
  16242. var i = i.copy(e.position);
  16243. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16244. i.sub(e.position).multiplyScalar(-1),
  16245. e.panos.forEach(function(e) {
  16246. e.translate(i)
  16247. })
  16248. }
  16249. var n = this.model.size;
  16250. this.list[0].position.clone(),
  16251. this.exploded ? this.list.forEach(function(t) {
  16252. s.start(function(e) {
  16253. i(t, 1 - e)
  16254. }, 1500, null, 0, l.easeOutExpo)
  16255. }) : this.list.forEach(function(t) {
  16256. s.start(function(e) {
  16257. i(t, e)
  16258. }, 1500, null, 0, l.easeOutExpo)
  16259. }),
  16260. this.exploded = !this.exploded
  16261. }
  16262. ,
  16263. c.exports = t
  16264. }
  16265. ).call(this, "/js/model/FloorCollection.js")
  16266. }
  16267. , {
  16268. "../objects/Floor": 146,
  16269. "../settings": 166,
  16270. "../util/IndexedCollection": 175,
  16271. "../util/common": 185,
  16272. "../util/easing": 186,
  16273. "../util/logger": 189,
  16274. "../util/transitions": 195
  16275. }],
  16276. 137: [function(r, o, e) {
  16277. (function(e) {
  16278. "use strict";
  16279. function h() {
  16280. n.call(this)
  16281. }
  16282. var u = r("../settings")
  16283. , t = r("../util/logger")
  16284. , d = r("../enum/Viewmode")
  16285. , p = r("../objects/Snapshot")
  16286. , i = (r("../util/math"),
  16287. r("../util/common"))
  16288. , n = r("../util/IndexedCollection")
  16289. , l = new t(e);
  16290. i.inherit(h, n),
  16291. h.prototype.getImage = function(e) {
  16292. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16293. }
  16294. ,
  16295. h.prototype.filterByModesAndReel = function(e, t) {
  16296. for (var i = [], n = 0; n < t.length; n += 1) {
  16297. var r = t[n]
  16298. , o = this.index[r.sid];
  16299. o && i.push(o)
  16300. }
  16301. var a = e[d.DOLLHOUSE]
  16302. , s = e[d.FLOORPLAN];
  16303. (i = i.filter(function(e) {
  16304. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16305. return !0;
  16306. var t;
  16307. try {
  16308. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16309. } catch (e) {
  16310. return l.debug(e.message),
  16311. !1
  16312. }
  16313. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16314. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16315. this.list = i,
  16316. this.reIndex()
  16317. }
  16318. ,
  16319. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16320. if (0 === this.list.length)
  16321. return [];
  16322. var locations = [];
  16323. var deal = (n, container)=>{
  16324. var r = n.thumbnail_signed_src,
  16325. o = n.name || "";
  16326. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16327. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16328. var a = panos.get(n.metadata.scan_id);
  16329. if (a && !a.isAligned()) return
  16330. }
  16331. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16332. if (s === d.MESH) return
  16333. if(window.isLocal)var src = manage.dealURL(r)
  16334. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16335. var l = {
  16336. cameraMode: s,
  16337. position: n.metadata.camera_position,
  16338. quaternion: n.metadata.camera_quaternion,
  16339. zoom: n.metadata.zoom,
  16340. panoId: n.metadata.scan_id,
  16341. orthoZoom: n.metadata.ortho_zoom,
  16342. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16343. thumbUrl: src,
  16344. name: h.filterImageName(o),
  16345. sid: n.sid
  16346. }
  16347. var item = new p(l);
  16348. item.momentTour = n.momentTour
  16349. item.dontRot = n.dontRot
  16350. item.rotTime = n.rotTime
  16351. container.push(item)
  16352. return item
  16353. }
  16354. }
  16355. this.list.forEach(image=>{
  16356. if(image.images){
  16357. var folder = $.extend({}, image )
  16358. folder.heroLocations = [];
  16359. image.images.list.forEach(child=>{
  16360. deal(child, folder.heroLocations);
  16361. })
  16362. folder.musicInfo = folder.musicInfo || {}
  16363. locations.push(folder)
  16364. delete folder.images;
  16365. delete folder.locations;
  16366. }else{
  16367. var item = deal(image, locations);
  16368. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16369. }
  16370. })
  16371. return locations
  16372. }
  16373. ,
  16374. h.prototype.getIndex = function(e) {
  16375. return e.sid
  16376. }
  16377. ,
  16378. h.filterImageName = function(e) {
  16379. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16380. }
  16381. ,
  16382. o.exports = h
  16383. }
  16384. ).call(this, "/js/model/ImageCollection.js")
  16385. }
  16386. , {
  16387. "../enum/Viewmode": 51,
  16388. "../objects/Snapshot": 153,
  16389. "../settings": 166,
  16390. "../util/IndexedCollection": 175,
  16391. "../util/common": 185,
  16392. "../util/logger": 189,
  16393. "../util/math": 190
  16394. }],
  16395. 138: [function(h, u, e) {
  16396. (function(e) {
  16397. "use strict";
  16398. function n() {
  16399. c.call(this)
  16400. }
  16401. var r = h("../label/Label")
  16402. , i = h("../settings")
  16403. , t = h("../util/logger")
  16404. , o = h("../util/math")
  16405. , a = h("../util/ajax")
  16406. , s = h("./RoomCollection")
  16407. , l = h("../util/common")
  16408. , c = h("../util/IndexedCollection");
  16409. new t(e),
  16410. l.inherit(n, c),
  16411. n.prototype.getIndex = function(e) {
  16412. return e.labelId
  16413. }
  16414. ,
  16415. n.prototype.associateWithRooms = function(e) {
  16416. this.forEach(function(t) {
  16417. e.forEach(function(e) {
  16418. e.roomId === t.roomId && (t.room = e)
  16419. })
  16420. })
  16421. }
  16422. ,
  16423. n.prototype.createFromLabelData = function(e) {
  16424. e.forEach(function(e) {
  16425. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16426. t = s.generateRoomId(e.floorId, t);
  16427. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16428. i.position = o.convertWorkshopVector(i.position),
  16429. this.add(i),
  16430. i.build()
  16431. }
  16432. .bind(this))
  16433. }
  16434. ,
  16435. n.prototype.load = function(e, t) {
  16436. return a.get(e, {
  16437. responseType: "json",
  16438. auth: t ? i.authorizationHeader : null
  16439. }).done(function(e) {
  16440. var t = [];
  16441. for (var i in e) {
  16442. var n = e[i];
  16443. t.push(n)
  16444. }
  16445. this.createFromLabelData(t)
  16446. }
  16447. .bind(this))
  16448. }
  16449. ,
  16450. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16451. var t = -1;
  16452. if (e) {
  16453. if(typeof e == 'number'){
  16454. t = parseInt(e)
  16455. }else{
  16456. var i = e.split("_");
  16457. t = parseInt(i[0])
  16458. }
  16459. }
  16460. return t
  16461. }
  16462. ,
  16463. u.exports = n
  16464. }
  16465. ).call(this, "/js/model/LabelCollection.js")
  16466. }
  16467. , {
  16468. "../label/Label": 90,
  16469. "../settings": 166,
  16470. "../util/IndexedCollection": 175,
  16471. "../util/ajax": 181,
  16472. "../util/common": 185,
  16473. "../util/logger": 189,
  16474. "../util/math": 190,
  16475. "./RoomCollection": 141
  16476. }],
  16477. 139: [function(P, O, e) {
  16478. (function(e) {
  16479. "use strict";
  16480. function t(e, t) {
  16481. o.Object3D.call(this),
  16482. this.sid = window.number;//t.sid,
  16483. this.data = t,
  16484. this.options = e,
  16485. this.urls = new i(e.urlFiles),
  16486. this.isPublic = void 0 !== t.is_public && t.is_public,
  16487. //创建heroLocations
  16488. this.images = new E(this),
  16489. this.images.extend(t.images),
  16490. this.images.forEach((info)=>{
  16491. if(info.locations){
  16492. info.images = new E(this);
  16493. info.images.extend(info.locations)
  16494. }
  16495. })
  16496. this.heroLocations = []
  16497. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16498. this.outdoorPanoLocations = [],
  16499. this.floors = new c(this),
  16500. this.floorsEnabled = void 0 === e.floors || e.floors,
  16501. this.changingFloor = !1,
  16502. this.chunks = [],
  16503. this.panos = new g,
  16504. this.colliders = [],
  16505. this.loadPanosPromise = null,
  16506. this.loadMeshTexturesPromise = null,
  16507. this.auxDataPromise = null,
  16508. this.meshTexturesLoaded = !1,
  16509. this.meshTextures = [],
  16510. this.tags = {},
  16511. this.tagsShown = !1,
  16512. this.shouldShowtags = !1,
  16513. this.has360Views = !1,
  16514. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16515. this.supportedModes = {},
  16516. this.supportedModes[s.PANORAMA] = !0,
  16517. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16518. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16519. this.supportedModes[s.TRANSITIONING] = !0,
  16520. this.supportsTiles = this.configureTiling(),
  16521. this.supportsVR = window.DATA.supportsVR || false//!0,
  16522. this.mode = s.DOLLHOUSE,
  16523. this.size = null,
  16524. this.center = null,
  16525. this.boundingBox = new o.Box3,
  16526. this.currentFloor = null,
  16527. this.allFloorsVisible = !0,
  16528. this.projectedPano0 = null,
  16529. this.projectedPano1 = null,
  16530. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16531. this.addFloor(new r(this,t,e.trim()))
  16532. }
  16533. .bind(this)),
  16534. this.waitQueue = [],
  16535. this.on("load", function(e) {
  16536. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16537. return !e.isLoadedCallback()
  16538. }),
  16539. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16540. }
  16541. .bind(this)),
  16542. this.setupCustomProperties(),
  16543. this.hots = {}
  16544. }
  16545. var o = P("three")
  16546. , a = P("../util/ajax")
  16547. , i = P("../util/ModelUrls")
  16548. , n = P("../objects/BoundingTextureSkybox")
  16549. , s = P("../enum/Viewmode")
  16550. , l = P("../enum/RenderOrder")
  16551. , r = (P("../enum/AlignmentType"),
  16552. P("../objects/Floor"))
  16553. , c = P("./FloorCollection")
  16554. , h = P("../objects/Chunk")
  16555. , u = (P("../objects/Room"),
  16556. P("../objects/Snapshot"),
  16557. P("../label/Label"),
  16558. P("../util/math"),
  16559. P("../settings"))
  16560. , d = P("../shaders")
  16561. , p = P("../util/logger")
  16562. , f = (P("../tag/tag"),
  16563. P("../tag/tagManager"),
  16564. P("../objects/Panorama"))
  16565. , g = P("../util/PanoramaCollection")
  16566. , m = P("../loaders/ModelLoader")
  16567. , v = P("../loaders/ModelTextureLoader")
  16568. , y = P("../loaders/SweepDataLoader")
  16569. , A = P("../util/transitions")
  16570. , C = (P("../util/easing"),
  16571. P("../util/lerp"),
  16572. P("../util/common"))
  16573. , I = (P("../util/texture"),
  16574. P("./../util/browser"))
  16575. , E = P("./ImageCollection")
  16576. , _ = P("./RoomCollection")
  16577. , b = P("./LabelCollection")
  16578. , w = P("./Chunks")
  16579. , T = P("./../util/showcase")
  16580. , x = P("../exception/BasicException")
  16581. , S = (P("../constants"),
  16582. P("events").EventEmitter)
  16583. // , M = P("hot")
  16584. , R = new p(e);
  16585. t.prototype = Object.create(o.Object3D.prototype),
  16586. C.extend(t, S),
  16587. t.prototype.setupCustomProperties = function() {
  16588. var t = u.modelAlpha;
  16589. Object.defineProperty(this, "alpha", {
  16590. get: function() {
  16591. return t
  16592. },
  16593. set: function(e) {
  16594. t = e,
  16595. this.chunks.forEach(function(e) {
  16596. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16597. })
  16598. }
  16599. })
  16600. }
  16601. ,
  16602. t.prototype.configureTiling = function() {
  16603. var e = function() {
  16604. try {
  16605. var e = document.createElement("canvas")
  16606. , t = e.getContext("webgl");
  16607. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16608. } catch (e) {
  16609. return 0
  16610. }
  16611. }();
  16612. if (e < 2048)
  16613. return !1;
  16614. R.warn("Max cube texture size: " + e);
  16615. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16616. var i = u.tiling.tilingFlagNames[t];
  16617. if ("1" === I.valueFromHash(i, null))
  16618. return !0;
  16619. if ("0" === I.valueFromHash(i, null))
  16620. return !1
  16621. }
  16622. return !!T.modelDataPromisesTiles(this.data)
  16623. }
  16624. ,
  16625. t.prototype.toggleAlpha = function() {
  16626. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16627. }
  16628. ,
  16629. t.prototype.load = function(e) {
  16630. var t = this.urls.init().then(function() {
  16631. return $.when(this.loadPanos(), this.loadMesh())
  16632. }
  16633. .bind(this));
  16634. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16635. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16636. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16637. }
  16638. ,
  16639. t.prototype.loadMesh = function() {
  16640. var n = $.Deferred()
  16641. , r = this;
  16642. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16643. if (0 === e.length) {
  16644. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16645. r.supportedModes[s.DOLLHOUSE] = !1,
  16646. r.supportedModes[s.FLOORPLAN] = !1;
  16647. var i = new h({
  16648. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16649. });
  16650. i.material.visible = !1,
  16651. i.rotateX(-Math.PI / 2),
  16652. i.geometry.computeBoundingBox(),
  16653. e = [i]
  16654. }
  16655. e.forEach(function(e) {
  16656. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16657. r.addChunk(t, e)
  16658. }),
  16659. r.floors.sort(),
  16660. n.resolve(r)
  16661. }, function(e, t) {
  16662. n.notify(e, t)
  16663. }, function(e) {
  16664. R.error(e),
  16665. n.reject("loading-failed")
  16666. }),
  16667. n.promise()
  16668. }
  16669. ,
  16670. t.prototype.loadMeshTextures = function() {
  16671. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16672. this.meshTexturesLoaded = !0
  16673. }
  16674. .bind(this))),
  16675. this.loadTexturesPromise
  16676. }
  16677. ,
  16678. t.prototype.loadhots = function() {
  16679. initHot(this)
  16680. var r = $.Deferred()
  16681. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16682. return a.get(e, {
  16683. responseType: "json",
  16684. auth: this.isPublic ? null : u.authorizationHeader
  16685. }).done(function(e) {
  16686. window.data2 = e;
  16687. this.roomLabels = []
  16688. editTool.loadDone('data2', e)
  16689. if(!e){
  16690. console.error("data2 is null")
  16691. }else{
  16692. g_data2 = hotMatcher(e)
  16693. this.hotsCount = 0;
  16694. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16695. //window.hotData = {}
  16696. /* if(e.hots){
  16697. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16698. sids.forEach((sid)=>{
  16699. this.hotsCount++,
  16700. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16701. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16702. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16703. window.hotData[sid] = e.hots[sid];
  16704. })
  16705. }*/
  16706. if(e.hots){
  16707. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16708. sids.forEach((sid)=>{
  16709. e.hots[sid].sid = sid
  16710. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  16711. })
  16712. }
  16713. if(e.overlays){
  16714. e.overlays.forEach((info)=>{
  16715. new Hot(info, 'byOverlay')
  16716. })
  16717. }
  16718. Hot.createHotList();
  16719. if(DATA.roomLabels){
  16720. DATA.roomLabels.forEach((data)=>{
  16721. this.roomLabels.push(new RoomLabel(data))
  16722. })
  16723. }
  16724. /* if(e.multiOverlays){
  16725. e.multiOverlays.forEach((info)=>{
  16726. new Hot(info)
  16727. })
  16728. }) */
  16729. Hot.startLoad()
  16730. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16731. }
  16732. r.resolve()
  16733. }
  16734. .bind(this)).fail(function() {
  16735. console.log("没有热点"),
  16736. editTool.loadDone('data2', null)
  16737. r.resolve()
  16738. }),
  16739. r
  16740. }
  16741. ,
  16742. t.prototype.loadPanos = function() {
  16743. if (this.loadPanosPromise)
  16744. return this.loadPanosPromise;
  16745. var e = new y(this);
  16746. return this.loadPanosPromise = e.load().then(function(e) {
  16747. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  16748. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16749. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16750. else console.log(e.uuid)
  16751. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16752. }
  16753. .bind(this))),
  16754. this.panos.extend(e.map(function(e) {
  16755. return new f(this,e.uuid,e,this.supportsTiles)
  16756. }
  16757. .bind(this))),
  16758. this.panos.forEach(function(i) {
  16759. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16760. var t = this.panos.get(e);
  16761. t && this.panos.setNeighbour(i, t, !0)
  16762. }
  16763. .bind(this)),
  16764. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16765. }
  16766. .bind(this)),
  16767. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16768. this.supportedModes[s.PANORAMA] = !1),
  16769. $.when(this)
  16770. }
  16771. .bind(this)),
  16772. this.loadPanosPromise
  16773. }
  16774. ,
  16775. t.prototype.loadHighlightReel = function() {
  16776. var t = $.Deferred()
  16777. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16778. return a.get(e, {
  16779. responseType: "json",
  16780. auth: this.isPublic ? null : u.authorizationHeader
  16781. }).done(function(e) {
  16782. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16783. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16784. t.resolve()
  16785. }
  16786. .bind(this)).fail(function() {
  16787. R.warn("Getting highlight reel failed, no highlights available"),
  16788. t.resolve()
  16789. }),
  16790. t
  16791. }
  16792. ,
  16793. t.prototype.waitForLoad = function(e, t) {
  16794. t() || (this.waitQueue.push({
  16795. object: e,
  16796. isLoadedCallback: t
  16797. }),
  16798. 1 === this.waitQueue.length && this.emit("waiting"))
  16799. }
  16800. ,
  16801. t.prototype.hide = function() {
  16802. this.floors.hide()
  16803. }
  16804. ,
  16805. t.prototype.show = function() {
  16806. this.floors.show()
  16807. }
  16808. ,
  16809. t.prototype.floorNames = function() {
  16810. return this.floors.names()
  16811. }
  16812. ,
  16813. t.prototype.warpDestFloors = function(e, t) {
  16814. if (e && this.floors.length === e.length) {
  16815. var i = e.findIndex(function(e) {
  16816. return e
  16817. }
  16818. .bind(this));
  16819. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16820. } else
  16821. this.toggleAllFloors(!0)
  16822. }
  16823. ,
  16824. t.prototype.setFloor = function(e, t, i) {
  16825. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16826. this.allFloorsVisible = !1,
  16827. this._setFloor(e, t, i)
  16828. }
  16829. ,
  16830. t.prototype.toggleAllFloors = function(e) {
  16831. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16832. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16833. this._setFloor(this.currentFloor)
  16834. }
  16835. ,
  16836. t.prototype._setFloor = function(e, t, i) {
  16837. var n;
  16838. if (t = t || this.mode,
  16839. this.emit("floor.changed", e, t, this.currentFloor),
  16840. this.currentFloor = e,
  16841. t === s.PANORAMA) {
  16842. if (this.show(),
  16843. this.shouldShowtags && this.tagsShown)
  16844. for (n in this.tags)
  16845. this.tags[n].show(u.showFloorDuration)
  16846. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16847. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16848. }
  16849. .bind(this)),
  16850. this.shouldShowtags && this.tagsShown))
  16851. for (n in this.tags) {
  16852. var r = this.tags[n];
  16853. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16854. }
  16855. var o = this
  16856. , a = e;
  16857. A.start(function() {}, u.showFloorDelay, function() {
  16858. o.floors.forEach(function(t) {
  16859. t.chunks.forEach(function(e) {
  16860. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16861. })
  16862. })
  16863. }
  16864. .bind(this))
  16865. }
  16866. ,
  16867. t.prototype.toggleExplode = function() {
  16868. this.floors.toggleExplodeHorizontal()
  16869. }
  16870. ,
  16871. t.prototype.toggleExplodeUp = function() {
  16872. this.floors.toggleExplodeVertical()
  16873. }
  16874. ,
  16875. t.prototype.nextFloor = function(e) {
  16876. return this.floors.nextFloor(this.currentFloor, e)
  16877. }
  16878. ,
  16879. t.prototype.addFloor = function(e) {
  16880. this.floors.add(e)
  16881. }
  16882. ,
  16883. t.prototype.getFloorAtPoint = function(e) {
  16884. return this.floors.getFloorAtPoint(e)
  16885. }
  16886. ,
  16887. t.prototype.getTagBySid = function(e) {
  16888. return this.tags[e]
  16889. }
  16890. ,
  16891. t.prototype.addChunk = function(e, t) {
  16892. this.floors.getOrMakeFloor(e).addChunk(t),
  16893. this.chunks.push(t)
  16894. }
  16895. ,
  16896. t.prototype.setMode = function(t) {
  16897. if (!this.supportedModes[t])
  16898. throw new x("Mode not supported for this model: " + t);
  16899. this.mode = t
  16900. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  16901. this.chunks.forEach(function(e) {
  16902. e.setMode(t)
  16903. })
  16904. }
  16905. ,
  16906. t.prototype.build = function() {
  16907. this.heroLocations = this.images.getHeroLocations(this.panos);
  16908. var e = function() {
  16909. 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()
  16910. }
  16911. .bind(this)();
  16912. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16913. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16914. }
  16915. .bind(this)) || e,
  16916. null === this.heroImage && R.warn("No hero image defined."),
  16917. this.currentFloor = this.floors.last(),
  16918. this.floors.build(),
  16919. this.colliders = this.floors.reduce(function(e, t) {
  16920. return e.concat(t.collider.children)
  16921. }, []),
  16922. this.panos.forEach(function(e) {
  16923. e.build1(),
  16924. e.on("enter", function() {
  16925. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16926. }
  16927. .bind(this))
  16928. }
  16929. .bind(this)),
  16930. this.panos.forEach(function(e) {
  16931. e.build2()
  16932. }),
  16933. this.floors.forEach(function(e) {
  16934. this.boundingBox.union(e.boundingBox)
  16935. }
  16936. .bind(this)),
  16937. this.size = this.boundingBox.size(),
  16938. this.center = this.boundingBox.center(),
  16939. this.floors.forEach(function(e) {
  16940. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  16941. }
  16942. .bind(this)),
  16943. this.panos.populate_path_graph(),
  16944. this.skybox = new n(this.boundingBox),
  16945. this.skybox.matrixWorldNeedsUpdate = !0,
  16946. this.add(this.skybox),
  16947. setTimeout(function() {
  16948. //this.hotsCount && this.shineHots()
  16949. Hot.beginShineHot()
  16950. }
  16951. .bind(this), 1300),
  16952. this.tags)
  16953. this.tags[t].build();
  16954. //add-----
  16955. console.log('计算visiblePanos开始,可能需要一段时间')
  16956. for(let i in this.hots){
  16957. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  16958. }
  16959. console.log('计算visiblePanos完毕')
  16960. //---------
  16961. return R.debug("Done building model"),
  16962. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  16963. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  16964. this.buildRooms(),
  16965. this.labels.associateWithRooms(this.rooms),
  16966. $.when(this)
  16967. }
  16968. ,
  16969. t.prototype.loadLabels = function() {
  16970. this.labels = new b(this);
  16971. var e = $.Deferred();
  16972. window.DATA.showingLabels ? this.showingLabels = true : '';
  16973. if (!this.showingLabels)
  16974. return e.resolve();
  16975. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  16976. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  16977. R.warn("Getting labels failed, not displaying labels."),
  16978. e.resolve()
  16979. }),
  16980. e
  16981. }
  16982. ,
  16983. t.prototype.buildRooms = function() {
  16984. this.rooms = new _(this),
  16985. this.rooms.createFromChunks(this.chunks),
  16986. this.rooms.calcRoomBoundaries()
  16987. }
  16988. ,
  16989. t.prototype.updateProjectedPanos = function() {
  16990. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  16991. }
  16992. ,
  16993. t.prototype.setProjectedPanos = function(t, i, n) {
  16994. null != n || (n = !0),
  16995. n = !!n,
  16996. this.projectedPano0 = t,
  16997. this.projectedPano1 = i,
  16998. this.skybox.material.setProjectedPanos(t, i, n),
  16999. this.chunks.forEach(function(e) {
  17000. e.materialInside.setProjectedPanos(t, i, n)
  17001. })
  17002. }
  17003. ,
  17004. t.prototype.setSide = function(t) {
  17005. this.floors.forEach(function(e) {
  17006. e.collider.material.side = t
  17007. })
  17008. }
  17009. ,
  17010. t.prototype.heroCount = function() {
  17011. return this.heroLocations ? this.heroLocations.length : 0
  17012. }
  17013. ,
  17014. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17015. if (e[0] < 0)
  17016. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17017. null;
  17018. if (this.heroCount() < 1)
  17019. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17020. null;
  17021. var t = this.heroLocations[e[0]];
  17022. if(t.heroLocations && e[1]!=void 0){
  17023. t = t.heroLocations[e[1]];
  17024. }
  17025. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17026. null) : t
  17027. }
  17028. ,
  17029. t.prototype.findPanoramicHero = function() {
  17030. for (var e in this.heroLocations)
  17031. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17032. return this.heroLocations[e];
  17033. return null
  17034. }
  17035. ,
  17036. t.prototype.listImagePanos = function() {
  17037. var i = []
  17038. , n = this;
  17039. return this.images.forEach(function(e) {
  17040. if (e.metadata && e.metadata.scan_id) {
  17041. var t = n.panos.get(e.metadata.scan_id);
  17042. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17043. }
  17044. }),
  17045. i
  17046. }
  17047. ,
  17048. t.prototype.fadePanoMarkers = function(e, t) {
  17049. this.panos.fadeMarkerOpacity(e, t)
  17050. }
  17051. ,
  17052. t.prototype.setSweepVisibility = function(t) {
  17053. this.panos.forEach(function(e) {
  17054. e.marker && (e.marker.visible = t)
  17055. })
  17056. }
  17057. ,
  17058. t.prototype.outsideAllowed = function() {
  17059. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17060. }
  17061. ,
  17062. O.exports = t
  17063. }
  17064. ).call(this, "/js/model/Model.js")
  17065. }
  17066. , {
  17067. "../constants": 8,
  17068. "../enum/AlignmentType": 17,
  17069. "../enum/RenderOrder": 42,
  17070. "../enum/Viewmode": 51,
  17071. "../exception/BasicException": 55,
  17072. "../label/Label": 90,
  17073. "../loaders/ModelLoader": 105,
  17074. "../loaders/ModelTextureLoader": 106,
  17075. "../loaders/SweepDataLoader": 107,
  17076. "../tag/tag": 123,
  17077. "../tag/tagManager": 124,
  17078. "../objects/BoundingTextureSkybox": 143,
  17079. "../objects/Chunk": 144,
  17080. "../objects/Floor": 146,
  17081. "../objects/Panorama": 148,
  17082. "../objects/Room": 150,
  17083. "../objects/Snapshot": 153,
  17084. "../settings": 166,
  17085. "../shaders": 167,
  17086. "../util/ModelUrls": 177,
  17087. "../util/PanoramaCollection": 178,
  17088. "../util/ajax": 181,
  17089. "../util/common": 185,
  17090. "../util/easing": 186,
  17091. "../util/lerp": 188,
  17092. "../util/logger": 189,
  17093. "../util/math": 190,
  17094. "../util/texture": 194,
  17095. "../util/transitions": 195,
  17096. "./../util/browser": 182,
  17097. "./../util/showcase": 193,
  17098. "./Chunks": 135,
  17099. "./FloorCollection": 136,
  17100. "./ImageCollection": 137,
  17101. "./LabelCollection": 138,
  17102. "./RoomCollection": 141,
  17103. events: 202,
  17104. three: 217,
  17105. //hot: "hot"
  17106. }],
  17107. 140: [function(e, t, i) {
  17108. "use strict";
  17109. function n() {
  17110. this.modelMap = {},
  17111. this.activeModel = null,
  17112. this.modelCount = 0,
  17113. this.tileDownloader = null,
  17114. this.panoRenderer = null
  17115. }
  17116. var r = (e("three"),
  17117. e("../util/common"))
  17118. , o = e("../exception/BasicException")
  17119. , a = e("../enum/ModelManagerEvents")
  17120. , s = e("../enum/PanoRendererEvents")
  17121. , l = e("events").EventEmitter;
  17122. n.prototype.init = function(e, t, i) {
  17123. this.tileDownloader = e,
  17124. this.panoRenderer = t,
  17125. this.qualityManager = i,
  17126. this.bindEvents()
  17127. }
  17128. ,
  17129. n.prototype.bindEvents = function() {
  17130. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17131. }
  17132. ,
  17133. n.prototype.onTileRendered = function(e, t, i, n) {}
  17134. ,
  17135. n.prototype.addModel = function(e) {
  17136. this.modelMap[e.sid] = e,
  17137. 0 === this.modelCount && this.activateModel(e.sid),
  17138. this.modelCount++,
  17139. this.emit(a.ModelAdded)
  17140. }
  17141. ,
  17142. n.prototype.getModel = function(e) {
  17143. return this.modelMap[e]
  17144. }
  17145. ,
  17146. n.prototype.activateModel = function(e) {
  17147. var t = this.modelMap[e];
  17148. if (!t)
  17149. throw new o("Tried to activate invalid model!");
  17150. var i = this.activeModel;
  17151. this.activeModel = t,
  17152. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17153. this.tileDownloader.setUrls(t.urls),
  17154. t.panos.forEach(function(e) {
  17155. e.attachToPanoRenderer(this.panoRenderer),
  17156. e.tileDownloader = this.tileDownloader,
  17157. e.qualityManager = this.qualityManager
  17158. }
  17159. .bind(this)),
  17160. this.emit(a.ActiveModelChanged, {
  17161. oldModel: i,
  17162. model: t
  17163. })
  17164. }
  17165. ,
  17166. n.prototype.getActiveModel = function() {
  17167. return this.activeModel
  17168. }
  17169. ,
  17170. r.extend(n, l),
  17171. t.exports = n
  17172. }
  17173. , {
  17174. "../enum/ModelManagerEvents": 33,
  17175. "../enum/PanoRendererEvents": 35,
  17176. "../exception/BasicException": 55,
  17177. "../util/common": 185,
  17178. events: 202,
  17179. three: 217
  17180. }],
  17181. 141: [function(r, l, e) {
  17182. (function(e) {
  17183. "use strict";
  17184. function o() {
  17185. n.call(this)
  17186. }
  17187. var a = r("../objects/Room")
  17188. , t = (r("../settings"),
  17189. r("../util/logger"))
  17190. , i = (r("../util/transitions"),
  17191. r("../util/easing"),
  17192. r("../util/common"))
  17193. , n = r("../util/IndexedCollection")
  17194. , s = r("./Chunks");
  17195. new t(e),
  17196. i.inherit(o, n),
  17197. o.prototype.getIndex = function(e) {
  17198. return e.roomId
  17199. }
  17200. ,
  17201. o.prototype.calcRoomBoundaries = function() {
  17202. this.forEach(function(e) {
  17203. e.calcBoundaries()
  17204. })
  17205. }
  17206. ,
  17207. o.prototype.createFromChunks = function(e) {
  17208. var n = {
  17209. floorId: -1,
  17210. roomId: -1
  17211. }
  17212. , r = {};
  17213. e.forEach(function(e) {
  17214. s.parseIdsFromChunkName(e.name, n);
  17215. var t = r[n.roomId];
  17216. if (!t) {
  17217. var i = o.generateRoomId(n.floorId, n.roomId);
  17218. t = new a(n.floorId,i),
  17219. this.add(t),
  17220. r[n.roomId] = t
  17221. }
  17222. t.addChunk(e)
  17223. }
  17224. .bind(this)),
  17225. this.calcRoomBoundaries()
  17226. }
  17227. ,
  17228. o.generateRoomId = function(e, t) {
  17229. return e + "_" + t
  17230. }
  17231. ,
  17232. l.exports = o
  17233. }
  17234. ).call(this, "/js/model/RoomCollection.js")
  17235. }
  17236. , {
  17237. "../objects/Room": 150,
  17238. "../settings": 166,
  17239. "../util/IndexedCollection": 175,
  17240. "../util/common": 185,
  17241. "../util/easing": 186,
  17242. "../util/logger": 189,
  17243. "../util/transitions": 195,
  17244. "./Chunks": 135
  17245. }],
  17246. 142: [function(e, t, i) {
  17247. "use strict";
  17248. function n(e, t, i) {
  17249. var n = (e = e.clone().expandByScalar(0.01)).size()
  17250. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17251. r.boundingBox = e,
  17252. o.Mesh.call(this, r, t),
  17253. this.position.copy(e.center()),
  17254. this.frustumCulled = !1,
  17255. i && this.add(new o.WireframeHelper(this))
  17256. }
  17257. var o = e("three");
  17258. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17259. t.exports = n
  17260. }
  17261. , {
  17262. three: 217
  17263. }],
  17264. 143: [function(l, c, e) {
  17265. (function(e) {
  17266. "use strict";
  17267. function t(e) {
  17268. s.time("Computing a nice bounding cubemap");
  17269. var t = new r({
  17270. side: i.BackSide,
  17271. transparent: !0
  17272. });
  17273. t.uniforms.modelAlpha.value = 0,
  17274. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17275. this.renderOrder = a.boundingSkybox,
  17276. n.call(this, e, t),
  17277. s.timeEnd("Computing a nice bounding cubemap")
  17278. }
  17279. var i = l("three")
  17280. , n = (l("../enum/Viewmode"),
  17281. l("../shaders"),
  17282. l("./BoundingMesh"))
  17283. , r = l("../materials/ModelTextureMaterial")
  17284. , o = l("../settings")
  17285. , a = l("../enum/RenderOrder")
  17286. , s = new (l("../util/logger"))(e);
  17287. (t.prototype = Object.create(n.prototype)).constructor = t,
  17288. c.exports = t
  17289. }
  17290. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17291. }
  17292. , {
  17293. "../enum/RenderOrder": 42,
  17294. "../enum/Viewmode": 51,
  17295. "../materials/ModelTextureMaterial": 118,
  17296. "../settings": 166,
  17297. "../shaders": 167,
  17298. "../util/logger": 189,
  17299. "./BoundingMesh": 142,
  17300. three: 217
  17301. }],
  17302. 144: [function(e, t, i) {
  17303. "use strict";
  17304. function n(e) {
  17305. this.materialInside = new s({
  17306. side: r.DoubleSide
  17307. });
  17308. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17309. this.materialOutside = new r.RawShaderMaterial({
  17310. fragmentShader: o.modelOutside.fragmentShader,
  17311. vertexShader: o.modelOutside.vertexShader,
  17312. uniforms: t,
  17313. side: r.FrontSide,
  17314. name: "chunkOut"
  17315. }),
  17316. r.Mesh.call(this, e.geometry, this.materialInside),
  17317. this.name = e.name || "",
  17318. this.textureName = e.textureName,
  17319. this.meshUrl = e.meshUrl
  17320. }
  17321. var r = e("three")
  17322. , o = e("../shaders")
  17323. , a = e("../enum/Viewmode")
  17324. , s = e("../materials/ModelTextureMaterial");
  17325. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17326. this.materialInside.uniforms.map.value = e,
  17327. this.materialOutside.uniforms.map.value = e
  17328. }
  17329. ,
  17330. n.prototype.setMode = function(e) {
  17331. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17332. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17333. t.transparent = this.material.transparent,
  17334. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17335. this.material = t
  17336. }
  17337. ,
  17338. t.exports = n
  17339. }
  17340. , {
  17341. "../enum/Viewmode": 51,
  17342. "../materials/ModelTextureMaterial": 118,
  17343. "../shaders": 167,
  17344. three: 217
  17345. }],
  17346. 145: [function(e, t, i) {
  17347. "use strict";
  17348. function n(e) {
  17349. this.chunksize = e || 10,
  17350. this.chunks = {},
  17351. this.boundingBoxes = {},
  17352. this.children = [],
  17353. this.offset = new m.Vector3(0,.5,0),
  17354. this.material = new m.MeshBasicMaterial({
  17355. color: 16777215 * Math.random(),
  17356. side: m.DoubleSide
  17357. })
  17358. }
  17359. var m = e("three");
  17360. e("../enum/Viewmode"),
  17361. n.prototype.add = function(e) {
  17362. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17363. u ? (t = u.position.array,
  17364. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17365. e.faces);
  17366. var d = new m.Vector3;
  17367. if (i)
  17368. for (n = 0,
  17369. r = i.length; n < r; n += 3) {
  17370. var p = 3 * i[n]
  17371. , f = 3 * i[n + 1]
  17372. , g = 3 * i[n + 2];
  17373. o = (t[p] + t[f] + t[g]) / 3,
  17374. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17375. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17376. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17377. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17378. this.boundingBoxes[l] = new m.Box3),
  17379. 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]),
  17380. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17381. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17382. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17383. }
  17384. else
  17385. for (n = 0,
  17386. r = t.length; n < r; n += 9)
  17387. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17388. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17389. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17390. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17391. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17392. this.boundingBoxes[l] = new m.Box3),
  17393. 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]),
  17394. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17395. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17396. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17397. }
  17398. ,
  17399. n.prototype.build = function() {
  17400. var e = new m.Object3D;
  17401. for (var t in e.material = this.material,
  17402. this.chunks) {
  17403. var i = this.chunks[t]
  17404. , n = new m.BufferGeometry;
  17405. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17406. n.boundingBox = this.boundingBoxes[t];
  17407. var r = new m.Mesh(n,this.material);
  17408. r.material.visible = !1,
  17409. e.add(r),
  17410. this.chunks[t] = []
  17411. }
  17412. return e
  17413. }
  17414. ,
  17415. t.exports = n
  17416. }
  17417. , {
  17418. "../enum/Viewmode": 51,
  17419. three: 217
  17420. }],
  17421. 146: [function(e, t, i) {
  17422. "use strict";
  17423. var n = e("three")
  17424. , r = e("../settings")
  17425. , o = e("../util/common")
  17426. , a = e("../util/lerp")
  17427. , s = e("./ChunkedCollider")
  17428. , l = e("../util/transitions")
  17429. , c = e("../util/easing")
  17430. , h = (e("../objects/Panorama"),
  17431. e("../enum/RenderOrder"));
  17432. e("../localization/localize");
  17433. function u(e, t, i) {
  17434. n.Object3D.call(this),
  17435. this.model = e,
  17436. this.floorIndex = t,
  17437. this.lang = r.languageTag,
  17438. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17439. this.panos = [],
  17440. this.chunks = [],
  17441. this.colliderBuilder = new s(3),
  17442. this.collider = null,
  17443. this.center = null,
  17444. this.boundingBox = new n.Box3,
  17445. this.size = null,
  17446. this.hidden = !1,
  17447. this.conservativeBoundingBox = new n.Box3,
  17448. this.debugColor = 16777215 * Math.random(),
  17449. this.transition = null
  17450. }
  17451. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17452. this.model.setFloor(this, e)
  17453. }
  17454. ,
  17455. u.prototype.hide = function(e) {
  17456. if (!this.hidden || this.transition) {
  17457. this.chunks.forEach(function(e) {
  17458. e.material.transparent = !0
  17459. }),
  17460. l.cancel(this.transition);
  17461. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17462. , i = e ? 0 : r.hideFloorDelay / t;
  17463. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17464. this.hidden = !0
  17465. }
  17466. .bind(this), i, c.easeInOutQuad)
  17467. }
  17468. }
  17469. ,
  17470. u.prototype.show = function(e) {
  17471. if (this.hidden || this.transition) {
  17472. this.hidden = !1,
  17473. l.cancel(this.transition);
  17474. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17475. , i = e ? 0 : r.showFloorDelay / t;
  17476. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17477. this.hidden || this.chunks.forEach(function(e) {
  17478. e.material.transparent = !1
  17479. })
  17480. }
  17481. .bind(this), i, c.easeInOutQuad)
  17482. }
  17483. }
  17484. ,
  17485. u.prototype.toggle = function(e, t) {
  17486. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17487. }
  17488. ,
  17489. u.prototype.containsPoint = function(t) {
  17490. return this.collider.children.some(function(e) {
  17491. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17492. e.geometry.boundingBox.containsPoint(t)
  17493. })
  17494. }
  17495. ,
  17496. u.prototype.distanceToPoint = function(i) {
  17497. var n = null
  17498. , r = 1 / 0;
  17499. return this.collider.children.forEach(function(e) {
  17500. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17501. var t = e.geometry.boundingBox.distanceToPoint(i);
  17502. (!n || t < r) && (r = t,
  17503. n = e)
  17504. }),
  17505. r
  17506. }
  17507. ,
  17508. u.prototype.addChunk = function(e) {
  17509. e.renderOrder = h.ghostFloor,
  17510. this.add(e),
  17511. this.chunks.push(e),
  17512. this.boundingBox.union(e.geometry.boundingBox),
  17513. this.size = this.boundingBox.size(),
  17514. this.colliderBuilder.add(e.geometry)
  17515. }
  17516. ,
  17517. u.prototype.addPano = function(e) {
  17518. this.panos.push(e),
  17519. this.add(e.skyboxMesh),
  17520. e.marker && this.add(e.marker);
  17521. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17522. var t = new n.Vector3(1,1,1)
  17523. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17524. this.boundingBox.union(i)
  17525. }
  17526. }
  17527. ,
  17528. u.prototype.build = function() {
  17529. this.collider = this.colliderBuilder.build(!0),
  17530. this.add(this.collider),
  17531. this.center = this.boundingBox.center(),
  17532. this.conservativeBoundingBox.copy(this.boundingBox),
  17533. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17534. return e.geometry.boundingBox.min.y
  17535. }), 5),
  17536. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17537. return e.geometry.boundingBox.max.y
  17538. }), 5),
  17539. this.colliderBuilder = null
  17540. }
  17541. ,
  17542. u.prototype.toShortString = function() {
  17543. return o.nth(this.floorIndex + 1)
  17544. }
  17545. ,
  17546. u.prototype.toString = function() {
  17547. return this.name
  17548. }
  17549. ,
  17550. t.exports = u
  17551. }
  17552. , {
  17553. "../enum/RenderOrder": 42,
  17554. "../localization/localize": 108,
  17555. "./strings-cn-CN": 109,
  17556. "../objects/Panorama": 148,
  17557. "../settings": 166,
  17558. "../util/common": 185,
  17559. "../util/easing": 186,
  17560. "../util/lerp": 188,
  17561. "../util/transitions": 195,
  17562. "./ChunkedCollider": 145,
  17563. three: 217
  17564. }],
  17565. 147: [function(e, t, i) {
  17566. "use strict";
  17567. function n(e) {
  17568. this.player = e,
  17569. this.obj3d = null,
  17570. this.UP = new u.Vector3(0,1,0)
  17571. }
  17572. var u = e("three")
  17573. , d = e("../settings");
  17574. n.prototype.prefs = {
  17575. linewidth: 3,
  17576. height: .07,
  17577. opacity: .45,
  17578. endScale: .05
  17579. },
  17580. n.prototype.discard = function() {
  17581. if (this.obj3d) {
  17582. var e = this.obj3d.parent;
  17583. e && e.remove(this.obj3d)
  17584. }
  17585. this.obj3d = null
  17586. }
  17587. ,
  17588. n.prototype.draw = function() {
  17589. if (this.discard(),
  17590. d.showNeighbors) {
  17591. var e = this.player.currentPano.floor;
  17592. this.obj3d = new u.Object3D;
  17593. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17594. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17595. i.y += this.prefs.height;
  17596. var n = .1525
  17597. , r = new u.Matrix4;
  17598. for (var o in t)
  17599. if (t[o]) {
  17600. var a = this.player.model.panos.get(o)
  17601. , s = (a.position.clone().sub(this.player.model.position),
  17602. a.position.clone().sub(a.floorPosition))
  17603. , l = a.floorPosition.clone().sub(this.player.model.position);
  17604. l.y += this.prefs.height;
  17605. var c = new u.Geometry;
  17606. 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)),
  17607. 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)),
  17608. r.identity().setPosition(s),
  17609. c.applyMatrix(r),
  17610. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17611. 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)),
  17612. r.lookAt(l, i, this.UP).setPosition(l),
  17613. c.applyMatrix(r),
  17614. c.vertices.push(l, i);
  17615. var h = new u.Line(c,new u.LineBasicMaterial({
  17616. color: a.debugColor.getHex(),
  17617. transparent: !0,
  17618. opacity: this.prefs.opacity,
  17619. depthWrite: !1,
  17620. name: "sLine" + o,
  17621. linewidth: this.prefs.linewidth
  17622. }));
  17623. this.obj3d.add(h)
  17624. }
  17625. e.add(this.obj3d)
  17626. }
  17627. }
  17628. ,
  17629. n.prototype.update = function() {
  17630. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17631. }
  17632. ,
  17633. t.exports = n
  17634. }
  17635. , {
  17636. "../settings": 166,
  17637. three: 217
  17638. }],
  17639. 148: [function(S, M, e) {
  17640. (function(e) {
  17641. "use strict";
  17642. function r(e, t, i, n) {
  17643. this.model = e,
  17644. this.id = t,
  17645. this.alignmentType = i.alignmentType || c.ALIGNED,
  17646. this.neighbourUUIDs = i.neighbours,
  17647. this.neighbourPanos = null,
  17648. this.floor = null,
  17649. this.floorIndex = i.floor,
  17650. this.failedLoadingAt = 0,
  17651. this.maxLoadRetries = 4,
  17652. this.origin = i.position.clone(),
  17653. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17654. this.quaternion = i.quaternion.clone(),
  17655. this.skyboxMesh = new s.Mesh(E),
  17656. this.skyboxMesh.position.copy(this.position),
  17657. this.skyboxMesh.quaternion.copy(this.quaternion),
  17658. this.skyboxMesh.name = "skybox",
  17659. this.skyboxMesh.visible = !1,
  17660. this.skyboxMesh.updateMatrix(),
  17661. this.skyboxMesh.updateMatrixWorld(),
  17662. this.marker = null,
  17663. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker,
  17664. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17665. map: b,
  17666. side: s.DoubleSide,
  17667. opacity: 0,
  17668. transparent: !0,
  17669. depthWrite: !1
  17670. })),
  17671. this.marker.visible = this.showFloorMarker,
  17672. this.marker.renderOrder = l.panoMarker,
  17673. this.marker.name = "marker",
  17674. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17675. this.marker.updateMatrixWorld(),
  17676. a.colorMarkerOnLoad && this.on("load", function() {
  17677. this.marker.material.color.set(65280)
  17678. })),
  17679. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17680. this.floorPosition = i.puck ? i.puck.clone() : null,
  17681. this.tiled = n,
  17682. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17683. this.solidSkybox.flipY = !1,
  17684. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17685. this.solidSkybox.magFilter = s.LinearFilter,
  17686. this.solidSkybox.generateMipmaps = !1)),
  17687. this.zoomed = !1,
  17688. this.panoRenderer = null,
  17689. this.qualityManager = null,
  17690. this.tileDownloader = null,
  17691. this.tiledPanoRenderTarget = null,
  17692. this.minimumTiledPanoLoaded = !1,
  17693. this.highestPartialTileRenderOpCompleted = 0,
  17694. this.highestFullTileRenderOpCompleted = 0,
  17695. this.shouldRedrawOnBaseLoaded = !1,
  17696. this.lockUntilRenderingComplete = !1,
  17697. a.colorMarkerOnLoad && this.on("load", function() {
  17698. this.marker.material.color.set(65280)
  17699. }),
  17700. (e = new s.TextureLoader).setCrossOrigin(!0);
  17701. var r = e.load("images/texture.jpg");
  17702. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17703. color: 16777215,
  17704. transparent: !0,
  17705. opacity: .75,
  17706. map: r
  17707. })),
  17708. this.vrMarker.boluoType = "vr",
  17709. this.vrMarker.position.z = 1,
  17710. this.vrMarker.enabled = !0,
  17711. this.vrMarker.visible = !1,
  17712. window.vrMarkers = window.vrMarkers || [],
  17713. window.vrMarkers.push(this.vrMarker),
  17714. this.marker && this.marker.add(this.vrMarker),
  17715. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17716. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17717. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17718. this.adjustAngleEnable) {
  17719. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17720. this.skyboxMesh.quaternion.multiply(i);
  17721. var o = new s.Quaternion;
  17722. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17723. this.skyboxMesh.quaternion.multiply(o),
  17724. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17725. this.skyboxMesh.quaternion.multiply(n),
  17726. this.skyboxMesh.updateMatrix(),
  17727. this.skyboxMesh.updateMatrixWorld(),
  17728. this.model.updateProjectedPanos()
  17729. }
  17730. }
  17731. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17732. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17733. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17734. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17735. S("../enum/GLCubeFaces"),
  17736. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  17737. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17738. function() {
  17739. this.setZoomed(!1),
  17740. this.emit("enter", {
  17741. oldPano: t,
  17742. newPano: this
  17743. }),
  17744. t = this
  17745. }
  17746. ),
  17747. r.prototype.exit = function() {
  17748. this.tiled ? (this.clearWaitDeferreds(),
  17749. this.minimumTiledPanoLoaded = !1,
  17750. this.tiledPanoRenderTarget = null,
  17751. this.setZoomed(!1),
  17752. this.panoRenderer.deactivateTiledPano(this),
  17753. this.highestPartialTileRenderOpCompleted = 0,
  17754. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17755. this.solidSkybox.loaded = !1,
  17756. this.solidSkybox.version = 0),
  17757. this.emit("exit")
  17758. }
  17759. ,
  17760. r.prototype.hoverOn = function(e) {
  17761. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17762. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17763. }
  17764. ,
  17765. r.prototype.hoverOff = function(e) {
  17766. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17767. }
  17768. ,
  17769. r.prototype.build1 = function() {
  17770. 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), //改
  17771. this.floor.addPano(this)
  17772. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17773. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17774. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17775. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  17776. }
  17777. ,
  17778. r.prototype.build2 = function() {
  17779. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17780. this.height = this.position.distanceTo(this.floorPosition),
  17781. this.placeMarker()
  17782. }
  17783. ,
  17784. r.prototype.interpolateFloorPosition = function() {
  17785. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17786. return !!e.floorPosition
  17787. }).sort(function(e, t) {
  17788. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17789. }
  17790. .bind(this))
  17791. , t = this.position.clone();
  17792. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17793. t
  17794. }
  17795. ,
  17796. r.prototype.raycastFloorPosition = function() {
  17797. I.warn("Performance warning: Raycasting to find floor position");
  17798. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17799. return e.length ? e[0].point : null
  17800. }
  17801. ,
  17802. 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)],
  17803. function() {
  17804. I.warn("Performance warning: Raycasting to find floor index");
  17805. for (var e = 0; e < i.length; e++) {
  17806. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17807. if (t.length)
  17808. return t[0].object.parent.parent
  17809. }
  17810. return null
  17811. }
  17812. ),
  17813. r.prototype.placeMarker = function() {
  17814. this.marker && (this.marker.position.copy(this.floorPosition),
  17815. this.marker.position.y += .05,
  17816. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17817. }
  17818. ,
  17819. r.prototype.translate = function(e) {
  17820. this.position.add(e),
  17821. this.floorPosition.add(e)
  17822. }
  17823. ,
  17824. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17825. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17826. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17827. }
  17828. ,
  17829. r.prototype.attachToPanoRenderer = function(e) {
  17830. this.panoRenderer = e,
  17831. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17832. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17833. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17834. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17835. }
  17836. ;
  17837. var w, T, x = {};
  17838. r.prototype.getWaitDeferred = function(e) {
  17839. var t = x[this.id];
  17840. t || (t = {},
  17841. x[this.id] = t);
  17842. var i = t[e];
  17843. return i || (i = {
  17844. deferred: $.Deferred(),
  17845. active: !1
  17846. },
  17847. t[e] = i),
  17848. i
  17849. }
  17850. ,
  17851. r.prototype.resetWaitDeferred = function(e) {
  17852. var t = this.getWaitDeferred(e);
  17853. t.active = !1,
  17854. t.deferred = $.Deferred()
  17855. }
  17856. ,
  17857. r.prototype.clearWaitDeferreds = function() {
  17858. var e = x[this.id];
  17859. for (var t in e || (e = {},
  17860. x[this.id] = e),
  17861. e)
  17862. if (e.hasOwnProperty(t)) {
  17863. var i = e[t];
  17864. i.active = !1,
  17865. i.deferred = $.Deferred()
  17866. }
  17867. }
  17868. ,
  17869. r.prototype.loadTiledPano = (new s.Vector3,
  17870. w = [],
  17871. T = [],
  17872. function(e, t, i, n, r, o) {
  17873. null != n || (n = !0),
  17874. null != r || (r = !0);
  17875. var a = this.getWaitDeferred(e)
  17876. , s = a.deferred
  17877. , l = null
  17878. , c = null;
  17879. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17880. c = i.vFov)),
  17881. !this.isLoaded(e)) {
  17882. if (!a.active) {
  17883. if (a.active = !0,
  17884. i) {
  17885. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17886. w[this.id + ":" + e] = {
  17887. tileCount: 0,
  17888. targetTileCount: h
  17889. },
  17890. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17891. }
  17892. T[this.id] || (T[this.id] = !0,
  17893. this.on(f.LoadComplete, function(e, t) {
  17894. var i = this.getWaitDeferred(e).deferred;
  17895. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17896. this.resetWaitDeferred(e))
  17897. }
  17898. .bind(this)),
  17899. this.on(f.LoadFailed, function(e) {
  17900. var t = this.getWaitDeferred(e).deferred;
  17901. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17902. this.resetWaitDeferred(e))
  17903. }
  17904. .bind(this)),
  17905. this.on(f.TileLoaded, function(e, t, i) {
  17906. var n = this.getWaitDeferred(e).deferred;
  17907. if (n && "pending" === n.state()) {
  17908. n.notify(e, t, i);
  17909. var r = w[this.id + ":" + e];
  17910. r && (r.tileCount++,
  17911. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17912. n.resolve(e, i),
  17913. this.resetWaitDeferred(e)))
  17914. }
  17915. }
  17916. .bind(this)))
  17917. }
  17918. this.tileDownloader.clearForceQueue(),
  17919. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  17920. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  17921. this.panoRenderer.renderPanoTiles(this.id, t, r)
  17922. }
  17923. return s.promise()
  17924. }
  17925. ),
  17926. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  17927. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  17928. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  17929. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  17930. }
  17931. ,
  17932. r.prototype.onTileRendered = function(e, t, i, n) {
  17933. e === this.id && this.emit(f.TileLoaded, t, i, n)
  17934. }
  17935. ,
  17936. r.prototype.onPanoRendered = function(e, t, i, n) {
  17937. e === this.id && (this.minimumTiledPanoLoaded = !0,
  17938. this.updateSkyboxForZoomLevel(),
  17939. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  17940. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  17941. this.emit("load", t),
  17942. this.model.emit("load", this),
  17943. this.emit(f.LoadComplete, t, i))
  17944. }
  17945. ,
  17946. r.prototype.setZoomed = function(e) {
  17947. this.zoomed = e,
  17948. this.updateSkyboxForZoomLevel()
  17949. }
  17950. ,
  17951. r.prototype.ensureSkyboxReadyForRender = function() {
  17952. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  17953. this.solidSkybox.loaded = !0)
  17954. }
  17955. ,
  17956. r.prototype.updateSkyboxForZoomLevel = function() {
  17957. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  17958. }
  17959. ,
  17960. r.prototype.getSkyboxTexture = function() {
  17961. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  17962. }
  17963. ,
  17964. r.prototype.onTileRenderFail = function(e, t, i) {
  17965. e === this.id && this.emit(f.LoadFailed, t)
  17966. }
  17967. ,
  17968. r.prototype.isLoaded = function(e) {
  17969. if (this.tiled) {
  17970. if (e && "string" == typeof e)
  17971. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  17972. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  17973. }
  17974. if (e && "number" == typeof e)
  17975. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  17976. return !!this.solidSkybox.high || e in this.solidSkybox
  17977. }
  17978. ,
  17979. r.prototype.loadCube = function(a) {
  17980. if (this.isLoaded(a))
  17981. return I.info("Skipping load of pano, already loaded"),
  17982. $.when();
  17983. this.emit("loading", a),
  17984. this.model.emit("loading", this);
  17985. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  17986. , e = n.filter(function(e) {
  17987. return !e
  17988. });
  17989. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  17990. a = "high",
  17991. n = p.getCubemapUrls(this.model.urls, this.id, a));
  17992. var t = 0
  17993. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  17994. return u.getImage(n[t])
  17995. }
  17996. .bind(this));
  17997. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  17998. return this.solidSkybox[a] = [e, t, i, n, r, o],
  17999. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18000. this.solidSkybox.low = null),
  18001. this.solidSkybox.needsUpdate = !0,
  18002. this.emit("load", a),
  18003. this.model.emit("load", this),
  18004. this
  18005. }
  18006. .bind(this), function() {
  18007. I.error("Downloading cubemap for pano", this.id, "failed"),
  18008. this.failedLoadingAt = Date.now()
  18009. }
  18010. .bind(this), function() {
  18011. return $.when(++t, 6)
  18012. })
  18013. }
  18014. ,
  18015. r.raycastsSkipped = 0,
  18016. r.raycastsDone = 0,
  18017. r.prototype.findNeighourPanos = function() {
  18018. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18019. this.model.panos.forEach(function(e) {
  18020. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18021. var t = this.position.distanceTo(e.position);
  18022. if (t > a.panoramaNeighbourMaxDistance)
  18023. return this.model.panos.setNeighbour(this, e, !1),
  18024. void r.raycastsSkipped++;
  18025. var i = e.position.clone().sub(this.position).normalize()
  18026. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18027. r.raycastsDone++,
  18028. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18029. 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)))
  18030. }
  18031. }
  18032. .bind(this)),
  18033. this.model.panos.neighbourMap[this.id]
  18034. }
  18035. ,
  18036. r.prototype.worldPosition = function() {
  18037. return this.position
  18038. }
  18039. ,
  18040. r.prototype.addTextSprite = function(e, color, parent) {
  18041. this.removeTextSprite();
  18042. var ratio = 16;
  18043. var i = document.createElement("canvas")
  18044. , n = i.getContext("2d");
  18045. i.width = 1024,
  18046. i.height = i.width / ratio;
  18047. n.font = " 30px Arial",
  18048. n.fillStyle = "white";
  18049. var r = n.measureText(e).width;
  18050. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18051. var o = new s.Texture(i);
  18052. o.needsUpdate = !0;
  18053. var a = new s.SpriteMaterial({
  18054. map: o,
  18055. color: color || 16428055,
  18056. depthTest:false
  18057. });
  18058. this.text3d = new s.Sprite(a)
  18059. if(parent){
  18060. parent.add(this.text3d)
  18061. }else{
  18062. this.text3d.position.copy(this.skyboxMesh.position)
  18063. this.floor.add(this.text3d)
  18064. }
  18065. var scale = 5
  18066. this.text3d.scale.y = scale/ratio
  18067. this.text3d.scale.x = scale
  18068. }
  18069. ,
  18070. r.prototype.removeTextSprite = function() {
  18071. this.text3d && (this.text3d.parent.remove(this.text3d),
  18072. this.text3d.material.map.dispose(),
  18073. this.text3d = null)
  18074. }
  18075. ,
  18076. r.prototype.isAligned = function() {
  18077. return this.alignmentType === c.ALIGNED
  18078. }
  18079. ,
  18080. r.filters = {
  18081. inDirection: function(t, i, n) {
  18082. return function(e) {
  18083. return e.position.clone().sub(t).normalize().dot(i) > n
  18084. }
  18085. },
  18086. inFloorDirection: function(t, i, n) {
  18087. return function(e) {
  18088. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18089. }
  18090. },
  18091. inPanoDirection: function(n, r, o) {
  18092. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18093. function(e) {
  18094. var t = e.floorPosition.clone().sub(n).normalize()
  18095. , i = e.position.clone().sub(n).normalize();
  18096. return t.dot(r) > o || i.dot(r) > o
  18097. }
  18098. },
  18099. atFloor: function(t) {
  18100. return function(e) {
  18101. return !t || e.floor === t
  18102. }
  18103. },
  18104. not: function(t) {
  18105. return function(e) {
  18106. return e !== t
  18107. }
  18108. },
  18109. notIn: function(t) {
  18110. return function(e) {
  18111. return -1 === t.indexOf(e)
  18112. }
  18113. },
  18114. isLoaded: function() {
  18115. return function(e) {
  18116. return e.isLoaded()
  18117. }
  18118. },
  18119. isNotLoaded: function() {
  18120. return function(e) {
  18121. return !e.isLoaded()
  18122. }
  18123. },
  18124. isCloseEnoughTo: function(t, i) {
  18125. return function(e) {
  18126. return t.distanceTo(e.floorPosition) < i
  18127. }
  18128. },
  18129. hasMinimumHeightDifferenceTo: function(t, i) {
  18130. return function(e) {
  18131. return Math.abs(e.position.y - t.y) > i
  18132. }
  18133. },
  18134. isNotBehindNormal: function(t, i) {
  18135. var n = new s.Vector3;
  18136. return i = i.clone(),
  18137. function(e) {
  18138. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18139. }
  18140. },
  18141. isNeighbourPanoTo: function(t) {
  18142. return function(e) {
  18143. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18144. }
  18145. },
  18146. isNeighbourOfNeighbourTo: function(n) {
  18147. return function(i) {
  18148. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18149. var t = n.model.panos.get(e);
  18150. return !!t && t.neighbourPanos[i.id]
  18151. })
  18152. }
  18153. },
  18154. isNotRecentlyFailed: function(t) {
  18155. return function(e) {
  18156. return Date.now() - e.failedLoadingAt > t
  18157. }
  18158. },
  18159. isOnVisibleFloor: function() {
  18160. return function(e) {
  18161. return !e.floor.hidden
  18162. }
  18163. },
  18164. isPanoAligned: function() {
  18165. return function(e) {
  18166. return e.isAligned()
  18167. }
  18168. }
  18169. },
  18170. r.sortFunctions = {
  18171. distanceToPoint: function(i) {
  18172. return function(e, t) {
  18173. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18174. }
  18175. },
  18176. floorDistanceToPoint: function(i) {
  18177. return function(e, t) {
  18178. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18179. }
  18180. },
  18181. choose: function(i) {
  18182. return function(e, t) {
  18183. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18184. }
  18185. }
  18186. },
  18187. r.scoreFunctions = {
  18188. distance: function(t, i) {
  18189. return i = i || a.navigation.distanceFactor,
  18190. function(e) {
  18191. return t ? t.position.distanceTo(e.position) * i : 0
  18192. }
  18193. },
  18194. distanceSquared: function(t, i) {
  18195. return i = i || a.navigation.distanceFactor,
  18196. function(e) {
  18197. return t ? t.position.distanceToSquared(e.position) * i : 0
  18198. }
  18199. },
  18200. direction: function(t, i) {
  18201. return function(e) {
  18202. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18203. }
  18204. },
  18205. angle: function(t, i) {
  18206. return function(e) {
  18207. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18208. }
  18209. },
  18210. inFieldOfView: function(t, i) {
  18211. return function(e) {
  18212. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18213. }
  18214. },
  18215. optionality: function(t) {
  18216. return function(e) {
  18217. return e.neighbourUUIDs.filter(function(e) {
  18218. return !(e in t.neighbourUUIDs) && e !== t.id
  18219. }).length * a.navigation.optionalityFactor
  18220. }
  18221. },
  18222. penalizeHeightDifferenceUnder: function(t, i) {
  18223. return function(e) {
  18224. return t.y - e.position.y < i ? -20 : 0
  18225. }
  18226. }
  18227. },
  18228. M.exports = r
  18229. }
  18230. ).call(this, "/js/objects/Panorama.js")
  18231. }
  18232. , {
  18233. "../enum/AlignmentType": 17,
  18234. "../enum/GLCubeFaces": 25,
  18235. "../enum/PanoRendererEvents": 35,
  18236. "../enum/PanoSizeClass": 36,
  18237. "../enum/PanoramaEvents": 37,
  18238. "../enum/RenderLayers": 41,
  18239. "../enum/RenderOrder": 42,
  18240. "../enum/TileDownloaderEvents": 45,
  18241. "../enum/Viewmode": 51,
  18242. "../exception/BasicException": 55,
  18243. "../scene/SceneRenderer": 158,
  18244. "../settings": 166,
  18245. "../tile/TileUtils": 174,
  18246. "../util/ajax": 181,
  18247. "../util/common": 185,
  18248. "../util/lerp": 188,
  18249. "../util/logger": 189,
  18250. "../util/panorama": 191,
  18251. "../util/texture": 194,
  18252. "../util/transitions": 195,
  18253. events: 202,
  18254. three: 217
  18255. }],
  18256. 149: [function(e, t, i) {
  18257. "use strict";
  18258. function n(e) {
  18259. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18260. t.map.value = d,
  18261. t.opacity.value = 0,
  18262. t.color.value.set(o.reticuleColor),
  18263. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18264. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18265. side: r.DoubleSide,
  18266. depthWrite: !1,
  18267. depthTest: !1,
  18268. transparent: !0,
  18269. vertexShader: c.waypoint.vertexShader,
  18270. fragmentShader: c.waypoint.fragmentShader,
  18271. uniforms: t,
  18272. name: "waypoint",
  18273. opacity: 0,
  18274. visible: t.showMouseMarker
  18275. })),
  18276. this.layers.set(h.RETICULE),
  18277. this.renderOrder = u.reticule,
  18278. this.player = e,
  18279. this.direction = new r.Vector3,
  18280. this.hidden = !0,
  18281. this.mouseLastMoveTime = Date.now()
  18282. }
  18283. var r = e("three")
  18284. , o = e("../settings")
  18285. , a = e("../util/transitions")
  18286. , s = e("../util/texture")
  18287. , l = e("../util/lerp")
  18288. , c = e("../shaders")
  18289. , h = e("../enum/RenderLayers")
  18290. , u = e("../enum/RenderOrder")
  18291. , d = s.load("images/reticule-256x256.png");
  18292. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18293. this.hidden = i,
  18294. this.mouseLastMoveTime = Date.now()
  18295. }
  18296. ,
  18297. n.prototype.hide = function() {
  18298. this.hidden || (this.hidden = !0,
  18299. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18300. }
  18301. ,
  18302. n.prototype.show = function() {
  18303. this.hidden = !1,
  18304. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18305. }
  18306. ,
  18307. n.prototype.update = function() {
  18308. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18309. }
  18310. ,
  18311. n.prototype.updatePosition = function(e, t) {
  18312. if (!this.hidden) {
  18313. if (!t)
  18314. return this.hide();
  18315. var i = t.point
  18316. , n = e.distanceTo(i)
  18317. , r = 1 + .01 * n;
  18318. n < 1 && (r -= 1 - n),
  18319. this.show(),
  18320. this.scale.set(r, r, r),
  18321. this.direction = this.direction.multiplyScalar(.8),
  18322. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18323. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18324. this.lookAt(this.position.clone().add(this.direction))
  18325. }
  18326. }
  18327. ,
  18328. n.prototype.writeAstag = function() {
  18329. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18330. , t = new Date;
  18331. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18332. var i = {
  18333. enabled: !0,
  18334. version: "0",
  18335. created: t.toISOString(),
  18336. created_by: "APITest",
  18337. position: this.position.clone(),
  18338. stem: {
  18339. enabled: o.tags.pole.enabled,
  18340. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18341. },
  18342. label: "tag " + this.tagCount,
  18343. description: "Description " + e,
  18344. floor: function(e) {
  18345. if (e.currentFloor) {
  18346. var t = e.floors.indexOf(e.currentFloor);
  18347. return -1 < t ? t : void 0
  18348. }
  18349. }(this.player.model),
  18350. type: "info",
  18351. metadata: {
  18352. preferred_camera: {
  18353. mode: this.player.mode
  18354. }
  18355. }
  18356. };
  18357. console.log("--------------------------"),
  18358. console.log(JSON.stringify(i));
  18359. var n = this.player.model.addtag(e, i).build();
  18360. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18361. n.visible || n.show(o.tags.startup.fadeInDuration))
  18362. }
  18363. ,
  18364. t.exports = n
  18365. }
  18366. , {
  18367. "../enum/RenderLayers": 41,
  18368. "../enum/RenderOrder": 42,
  18369. "../settings": 166,
  18370. "../shaders": 167,
  18371. "../util/lerp": 188,
  18372. "../util/texture": 194,
  18373. "../util/transitions": 195,
  18374. three: 217
  18375. }],
  18376. 150: [function(e, t, i) {
  18377. "use strict";
  18378. function n(e, t) {
  18379. this.chunks = [],
  18380. this.floorId = e,
  18381. this.roomId = t,
  18382. this.position = new l.Vector3
  18383. }
  18384. var l = e("three");
  18385. n.prototype.addChunk = function(e) {
  18386. this.chunks.push(e)
  18387. }
  18388. ,
  18389. n.prototype.calcBoundaries = function() {
  18390. 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++) {
  18391. var a = this.chunks[o].geometry.attributes.position;
  18392. if (a)
  18393. for (var s = 0; s < a.array.length; s += 3)
  18394. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18395. t.add(e),
  18396. 0 === s ? (i.copy(e),
  18397. n.copy(e)) : (i.max(e),
  18398. n.min(e)),
  18399. r++
  18400. }
  18401. 0 < r ? (t.multiplyScalar(1 / r),
  18402. this.average = t) : this.average = null,
  18403. this.boundsMax = i,
  18404. this.boundsMin = n,
  18405. this.center = new l.Vector3,
  18406. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18407. }
  18408. ,
  18409. t.exports = n
  18410. }
  18411. , {
  18412. three: 217
  18413. }],
  18414. 151: [function(o, v, e) {
  18415. (function(e) {
  18416. "use strict";
  18417. function t(e, t, i) {
  18418. this.obj3d = null,
  18419. this.nodes = [],
  18420. this.colorHull = [],
  18421. this.shortPaths = {},
  18422. this.floorHull = null,
  18423. this.cameraHull = null,
  18424. this.floorPathDistance = 0,
  18425. this.floorCurvePoints = null,
  18426. this.floorCurveColors = null,
  18427. this.camCurvePoints = null,
  18428. this.warpDestHeroLoc = null,
  18429. this.warpDestPano = null,
  18430. this.warpPathPoints = null,
  18431. this.warpPathLengths = [0],
  18432. this.warpLength = 0,
  18433. this.closeWarpDistance = 4,
  18434. this.UP = U.UP.clone(),
  18435. this.longestStep = 0,
  18436. this.upcomingTransType = null,
  18437. this.burnsDir = 1,
  18438. this.prevNextDist = 0,
  18439. this.nextI = 0,
  18440. this.activeTransType = null,
  18441. this.lastTransType = null,
  18442. this.bunnyObj = null,
  18443. this.director = e,
  18444. this.player = t,
  18445. this.playerControls = i,
  18446. this.modelManager = t.modelManager,
  18447. this.updateModel(),
  18448. this.updateDefaultsFromModelData(),
  18449. this.bindEvents(),
  18450. this.warping = !1,
  18451. this.waitingToWarp = !1,
  18452. this.warpInterrupted = !1,
  18453. this.warpInterruptionBlackoutStyle = null,
  18454. this.warpInterruptionTravelTime = null
  18455. }
  18456. 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"),
  18457. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18458. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18459. 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"),
  18460. pathEnd: n.load("images/End.png"),
  18461. 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==")
  18462. };
  18463. t.prototype.setScene = function(e) {
  18464. this.createCpm(e),
  18465. this.createBunnyObj(e)
  18466. }
  18467. ,
  18468. t.prototype.updateModel = function() {
  18469. this.model = this.modelManager.getActiveModel()
  18470. }
  18471. ,
  18472. t.prototype.bindEvents = function() {
  18473. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18474. }
  18475. ,
  18476. t.prototype.updateDefaultsFromModelData = function() {
  18477. this.model.data
  18478. }
  18479. ,
  18480. t.prototype.pointPathDistance = function(e) {
  18481. for (var t = 0, i = 1; i < e.length; i += 1)
  18482. t += e[i - 1].distanceTo(e[i]);
  18483. return t
  18484. }
  18485. ,
  18486. t.prototype.pointPathLengths = function(e) {
  18487. for (var t = [0], i = 1; i < e.length; i += 1)
  18488. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18489. return t
  18490. }
  18491. ,
  18492. t.prototype.interpAlongPath = function(e, t, i) {
  18493. var n, r = new P.Vector3, o = t[t.length - 1];
  18494. if (i < 1) {
  18495. n = i * o;
  18496. for (var a = 1; a < t.length; a += 1)
  18497. if (t[a] > n) {
  18498. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18499. return r.copy(e[a]),
  18500. r.sub(e[a - 1]),
  18501. r.multiplyScalar(s),
  18502. r.add(e[a - 1]),
  18503. r
  18504. }
  18505. } else
  18506. r.copy(e[e.length - 1]);
  18507. return r
  18508. }
  18509. ,
  18510. t.prototype.pathHeight = function() {
  18511. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18512. }
  18513. ,
  18514. t.prototype.createBunnyObj = function(e) {
  18515. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18516. this.bunnyObj.visible = D.warp.showBunny),
  18517. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18518. e.add(this.bunnyObj)
  18519. }
  18520. ,
  18521. t.prototype.createCpm = function(e) {
  18522. if (!this.currentPanoMarker) {
  18523. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18524. t.material.uniforms.opacity.value = 0,
  18525. this.currentPanoMarker = {
  18526. mesh: t,
  18527. placed: !1
  18528. }
  18529. }
  18530. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18531. this.placeCpm(),
  18532. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18533. }
  18534. ,
  18535. t.prototype.placeCpm = function() {
  18536. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18537. var e = this.player.currentPano.floor;
  18538. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18539. e.add(this.currentPanoMarker.mesh)),
  18540. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18541. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18542. this.currentPanoMarker.placed = !0
  18543. } else
  18544. this.popOutCpm()
  18545. }
  18546. ,
  18547. t.prototype.fadeInCpm = function(e) {
  18548. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18549. }
  18550. ,
  18551. t.prototype.fadeOutCpm = function(e) {
  18552. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18553. }
  18554. ,
  18555. t.prototype.popInCpm = function() {
  18556. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18557. }
  18558. ,
  18559. t.prototype.popOutCpm = function() {
  18560. this.fadeOutCpm(2)
  18561. }
  18562. ,
  18563. t.prototype.brushPrefs = {
  18564. linewidth: 7,
  18565. strokeWidth: 15,
  18566. cvSegments: 48,
  18567. paveStep: .1,
  18568. paveWidth: .2,
  18569. lookBlendDist: 3,
  18570. maxTurn: P.Math.degToRad(2)
  18571. },
  18572. t.prototype.panoPathDistance = function(e) {
  18573. var t = this.model.panos;
  18574. if (!e || e.length < 2)
  18575. return 0;
  18576. for (var i = [], n = 0; n < e.length; n += 1)
  18577. i.push(t.get(e[n]).floorPosition);
  18578. return this.pointPathDistance(i)
  18579. }
  18580. ,
  18581. t.prototype.loadTileTexture = function(t) {
  18582. var e = n.load(t, function(e) {
  18583. e.wrapS = P.RepeatWrapping,
  18584. e.wrapT = P.RepeatWrapping,
  18585. e.needsUpdate = !0,
  18586. H.debug('path texture "' + t + '" is ready')
  18587. }, function() {
  18588. H.error('path texture "' + t + '" failed')
  18589. });
  18590. return e.mapping = P.UVMapping,
  18591. e
  18592. }
  18593. ,
  18594. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18595. return new l({
  18596. cameraMode: n,
  18597. position: e,
  18598. quaternion: t,
  18599. panoId: i,
  18600. orthoZoom: o,
  18601. floorVisibility: r,
  18602. thumbUrl: null,
  18603. name: null
  18604. })
  18605. }
  18606. ,
  18607. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18608. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18609. }
  18610. ,
  18611. t.prototype.setWarpDestination = function(e) {
  18612. this.warpDestHeroLoc = e
  18613. }
  18614. ,
  18615. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18616. var t = this.getHeroDescriptorByHeroIndex(e);
  18617. return null !== t && (this.setWarpDestination(t),
  18618. !0)
  18619. }
  18620. ,
  18621. t.prototype.setWarpDestinationByPano = function(e, t) {
  18622. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18623. }
  18624. ,
  18625. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18626. var i = this.model.panos.get(e);
  18627. if (i) {
  18628. t = t || new P.Quaternion;
  18629. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18630. return this.setWarpDestination(n),
  18631. !0
  18632. }
  18633. return !1
  18634. }
  18635. ,
  18636. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18637. var t = this.model.heroCount();
  18638. if (null !== this.warpDestHeroLoc && t < 1)
  18639. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18640. this.model.getHeroDescriptorByIndex(0);
  18641. var i = this.model.getHeroDescriptorByIndex(e);
  18642. if (i) {
  18643. var n = i.isPano() ? i.panoId : i.cameraMode;
  18644. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18645. }
  18646. return i
  18647. }
  18648. ,
  18649. t.prototype.getHeroDescriptorByPano = function(e) {
  18650. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18651. }
  18652. ,
  18653. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18654. var t = this.getHeroIndexFromPanoId(e);
  18655. return this.getHeroDescriptorByHeroIndex(t)
  18656. }
  18657. ,
  18658. t.prototype.getHeroIndexFromPanoId = function(e) {
  18659. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18660. var i = this.model.heroLocations[t]
  18661. , n = this.getHeroId(i);
  18662. if (n && n === e)
  18663. return t
  18664. }
  18665. return -1
  18666. }
  18667. ,
  18668. t.prototype.getHeroPano = function(e) {
  18669. if (null === e)
  18670. return H.warn("getHeroPano(): no destination"),
  18671. null;
  18672. var t = this.getHeroId(e)
  18673. , i = this.model.panos.get(t);
  18674. return void 0 === i && (i = null,
  18675. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18676. i
  18677. }
  18678. ,
  18679. t.prototype.getHeroId = function(e) {
  18680. return e.panoId
  18681. }
  18682. ,
  18683. t.prototype.setWarpDestPano = function() {
  18684. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18685. this.warpDestPano
  18686. }
  18687. ,
  18688. t.prototype.brushToWarpPano = function(e, t) {
  18689. if (this.discardPathObject(),
  18690. !this.setWarpDestPano())
  18691. return !1;
  18692. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18693. !this.warpDestPano)
  18694. return H.info("No brush"),
  18695. !1;
  18696. if (!this.player.currentPano)
  18697. return H.debug("No current pano, visibility undefined"),
  18698. !1;
  18699. if (!this.warpDestPano)
  18700. return H.info("No wPano, visibility undefined"),
  18701. !1;
  18702. if (!this.warpDestPano.isAligned())
  18703. return H.debug("Cannot brush to unaligned pano"),
  18704. !1;
  18705. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18706. , n = !0;
  18707. if (this.player.currentPano.id === this.warpDestPano.id)
  18708. H.debug("Already at destination pano");
  18709. else {
  18710. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18711. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18712. this.obj3d = new P.Object3D,
  18713. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18714. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18715. e = t) : (this.setPathHulls(this.nodes),
  18716. this.setFloorCurves(),
  18717. 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)))),
  18718. this.player.currentPano.floor.add(this.obj3d);
  18719. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18720. , o = e === L.STD;
  18721. if (!n && (i || o)) {
  18722. if (r) {
  18723. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18724. this.obj3d.add(a)
  18725. }
  18726. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18727. this.obj3d.add(s)
  18728. }
  18729. this.appearSlow()
  18730. }
  18731. return this.upcomingTransType = e,
  18732. !n
  18733. }
  18734. ,
  18735. t.prototype.findShortestPath = function(e, t) {
  18736. if (!e || !t)
  18737. return null;
  18738. var i = D.warp.walkExtraPanosDistance
  18739. , n = e.id + ":" + t.id + ":" + i;
  18740. if (this.shortPaths.hasOwnProperty(n))
  18741. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18742. var r = t.id + ":" + e.id + ":" + i;
  18743. if (this.shortPaths.hasOwnProperty(r))
  18744. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18745. var o = this.model.panos.aStarSearch(e, t);
  18746. return this.model.panos.includeNodesNearPath(o, i),
  18747. this.shortPaths[n] = o ? o.slice() : null,
  18748. o
  18749. }
  18750. ,
  18751. t.prototype.makePathHulls = function(e) {
  18752. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18753. r = (t = h.get(e[0])).floor.floorIndex;
  18754. for (var u = 0; u < e.length; u += 1)
  18755. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18756. s.push(i),
  18757. l.push(t.position.clone()),
  18758. n = t.floor.floorIndex,
  18759. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18760. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18761. return a > this.longestStep && (this.longestStep = a,
  18762. H.debug("path contains " + a + " meter segment")),
  18763. {
  18764. floor: s,
  18765. camera: l,
  18766. color: c
  18767. }
  18768. }
  18769. ,
  18770. t.prototype.makeFloorCurves = function(e, t, i) {
  18771. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18772. , r = this.pointPathDistance(e) - 2 * n
  18773. , o = e.slice(0)
  18774. , a = o[1].clone().sub(o[0]);
  18775. a.y = 0,
  18776. a.normalize().multiplyScalar(n),
  18777. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18778. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18779. a.normalize().multiplyScalar(n),
  18780. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18781. var s = new P.CatmullRomCurve3(o)
  18782. , l = Math.floor(r / i);
  18783. l = 4 * Math.floor(l / 4),
  18784. l = Math.max(4, l);
  18785. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18786. h = 0,
  18787. c = u[f].distanceTo(e[0]);
  18788. for (var g = 1; g < e.length; g += 1)
  18789. p.copy(u[f]).sub(e[g]),
  18790. p.y *= 4,
  18791. p.length() < c && (h = g);
  18792. d.push(t[h])
  18793. }
  18794. return {
  18795. distance: r,
  18796. points: u,
  18797. colors: d
  18798. }
  18799. }
  18800. ,
  18801. t.prototype.makeCameraCurvePoints = function(e, t) {
  18802. var i = this.pointPathDistance(e);
  18803. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18804. }
  18805. ,
  18806. t.prototype.makeCameraCurveTangents = function(e, t) {
  18807. var i = this.pointPathDistance(e)
  18808. , n = new P.CatmullRomCurve3(e)
  18809. , r = Math.max(2, Math.floor(i / t));
  18810. r = r || 5;
  18811. for (var o = [], a = 0; a <= r; a++)
  18812. o.push(n.getTangentAt(a / r));
  18813. return o
  18814. }
  18815. ,
  18816. t.prototype.setPathHulls = function(e) {
  18817. var t = this.makePathHulls(e);
  18818. this.floorHull = t.floor,
  18819. this.cameraHull = t.camera,
  18820. this.colorHull = t.color
  18821. }
  18822. ,
  18823. t.prototype.setFloorCurves = function() {
  18824. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18825. this.floorPathDistance = e.distance,
  18826. this.floorCurvePoints = e.points,
  18827. this.floorCurveColors = e.colors
  18828. }
  18829. ,
  18830. t.prototype.setCameraCurvePoints = function() {
  18831. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18832. }
  18833. ,
  18834. t.prototype.chooseWarpPath = function(e) {
  18835. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18836. if (this.player.currentPano === this.warpDestPano || !e)
  18837. return this.warpPathPoints = null,
  18838. this.warpLength = 0,
  18839. !1;
  18840. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18841. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18842. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18843. t.multiplyScalar(.15).add(r.position),
  18844. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18845. t.y = r.position.y,
  18846. i.y = this.warpDestPano.position.y,
  18847. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18848. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18849. this.setCameraCurvePoints(),
  18850. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18851. this.warpLength = 0,
  18852. this.warpPathLengths = [0];
  18853. 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) {
  18854. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18855. var h = o.length();
  18856. o.y *= D.warp.climbEffort;
  18857. var u = o.length() / h;
  18858. if (1 < c) {
  18859. o.setY(0).normalize(),
  18860. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18861. var d = Math.min(1, o.dot(a))
  18862. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18863. u = Math.max(p, u)
  18864. }
  18865. this.warpLength += h * u,
  18866. this.warpPathLengths[c] = this.warpLength
  18867. }
  18868. return !0
  18869. }
  18870. ,
  18871. t.prototype.drawPathRibbon = function(e, t) {
  18872. this.bunnyObj.visible = D.warp.showBunny;
  18873. 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) {
  18874. a.copy(e[s]),
  18875. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18876. a.normalize(),
  18877. n.crossVectors(a, U.UP),
  18878. n.multiplyScalar(i);
  18879. var l = (new P.Vector3).copy(e[s]).add(r);
  18880. l.sub(n),
  18881. o.vertices.push(l),
  18882. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18883. o.vertices.push(l)
  18884. }
  18885. var c, h, u, d = 0;
  18886. for (s = 0; s < e.length - 1; s += 1) {
  18887. var p = 2 * s
  18888. , f = d
  18889. , g = d += e[s + 1].distanceTo(e[s])
  18890. , m = t[s]
  18891. , v = t[s + 1];
  18892. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18893. o.faces.push(c),
  18894. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18895. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18896. o.faces.push(c),
  18897. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18898. }
  18899. o.computeFaceNormals(),
  18900. o.computeVertexNormals(),
  18901. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18902. u.opacity.value = 0,
  18903. u.color.value.set(D.path.color),
  18904. new P.RawShaderMaterial({
  18905. side: P.DoubleSide,
  18906. depthWrite: !1,
  18907. transparent: !0,
  18908. vertexShader: C.ribbon.vertexShader,
  18909. fragmentShader: C.ribbon.fragmentShader,
  18910. uniforms: u,
  18911. name: "ribbonT",
  18912. opacity: 0
  18913. })) : new P.MeshBasicMaterial({
  18914. color: 16777215,
  18915. side: P.DoubleSide,
  18916. name: "ribbonOut",
  18917. vertexColors: P.VertexColors
  18918. });
  18919. var y = new P.Mesh(o,h);
  18920. return y.name = "ribbon",
  18921. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  18922. y
  18923. }
  18924. ,
  18925. t.prototype.drawPathPavement = function(e) {
  18926. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  18927. r.copy(e[o]),
  18928. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  18929. r.normalize(),
  18930. i.crossVectors(r, U.UP),
  18931. i.multiplyScalar(this.brushPrefs.paveWidth),
  18932. (t = (new P.Vector3).copy(e[o])).sub(i),
  18933. n.vertices.push(t),
  18934. n.vertices.push((new P.Vector3).copy(e[o])),
  18935. (t = (new P.Vector3).copy(e[o])).add(i),
  18936. n.vertices.push(t);
  18937. var a, s, l;
  18938. for (o = 0; o < e.length - 1; o += 1)
  18939. a = 3 * o + 1,
  18940. l = .25 + (s = .25 * o),
  18941. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  18942. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  18943. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  18944. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  18945. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  18946. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  18947. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  18948. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  18949. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  18950. color: D.path.color,
  18951. side: P.DoubleSide,
  18952. transparent: !0,
  18953. depthWrite: !1,
  18954. opacity: 0,
  18955. name: "paveT",
  18956. map: I.path
  18957. }) : new P.MeshBasicMaterial({
  18958. color: D.path.color,
  18959. side: P.DoubleSide,
  18960. transparent: !0,
  18961. depthWrite: !1,
  18962. opacity: 1,
  18963. name: "paveO",
  18964. map: I.path
  18965. });
  18966. return new P.Mesh(n,c)
  18967. }
  18968. ,
  18969. t.prototype.hintPrefs = {
  18970. rad: .18,
  18971. width: .0125,
  18972. depth: .0625,
  18973. setBack: -.04,
  18974. markRad: .25,
  18975. markInnerRad: .16
  18976. },
  18977. t.prototype.makeWaypointObj = function(e, t) {
  18978. var i = new P.Geometry
  18979. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18980. , r = this.pathHeight();
  18981. 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)),
  18982. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  18983. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  18984. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  18985. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  18986. o.map.value = e,
  18987. o.opacity.value = 0,
  18988. o.color.value.set(D.path.color);
  18989. var a = {
  18990. side: P.DoubleSide,
  18991. depthWrite: !1,
  18992. transparent: !0,
  18993. vertexShader: C.waypoint.vertexShader,
  18994. fragmentShader: C.waypoint.fragmentShader,
  18995. uniforms: o,
  18996. name: "waypoint",
  18997. opacity: 0
  18998. };
  18999. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19000. a.name = "wayPtOut");
  19001. var s = new P.RawShaderMaterial(a)
  19002. , l = new P.Mesh(i,s);
  19003. return l.name = t,
  19004. l
  19005. }
  19006. ,
  19007. t.prototype.makeStartMarker = function(e, t) {
  19008. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19009. i.y = 0,
  19010. i.normalize();
  19011. var n = Math.acos(i.x)
  19012. , r = this.makeWaypointObj(I.pathStart, "Start");
  19013. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19014. r.position.copy(e),
  19015. r
  19016. }
  19017. ,
  19018. t.prototype.makeEndMarker = function(e) {
  19019. var t = this.makeWaypointObj(I.pathEnd, "End")
  19020. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19021. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19022. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19023. t.position.copy(e),
  19024. t
  19025. }
  19026. ,
  19027. t.prototype.pathClean = function(e) {
  19028. if (e) {
  19029. for (var t in e.children)
  19030. this.pathClean(e.children[t]);
  19031. e.geometry && e.geometry.dispose(),
  19032. e.material && e.material.dispose()
  19033. }
  19034. }
  19035. ,
  19036. t.prototype.discardPathObject = function() {
  19037. if (this.obj3d) {
  19038. var e = this.obj3d.parent;
  19039. e && e.remove(this.obj3d),
  19040. this.pathClean(this.obj3d)
  19041. }
  19042. this.obj3d = null,
  19043. this.popInCpm()
  19044. }
  19045. ,
  19046. t.prototype.discardSlow = function() {
  19047. if (this.obj3d) {
  19048. if (this.player.mode !== O.PANORAMA)
  19049. return void this.discardPathObject();
  19050. for (var e, t = 0, i = function() {
  19051. this.discardPathObject()
  19052. }
  19053. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19054. 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]),
  19055. t += 1,
  19056. i = null);
  19057. 0 === t && this.discardPathObject(),
  19058. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19059. }
  19060. }
  19061. ,
  19062. t.prototype.appearSlow = function() {
  19063. var e;
  19064. this.fadeOutCpm(D.path.fadeInTime);
  19065. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19066. 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]))
  19067. }
  19068. ,
  19069. t.prototype.update = function() {
  19070. this.obj3d && this.obj3d.updateMatrixWorld()
  19071. }
  19072. ,
  19073. t.prototype.calcBurnsAmount = function(e) {
  19074. var n = P.Math.degToRad(D.warp.burnsAngle);
  19075. if (this.player.mode !== O.PANORAMA)
  19076. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19077. var t = this.burnsDir * n;
  19078. if (this.upcomingTransType === L.BLACK)
  19079. return t;
  19080. var i = e;
  19081. if (null === i)
  19082. return H.warn("Transition request for non-highlight"),
  19083. t;
  19084. var r = this.getHeroDescriptorByHeroIndex(i);
  19085. if (null === r)
  19086. return t;
  19087. if (!r.isPano())
  19088. return t;
  19089. function o(e) {
  19090. var t = Math.acos(Math.min(1, e.dot(l)))
  19091. , i = (new P.Vector3).crossVectors(l, e);
  19092. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19093. }
  19094. var a = this.getHeroPano(r)
  19095. , s = this.playerControls.cameras[O.PANORAMA]
  19096. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19097. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19098. if (a === this.player.currentPano)
  19099. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19100. var h = this.findShortestPath(this.player.currentPano, a);
  19101. if (null == h || h.length < 1)
  19102. return H.debug("Empty path ahead..."),
  19103. t;
  19104. var u = this.makePathHulls(h)
  19105. , d = new P.CatmullRomCurve3(u.camera)
  19106. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19107. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19108. }
  19109. ,
  19110. t.prototype.waitNextStep = function(e, t, i) {
  19111. var o = null == i ? D.warp.tourStepDelay : i;
  19112. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19113. var a = new P.Euler
  19114. , s = new P.Vector3;
  19115. H.debug("Starting wait: " + (void 0 !== t));
  19116. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  19117. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19118. , c = function() {
  19119. this.endWarpState(),
  19120. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19121. t && t()
  19122. }
  19123. .bind(this)
  19124. , n = function(e, t) {
  19125. if (this.warpInterrupted)
  19126. return c(),
  19127. !0;
  19128. var i = t || 1e3 / 60;
  19129. if (D.warp.doBurns && !currentLocation.dontRot )
  19130. if (this.player.mode === O.PANORAMA) {
  19131. var n = this.playerControls.cameras[O.PANORAMA];
  19132. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19133. var r = o == 0 ? l : i * l / o;
  19134. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19135. a.y += r,
  19136. s.set(0, 0, -1),
  19137. s.applyEuler(a),
  19138. s.add(n.position),
  19139. n.controls.lookAt(s),
  19140. n.controls.lookVector.copy(s),
  19141. n.lookAt(s)
  19142. } else
  19143. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19144. }
  19145. .bind(this);
  19146. this.startWarpState(),
  19147. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19148. }
  19149. ,
  19150. t.prototype.warpToNonPano = function(e) {
  19151. if (this.discardPathObject(),
  19152. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19153. var t = function() {
  19154. e && e()
  19155. }
  19156. .bind(this);
  19157. this.player.flyToNewMode({
  19158. mode: this.warpDestHeroLoc.cameraMode,
  19159. duration: D.warp.outsideTime,
  19160. warpDest: this.warpDestHeroLoc,
  19161. callback: t,
  19162. force: !0
  19163. })
  19164. } else
  19165. H.warn("no warp destination!!!"),
  19166. e && e()
  19167. }
  19168. ,
  19169. t.prototype._resetWarpShaderParams = function(e) {
  19170. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19171. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19172. }
  19173. ,
  19174. t.prototype._clearWarpShading = function() {
  19175. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19176. this._resetWarpShaderParams(e[t]),
  19177. e[t].visible = !0;
  19178. this._resetWarpShaderParams(this.model.skybox)
  19179. }
  19180. ,
  19181. t.prototype._warpStopFlying = function() {
  19182. this.activeTransType = null,
  19183. this.placeCpm()
  19184. }
  19185. ,
  19186. t.prototype._wrapupTravelOnlyBits = function() {
  19187. this._warpStopFlying(),
  19188. this.warpPathPoints && (this.player.currentPano.exit(),
  19189. this.warpDestPano.enter(),
  19190. this.player.currentPano = this.warpDestPano),
  19191. this.player.spider.draw(),
  19192. this.placeCpm()
  19193. }
  19194. ,
  19195. t.prototype._wrapupTravel = function(e) {
  19196. this._wrapupTravelOnlyBits(),
  19197. this.warpCameraAim(e)
  19198. }
  19199. ,
  19200. t.prototype._wrapupWarpShading = function(e) {
  19201. this._clearWarpShading(),
  19202. this._wrapupTravel(e)
  19203. }
  19204. ,
  19205. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19206. t !== z.END && this._clearWarpShading(),
  19207. this._wrapupTravelOnlyBits(),
  19208. this.upcomingTransType = null,
  19209. e && e()
  19210. }
  19211. ,
  19212. t.prototype._warpCameraAim = function(e, t) {
  19213. var i = this.warpDestHeroLoc.quaternion
  19214. , n = this.playerControls.cameras[O.PANORAMA]
  19215. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19216. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19217. , a = P.Math.radToDeg(Math.acos(o))
  19218. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19219. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19220. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19221. c.y = N.constrainedTurn(c.y),
  19222. this.burnsDir = Math.sign(c.y);
  19223. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19224. , u = new P.Vector3
  19225. , d = function(e, t) {
  19226. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19227. h.y = l.y + e * c.y,
  19228. h.z = l.z + e * c.z,
  19229. u.set(0, 0, -1),
  19230. u.applyEuler(h),
  19231. u.add(n.position),
  19232. n.controls.lookAt(u),
  19233. n.controls.lookVector.copy(u),
  19234. void n.lookAt(u))
  19235. }
  19236. .bind(this);
  19237. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19238. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19239. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19240. )
  19241. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19242. void (t && t())) */
  19243. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19244. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19245. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19246. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19247. void (t && t()))
  19248. }
  19249. ,
  19250. t.prototype._warpBendAim = function(e, t, i, n) {
  19251. var r = n || 0
  19252. , o = this.playerControls.cameras[O.PANORAMA]
  19253. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19254. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19255. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19256. l.y = N.constrainedTurn(l.y);
  19257. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19258. l.x = c * Math.sign(l.x),
  19259. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19260. this.burnsDir = Math.sign(l.y),
  19261. c *= Math.sign(l.y),
  19262. l.y = c;
  19263. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19264. , u = new P.Vector3
  19265. , d = function(e, t) {
  19266. if (e < .5)
  19267. h.x = s.x + e * l.x,
  19268. h.y = s.y + e * l.y,
  19269. h.z = s.z + e * l.z;
  19270. else {
  19271. var i = (1 - e) * D.warp.softBendEnd;
  19272. h.x = a.x - i * l.x,
  19273. h.y = a.y - i * l.y,
  19274. h.z = a.z - i * l.z
  19275. }
  19276. u.set(0, 0, -1),
  19277. u.applyEuler(h),
  19278. u.add(o.position),
  19279. o.controls.lookAt(u),
  19280. o.controls.lookVector.copy(u),
  19281. o.lookAt(u)
  19282. }
  19283. .bind(this);
  19284. if(window.DATA.momentTourBlackNewType){
  19285. d(1)
  19286. }else return V.start(d, t, i, r, B[D.warp.movementEasing])
  19287. }
  19288. ,
  19289. t.prototype._warpStepCameraAim = function(e, t, i) {
  19290. var n = this.playerControls.cameras[O.PANORAMA]
  19291. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19292. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19293. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19294. a.y = N.constrainedTurn(a.y),
  19295. this.burnsDir = Math.sign(a.y);
  19296. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19297. , l = new P.Vector3
  19298. , c = function(e, t) {
  19299. e < .5 ? s.copy(o) : s.copy(r),
  19300. l.set(0, 0, -1),
  19301. l.applyEuler(s),
  19302. l.add(n.position),
  19303. n.controls.lookAt(l),
  19304. n.controls.lookVector.copy(l),
  19305. n.lookAt(l)
  19306. }
  19307. .bind(this);
  19308. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19309. }
  19310. ,
  19311. t.prototype.setBurnsDir = function() {
  19312. var e = this.playerControls.cameras[O.PANORAMA]
  19313. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19314. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19315. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19316. n.y = N.constrainedTurn(n.y),
  19317. this.burnsDir = Math.sign(n.y)
  19318. }
  19319. ,
  19320. t.prototype.stepWarpPath = function(firstPos, e ) {
  19321. var i = this.playerControls.cameras[O.PANORAMA];
  19322. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19323. if (!n){
  19324. return i.position.copy(this.warpDestPano.position),
  19325. !0;
  19326. }
  19327. /* if (!this.warpPathPoints)
  19328. return i.position.copy(this.warpDestPano.position),
  19329. !0;
  19330. var n = this.warpPathPoints[0] */
  19331. var r = this.warpDestPano.position;
  19332. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19333. var o = new P.Vector3;
  19334. 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),
  19335. i.position.copy(o)
  19336. } else
  19337. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19338. }
  19339. ,
  19340. t.prototype.interruptAndFastForward = function(e, t) {
  19341. this.warping && (this.warpInterrupted = !0,
  19342. this.warpInterruptionBlackoutStyle = e,
  19343. this.warpInterruptionTravelTime = t,
  19344. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19345. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19346. }
  19347. ,
  19348. t.prototype.warpCameraAim = function(e) {
  19349. var t = D.warp.minWarpTime;
  19350. if (this.upcomingTransType === L.BLACK)
  19351. t = D.warp.teleportTime;
  19352. else {
  19353. var i = this.playerControls.cameras[O.PANORAMA]
  19354. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19355. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19356. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19357. o.y = N.constrainedTurn(o.y);
  19358. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19359. t = Math.max(t, a)
  19360. }
  19361. var s = function() {
  19362. this._warpStopFlying(),
  19363. this.discardSlow(),
  19364. e && e()
  19365. }
  19366. .bind(this);
  19367. this._warpCameraAim(t, s)
  19368. }
  19369. ,
  19370. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19371. this.model.skybox.material.uniforms.blackout.value = n;
  19372. var r = F.uniform(this.model.skybox, "progress", 1)
  19373. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19374. , a = !1
  19375. , s = function() {
  19376. if (this.warpInterrupted)
  19377. return a = !0
  19378. }
  19379. .bind(this)
  19380. , l = function(e, t) {
  19381. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19382. }
  19383. .bind(this)
  19384. , c = function(e, t) {
  19385. return i && a ? (o(0),
  19386. !0) : void o(e, t)
  19387. }
  19388. .bind(this);
  19389. V.start(s, e, null, t, null, "safeHaltWatch"),
  19390. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19391. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19392. }
  19393. ,
  19394. t.prototype.warpTravel_STD = function(e) {
  19395. 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),
  19396. 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;
  19397. t += this.warpLength * D.warp.timePerMeter,
  19398. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19399. function n(e) {
  19400. var t = i;
  19401. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19402. }
  19403. var y = !1
  19404. , r = this.warpDestHeroLoc.quaternion
  19405. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19406. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19407. , a = A.dot(o)
  19408. , C = P.Math.radToDeg(Math.acos(a))
  19409. , s = function() {
  19410. return m.lookAt(g, l, U.UP),
  19411. u.setFromRotationMatrix(m, D.warp.eOrder),
  19412. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19413. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19414. N.constrainedTurn(v.y)
  19415. }
  19416. .bind(this)
  19417. , I = function(e, t) {
  19418. if (this.warpInterrupted)
  19419. return y = !0
  19420. }
  19421. .bind(this)
  19422. , E = function(e, t) {
  19423. return y || !this.warpPathPoints ? (k.blur(0),
  19424. !0) : void k.blur(e)
  19425. }
  19426. .bind(this)
  19427. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19428. , b = function(e, t) {
  19429. return y || !this.warpPathPoints ? (_(0),
  19430. !0) : void _(e, t)
  19431. }
  19432. .bind(this)
  19433. , w = function(e, t) {
  19434. if (!this.warpPathPoints)
  19435. return h.position.copy(this.warpDestPano.position),
  19436. !0;
  19437. if (y)
  19438. return !0;
  19439. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19440. h.position.copy(i),
  19441. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19442. }
  19443. .bind(this)
  19444. , T = function(e, t) {
  19445. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19446. !0)
  19447. }
  19448. .bind(this)
  19449. , x = function(e, t) {
  19450. if (y)
  19451. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19452. !0;
  19453. if (!this.warpPathPoints)
  19454. return !0;
  19455. var i = this.warpLength * e
  19456. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19457. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19458. D.warp.matchCam && (n *= 1 - r),
  19459. m.lookAt(g, l, U.UP),
  19460. u.setFromRotationMatrix(m, D.warp.eOrder),
  19461. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19462. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19463. v.y = N.constrainedTurn(v.y),
  19464. u.x = p.x + n * v.x,
  19465. u.y = p.y + n * v.y,
  19466. u.z = p.z + n * v.z,
  19467. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19468. v.y = N.constrainedTurn(v.y);
  19469. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19470. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19471. f.x = f.x + v.x * D.warp.turnFriction,
  19472. f.y = f.y + v.y * D.warp.turnFriction,
  19473. f.z = f.z + v.z * D.warp.turnFriction,
  19474. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19475. var a = l.clone().sub(g).normalize();
  19476. if (C < D.warp.maxAimRotation && 0 < r) {
  19477. var s = 1 - r;
  19478. a.x = a.x * s + r * A.x,
  19479. a.y = a.y * s + r * A.y,
  19480. a.z = a.z * s + r * A.z,
  19481. a.normalize()
  19482. }
  19483. this.bunnyObj.position.copy(h.position).add(a),
  19484. d.set(0, 0, -1).applyEuler(f).normalize(),
  19485. d.multiplyScalar(8),
  19486. d.add(h.position),
  19487. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19488. h.controls.lookVector.copy(d),
  19489. h.lookAt(d))
  19490. }
  19491. .bind(this)
  19492. , S = function() {
  19493. y ? (this.discardSlow(),
  19494. this.upcomingTransType = L.BLACK,
  19495. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19496. }
  19497. .bind(this);
  19498. T(0);
  19499. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19500. , R = M / (t += M);
  19501. this.warpCommonParameters(t, R, !0, z.NONE),
  19502. V.start(I, t, null, 0, null, "_haltWatcher"),
  19503. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19504. V.start(E, t, null, R, n, "blurring")),
  19505. V.start(b, t, null, R, n, "modelAlpha"),
  19506. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19507. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19508. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19509. }
  19510. ,
  19511. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19512. var r = e || 0;
  19513. null != t || (t = D.warp.teleportTime)
  19514. //add
  19515. var done = ()=>{
  19516. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19517. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19518. }
  19519. if(window.DATA.momentTourBlackNewType){
  19520. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  19521. var camera = this.playerControls.cameras['panorama'];
  19522. var end = this.warpDestHeroLoc.position
  19523. camera.position.copy(end)
  19524. setTimeout(()=>{
  19525. player.sceneRenderer.effects.transitionMaskPass.stop()
  19526. this.wrapupWarpShadingOnly(n, i);
  19527. done()
  19528. },t)
  19529. }else{
  19530. var o = function() {
  19531. this.wrapupWarpShadingOnly(n, i);
  19532. done()
  19533. }
  19534. .bind(this);
  19535. var firstPos = this.player.position.clone()//add
  19536. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19537. }
  19538. this.warpCommonParameters(t, r, !1, i)
  19539. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  19540. if(window.DATA.momentTourBlackNewType){
  19541. e.material.uniforms.blackout.value = 5//i 改
  19542. //e.material.defines.newBlack = ''
  19543. //e.material.needsUpdate = true
  19544. }else{
  19545. e.material.uniforms.blackout.value = i
  19546. }
  19547. }),
  19548. this._warpBendAim(null, t, null, r);
  19549. /* this.warpCommonParameters(t, r, !1, i)
  19550. this.model.chunks.forEach(function(e) {
  19551. e.material.uniforms.blackout.value = i
  19552. }),
  19553. this._warpBendAim(null, t, null, r);
  19554. //add
  19555. var done = ()=>{
  19556. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19557. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19558. }
  19559. var o = function() {
  19560. this.wrapupWarpShadingOnly(n, i)
  19561. done()
  19562. }
  19563. .bind(this);
  19564. var firstPos = this.player.position.clone()//add
  19565. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19566. */
  19567. }
  19568. ,
  19569. t.prototype.flightStepWalk = (a = new P.Vector3,
  19570. s = new P.Vector3,
  19571. function(e, t, i) {
  19572. if (this.warpInterrupted)
  19573. i && i();
  19574. else if (this.activeTransType !== L.WALK)
  19575. this._clearWarpShading(),
  19576. this._warpStopFlying(),
  19577. this.player.spider.draw(),
  19578. this.placeCpm(),
  19579. i && i();
  19580. else if (this.player.currentPano !== e) {
  19581. var n = {
  19582. pano: e,
  19583. lookAtPoint: t,
  19584. duration: null,
  19585. maxDistanceOverride: D.warp.walkMaxDist,
  19586. skipWarpingCheck: !1,
  19587. constantMoveSpeed: !0
  19588. };
  19589. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19590. n.zoomLevel = this.warpDestHeroLoc.zoom
  19591. }
  19592. n.duration = function(e, t) {
  19593. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19594. s.copy(U.FORWARD),
  19595. this.player.getDirection(s),
  19596. a.copy(t).sub(e.position).normalize();
  19597. var n = a.dot(s)
  19598. , r = Math.acos(n)
  19599. , o = r / i;
  19600. .001 < o && (i *= o / .001, //-----这是什么????
  19601. r < 1 && (i *= 1.2))
  19602. return i / DATA.tourWalkSpeed * 100
  19603. }
  19604. .call(this, e, t),
  19605. this.player.nonInterruptingFlyToPano(n, i)
  19606. } else
  19607. i && i()
  19608. }
  19609. ),
  19610. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19611. return this.flightStepWalk.bind(this, e, t, i)
  19612. }
  19613. ,
  19614. t.prototype.warpTravel_WALK = (f = [],
  19615. function(e) {
  19616. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19617. var o = this.nodes[r]
  19618. , a = t.get(o);
  19619. this.nodes.length,
  19620. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19621. i && n || (f.push(o),
  19622. i = a)
  19623. }
  19624. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19625. var s = f.length
  19626. , l = t.get(f[s - 1])
  19627. , c = new Array(s + 1);
  19628. c[c.length - 1] = function() {
  19629. e && e()
  19630. }
  19631. .bind(this);
  19632. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19633. var d = f[h];
  19634. l = t.get(d);
  19635. var p = new P.Vector3;
  19636. this.getLookAtForWalkingTourNode(f, h, p),
  19637. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19638. h--
  19639. }
  19640. c[0]()
  19641. }
  19642. ),
  19643. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19644. h = new P.Vector3,
  19645. u = new P.Vector3,
  19646. d = new P.Vector3,
  19647. p = new P.Vector3,
  19648. function(e, t, i) {
  19649. var n = e.length;
  19650. if (n <= t)
  19651. return !1;
  19652. var r = 1
  19653. , o = 1;
  19654. h.set(0, 0, 0),
  19655. p.set(0, 0, 0);
  19656. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19657. if (a = this.player.model.panos.get(e[s]),
  19658. this.getOrientationForWalkingTourNode(e, s, u),
  19659. s === t && c.copy(u),
  19660. d.copy(u),
  19661. t < s) {
  19662. var l = d.dot(c) < .65;
  19663. r *= l ? .2 : .75,
  19664. o *= l ? .2 : .4
  19665. }
  19666. u.multiplyScalar(r),
  19667. h.add(u),
  19668. p.lerp(a.position, o)
  19669. }
  19670. return h.normalize(),
  19671. i.copy(p),
  19672. i.add(h),
  19673. !0
  19674. }
  19675. ),
  19676. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19677. var n = e.length;
  19678. if (n <= t)
  19679. return !1;
  19680. if (t === n - 1)
  19681. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19682. else {
  19683. var r = this.player.model.panos.get(e[t])
  19684. , o = this.player.model.panos.get(e[t + 1]);
  19685. i.copy(o.position).sub(r.position)
  19686. }
  19687. return i.normalize(),
  19688. !0
  19689. }
  19690. ,
  19691. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19692. if (this.activeTransType = this.upcomingTransType,
  19693. this.lastTransType = this.activeTransType,
  19694. this.upcomingTransType = null,
  19695. e)
  19696. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19697. this._clearWarpShading(),
  19698. this._warpStopFlying(),
  19699. this.player.spider.draw(),
  19700. this.placeCpm(),
  19701. n && n()
  19702. }
  19703. .bind(this)) : this.warpTravel_STD(n);
  19704. else {
  19705. var r = function() {
  19706. this._wrapupTravel(n)
  19707. }
  19708. .bind(this)
  19709. , o = {
  19710. pano: this.warpDestPano,
  19711. lookAtPoint: null,
  19712. duration: null,
  19713. maxDistanceOverride: null,
  19714. skipWarpingCheck: !1
  19715. };
  19716. this.player.flyToPano(o, r)
  19717. }
  19718. }
  19719. ,
  19720. t.prototype.startWarpState = function() {
  19721. this.warping = !0,
  19722. this.warpInterrupted = !1,
  19723. this.warpInterruptionBlackoutStyle = null,
  19724. this.warpInterruptionTravelTime = null
  19725. }
  19726. ,
  19727. t.prototype.endWarpState = function() {
  19728. this.warping = !1
  19729. }
  19730. ,
  19731. t.prototype.warpToPano = function(e, t, i, n) {
  19732. if (this.warping)
  19733. H.warn("Cannot warp when already warping");
  19734. else {
  19735. if (this.upcomingTransType = e,
  19736. this.activeTransType = null,
  19737. !this.setWarpDestPano())
  19738. return this.upcomingTransType = null,
  19739. void this.warpToNonPano(n);
  19740. if (this.player.mode !== O.PANORAMA)
  19741. return this.upcomingTransType = null,
  19742. this.discardSlow(),
  19743. void this.player.flyToNewMode({
  19744. mode: O.PANORAMA,
  19745. pano: this.warpDestPano,
  19746. duration: D.warp.outsideTime,
  19747. warpDest: this.warpDestHeroLoc,
  19748. callback: n,
  19749. force: !0
  19750. });
  19751. if (!this.warpDestPano)
  19752. return H.warn("no warp destination, callback dropped"),
  19753. void (this.upcomingTransType = null);
  19754. 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)
  19755. , o = this.chooseWarpPath(r);
  19756. if (o && this.upcomingTransType !== L.WALK) {
  19757. var a = function() {
  19758. this.waitingToWarp = !1,
  19759. this.warpToPano(e, t, i, n)
  19760. }
  19761. .bind(this);
  19762. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19763. return void (this.waitingToWarp = !0)
  19764. }
  19765. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19766. this.player.currentPano = this.warpDestPano,
  19767. this.placeCpm(),
  19768. this.fadeOutCpm(D.path.fadeOutTime),
  19769. this.player.spider.draw()),
  19770. H.debug("Warping to pano ", this.warpDestPano.position),
  19771. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19772. this.startWarpState();
  19773. var s = function() {
  19774. this.endWarpState(),
  19775. n && n()
  19776. }
  19777. .bind(this);
  19778. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19779. }
  19780. }
  19781. ,
  19782. v.exports = t
  19783. }
  19784. ).call(this, "/js/objects/ShowPath.js")
  19785. }
  19786. , {
  19787. "../constants": 8,
  19788. "../effects": 16,
  19789. "../enum/BlackoutStyle": 18,
  19790. "../enum/ModelManagerEvents": 33,
  19791. "../enum/PlayerEvents": 40,
  19792. "../enum/RenderOrder": 42,
  19793. "../enum/Vectors": 50,
  19794. "../enum/Viewmode": 51,
  19795. "../enum/WarpStyle": 52,
  19796. "../gui/gui": 65,
  19797. "../model/ModelManager": 140,
  19798. "../objects/Snapshot": 153,
  19799. "../settings": 166,
  19800. "../shaders": 167,
  19801. "../util/easing": 186,
  19802. "../util/lerp": 188,
  19803. "../util/logger": 189,
  19804. "../util/math": 190,
  19805. "../util/texture": 194,
  19806. "../util/transitions": 195,
  19807. three: 217
  19808. }],
  19809. 152: [function(e, t, i) {
  19810. "use strict";
  19811. function n() {
  19812. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19813. , t = new r.RawShaderMaterial({
  19814. fragmentShader: o.skysphere.fragmentShader,
  19815. vertexShader: o.skysphere.vertexShader,
  19816. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19817. side: r.BackSide,
  19818. name: "skysphere"
  19819. });
  19820. t.uniforms.radius.value = e.parameters.radius,
  19821. r.Mesh.call(this, e, t)
  19822. }
  19823. var r = e("three")
  19824. , o = e("../shaders")
  19825. , a = e("../settings");
  19826. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19827. t.exports = n
  19828. }
  19829. , {
  19830. "../settings": 166,
  19831. "../shaders": 167,
  19832. three: 217
  19833. }],
  19834. 153: [function(r, o, e) {
  19835. (function(e) {
  19836. "use strict";
  19837. function t(e) {
  19838. n.call(this, e),
  19839. this.sid = e.sid,
  19840. this.panoId = e.panoId,
  19841. this.orthoZoom = e.orthoZoom,
  19842. this.floorVisibility = e.floorVisibility,
  19843. this.thumbUrl = e.thumbUrl,
  19844. this.name = e.name,
  19845. this.zoom = e.zoom
  19846. }
  19847. var i = (r("three"),
  19848. r("../util/logger"))
  19849. , n = (r("../settings"),
  19850. r("../enum/Viewmode"),
  19851. r("../util/common"),
  19852. r("../util/transitions"),
  19853. r("../util/lerp"),
  19854. r("../util/ajax"),
  19855. r("../util/texture"),
  19856. r("./View"));
  19857. r("events").EventEmitter,
  19858. new i(e),
  19859. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19860. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19861. }
  19862. ,
  19863. o.exports = t
  19864. }
  19865. ).call(this, "/js/objects/Snapshot.js")
  19866. }
  19867. , {
  19868. "../enum/Viewmode": 51,
  19869. "../settings": 166,
  19870. "../util/ajax": 181,
  19871. "../util/common": 185,
  19872. "../util/lerp": 188,
  19873. "../util/logger": 189,
  19874. "../util/texture": 194,
  19875. "../util/transitions": 195,
  19876. "./View": 154,
  19877. events: 202,
  19878. three: 217
  19879. }],
  19880. 154: [function(o, a, e) {
  19881. (function(e) {
  19882. "use strict";
  19883. function t(e) {
  19884. e = e || {},
  19885. this.position = new i.Vector3,
  19886. this.quaternion = new i.Quaternion,
  19887. this.update(e)
  19888. }
  19889. var i = o("three")
  19890. , n = o("../util/logger")
  19891. , r = (o("../settings"),
  19892. o("../enum/Viewmode"),
  19893. o("../util/common"),
  19894. o("../util/transitions"),
  19895. o("../util/lerp"),
  19896. o("../util/ajax"),
  19897. o("../util/texture"),
  19898. o("events").EventEmitter);
  19899. new n(e),
  19900. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19901. return !!this.cameraMode
  19902. }
  19903. ,
  19904. t.prototype.update = function(e) {
  19905. return this.cameraMode = e.cameraMode || this.cameraMode,
  19906. this.pano = e.pano || this.pano,
  19907. e.position && this.position.copy(e.position),
  19908. e.quaternion && this.quaternion.copy(e.quaternion),
  19909. this
  19910. }
  19911. ,
  19912. a.exports = t
  19913. }
  19914. ).call(this, "/js/objects/View.js")
  19915. }
  19916. , {
  19917. "../enum/Viewmode": 51,
  19918. "../settings": 166,
  19919. "../util/ajax": 181,
  19920. "../util/common": 185,
  19921. "../util/lerp": 188,
  19922. "../util/logger": 189,
  19923. "../util/texture": 194,
  19924. "../util/transitions": 195,
  19925. events: 202,
  19926. three: 217
  19927. }],
  19928. 155: [function(J, ee, e) {
  19929. (function(e) {
  19930. "use strict";
  19931. function t(e) {
  19932. this.currentPano = null,
  19933. this.nextPano = null,
  19934. this.camera = null,
  19935. this.paused = !1,
  19936. this.flying = !1,
  19937. this.sceneIntersectionPlane = null,
  19938. this.target = new B.Vector3,
  19939. this.mouse = new B.Vector3(1.1,1.1,.5),
  19940. this.mouseAtMouseDown = new B.Vector2,
  19941. this.mouseCouldBeClickToMove = !1,
  19942. this.mouseLastMoveTime = Date.now(),
  19943. this.mouseDown = !1,
  19944. this.mouseDownTimer = null,
  19945. this.couldBeLongTap = !1,
  19946. this.containsMouse = !0,
  19947. this.isTouchEvent = !1,
  19948. this.isPanoHover = !1,
  19949. this.reticule = new n(this),
  19950. this.panoMarkers = [],
  19951. this.spider = new s(this),
  19952. this.quaternion = new B.Quaternion,
  19953. this.position = new B.Vector3(15,10,15),
  19954. this.previousState = null,
  19955. this.lastInsideView = new o,
  19956. this.last360View = new o,
  19957. this.raycaster = new B.Raycaster,
  19958. this.intersect = null,
  19959. this.lastChangeTime = Date.now(),
  19960. this.history = new h,
  19961. this.cameraControls = null,
  19962. this.path = null,
  19963. this.model = null,
  19964. this.domElement = null,
  19965. this.cachedPanoCandidates = null,
  19966. this.basePanoSize = 0,
  19967. this.standardPanoSize = 0,
  19968. this.highPanoSize = 0,
  19969. this.ultraHighPanoSize = 0,
  19970. this.zoomLevel = 1,
  19971. this.zooming = 0,
  19972. this.zoomSpeed = .5,
  19973. this.scrollZoomSpeed = .06,
  19974. this.zoomSpeedAdjust = .05,
  19975. this.defaultZoomIncrement = .2,
  19976. this.baseFov = k.insideFOV,
  19977. this.zoomFov = this.baseFov,
  19978. this.zoomEnabled = !0,
  19979. this.preRenderingEnabled = !1,
  19980. this.setupCustomProperties(e),
  19981. this.zoomStats = new v,
  19982. this.modeTran = ''//'dollhouse-panorama'
  19983. this.currentCursor = '';
  19984. window.player = this
  19985. }
  19986. var B = J("three")
  19987. , i = J("./util/logger")
  19988. , n = J("./objects/Reticule")
  19989. , a = J("./objects/Panorama")
  19990. , r = J("./objects/ShowPath")
  19991. , o = J("./objects/View")
  19992. , s = (J("./objects/Snapshot"),
  19993. J("./objects/NSpider"))
  19994. , V = J("./enum/Viewmode")
  19995. , T = (J("./enum/TagStates"),
  19996. J("./enum/Vectors"))
  19997. , l = J("./enum/Keys")
  19998. , k = (J("./enum/AlignmentType"),
  19999. J("./settings"))
  20000. , x = J("./util/common")
  20001. , U = (J("./util/browser"),
  20002. J("./util/math"))
  20003. , H = J("./util/lerp")
  20004. , z = J("./util/easing")
  20005. , G = J("./util/transitions")
  20006. , c = J("events").EventEmitter
  20007. , h = (J("./shaders"),
  20008. J("./util/history"))
  20009. , S = (J("./util/camera"),
  20010. J("./model/ModelManager"),
  20011. J("./enum/PathDiscardMode"))
  20012. , M = J("./enum/PathDisplayMode")
  20013. , W = J("./enum/PlayerEvents")
  20014. , u = J("./enum/ControlEvents")
  20015. , d = J("./enum/ModelManagerEvents")
  20016. , R = J("./enum/WarpStyle")
  20017. , P = J("./enum/BlackoutStyle")
  20018. , p = J("./exception/BasicException")
  20019. , f = J("./enum/PanoSizeClass")
  20020. , g = (J("./tile/TileDownloader"),
  20021. J("./tile/TilePrioritizer"))
  20022. , m = (J("./enum/PanoramaEvents"),
  20023. J("./enum/ZoomEvents"))
  20024. , v = J("./util/ZoomStats")
  20025. , y = J("./constants")
  20026. , j = J("./util/common")
  20027. , A = J("./util/cameraLight")
  20028. //, C = J("hot")
  20029. , Y = new i(e)
  20030. , q = Object.freeze({
  20031. FlyToPano: G.getUniqueId(),
  20032. FlyToNewMode: G.getUniqueId(),
  20033. FlyToSameMode: G.getUniqueId(),
  20034. FlyToViewFloor: G.getUniqueId(),
  20035. LookTransition: G.getUniqueId(),
  20036. ZoomTransition: G.getUniqueId()
  20037. });
  20038. function I(e) {
  20039. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20040. o[r] = n.charCodeAt(r);
  20041. return new Blob([o],{
  20042. type: i
  20043. })
  20044. }
  20045. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20046. this.modelManager = e.modelManager,
  20047. this.tileDownloader = e.tileDownloader,
  20048. this.panoRenderer = e.panoRenderer,
  20049. this.qualityManager = e.qualityManager,
  20050. this.domElement = e.container,
  20051. this.camera = e.camera,
  20052. this.tagManager = e.tagManager,
  20053. this.cameraControls = e.controls,
  20054. this.path = new r(e.director,this,e.controls),
  20055. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20056. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20057. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20058. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20059. this.tileDownloader.processPriorityQueue = !1,
  20060. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20061. this.bindEvents(e.container),
  20062. this.updateModel()
  20063. }
  20064. ,
  20065. t.prototype.screenShot = function(i) {
  20066. if (!this.flying && !this.flyingToTag) {
  20067. var n = this.sceneRenderer;
  20068. n.updateScreenSize(i)
  20069. this.model.panos.forEach(e=>{
  20070. if(e.marker){
  20071. e.marker.forceHide = e.marker.visible
  20072. e.marker.visible = !1;
  20073. }
  20074. })
  20075. /* for (var e in this.model.hots)
  20076. this.model.hots[e].mesh.visible = !1; */
  20077. player.model.hotGroup.visible = false
  20078. this.reticule.visible = !1,
  20079. this.reticule.forceUnvisible = !0,
  20080. this.path.currentPanoMarker.mesh.visible = !1,
  20081. setTimeout(function() {
  20082. n.renderer.clear(!0, !0, !0),
  20083. n.renderer.render(n.scene, n.camera);
  20084. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20085. i.f && i.f(e)
  20086. n.updateScreenSize({
  20087. resize: !0
  20088. })
  20089. this.reticule.visible = !0
  20090. player.model.hotGroup.visible = true
  20091. this.model.panos.forEach(e=>{
  20092. e.marker && (e.marker.visible = e.marker.forceHide);
  20093. })
  20094. this.path.currentPanoMarker.mesh.visible = !0,
  20095. n.renderer.render(n.scene, n.camera)
  20096. }
  20097. .bind(this), 30)
  20098. }
  20099. }
  20100. ;
  20101. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20102. t.prototype.getWrapShot = function() {
  20103. var i = this.getSnapAngleInfo()
  20104. , n = ",{\r\t" + i
  20105. , r = arguments[0];
  20106. this.screenShot({
  20107. width: g_snapShotWidth,
  20108. height: g_snapShotHeight,
  20109. type: "image/jpeg",
  20110. f: function(e) {
  20111. if (r && r.__callback)
  20112. return r.__callback(e, i);
  20113. var t = new Image;
  20114. t.src = e,
  20115. t.onload = function() {
  20116. var e = function(r, i) {
  20117. function n(e, t) {
  20118. var i = o || r
  20119. , n = document.createElement("canvas");
  20120. n.width = i.width,
  20121. n.height = i.height,
  20122. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20123. o = Q(e, n, t)
  20124. }
  20125. function e() {
  20126. var e = o || r
  20127. , t = I(e.src);
  20128. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20129. t = I(e.src)),
  20130. (o = o || new Image).base64Src = e.src,
  20131. o.src = window.URL.createObjectURL(t)
  20132. }
  20133. var o, t = Math.max(r.width, r.height);
  20134. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20135. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20136. e())),
  20137. o || r
  20138. }(this, {
  20139. maxSize: g_snapShotWidth,
  20140. oldType: "jpeg"
  20141. });
  20142. e.src.replace(function(e) {
  20143. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20144. }("image/jpeg"), "image/octet-stream");
  20145. var t = "snap" + (new Date).getTime();
  20146. !function(e, t) {
  20147. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20148. i.href = e,
  20149. i.download = t;
  20150. var n = document.createEvent("MouseEvents");
  20151. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20152. i.dispatchEvent(n)
  20153. }(e.src, t + ".jpg"),
  20154. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20155. n += '\r\t"sid":"' + t + '",',
  20156. n += '\r\t"name":"' + t + '"\r}',
  20157. logData(n)
  20158. }
  20159. }
  20160. })
  20161. }
  20162. /* ,
  20163. t.prototype.getSnapAngleInfo = function() {
  20164. var e = {}
  20165. , t = '"metadata":{'
  20166. , i = this.camera.quaternion.clone();
  20167. switch (this.mode) {
  20168. case "panorama":
  20169. e.scan_id = this.currentPano.id,
  20170. t += '"scan_id":"' + this.currentPano.id + '",';
  20171. break;
  20172. case "floorplan":
  20173. e.camera_mode = 1,
  20174. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20175. t += '"camera_mode":1,',
  20176. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20177. break;
  20178. case "dollhouse":
  20179. e.camera_mode = 2,
  20180. t += '"camera_mode":2,'
  20181. }
  20182. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20183. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20184. n.x *= -1,
  20185. n.w *= -1,
  20186. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20187. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20188. e.zoom = this.zoomLevel,
  20189. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20190. }
  20191. , */
  20192. t.prototype.getSnapAngleInfo = function(){
  20193. var info = {};
  20194. var str = '"metadata":{';
  20195. var q = this.camera.quaternion.clone();
  20196. switch (this.mode) {
  20197. case "panorama":
  20198. info.scan_id = this.currentPano.id;
  20199. str += ('"scan_id":"'+this.currentPano.id+'",');
  20200. break;
  20201. case "floorplan":
  20202. info.camera_mode = 1;
  20203. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20204. q.multiply(this.camera.quaternion);
  20205. str += ('"camera_mode":1,');
  20206. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20207. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20208. break;
  20209. case "dollhouse":
  20210. info.camera_mode = 2;
  20211. str += ('"camera_mode":2,');
  20212. break;
  20213. }
  20214. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20215. //console.log(info.camera_position)
  20216. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20217. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20218. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20219. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20220. out.x *= -1;
  20221. out.w *= -1;
  20222. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20223. }else{
  20224. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20225. } */
  20226. info.zoom = this.zoomLevel;
  20227. //console.log(info.camera_quaternion)
  20228. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20229. // fyz 扩展编辑页面, 加上导览点缩放值
  20230. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20231. console.log(str)
  20232. return str;
  20233. }
  20234. //------end
  20235. ,
  20236. t.prototype.setupCustomProperties = function(e) {
  20237. var i = e || V.PANORAMA;
  20238. Object.defineProperty(this, "mode", {
  20239. get: function() {
  20240. return i
  20241. },
  20242. set: function(e) {
  20243. var t = i;
  20244. i = e,
  20245. this.onModeUpdated(t, i)
  20246. }
  20247. })
  20248. }
  20249. ,
  20250. t.prototype.isInMode = function() {
  20251. for (var e = 0; e < arguments.length; e++)
  20252. if (this.mode === arguments[e])
  20253. return !0;
  20254. return !1
  20255. }
  20256. ,
  20257. t.prototype.isOutsideMode = function(e) {
  20258. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20259. }
  20260. ,
  20261. t.prototype.is360View = function(e, t) {
  20262. return e === V.PANORAMA && t && !t.isAligned()
  20263. }
  20264. ,
  20265. t.prototype.setScene = function(e) {
  20266. this.sceneIntersectionPlane = e.plane,
  20267. this.path.setScene(e),
  20268. this.moveReticuleToScene(e)
  20269. }
  20270. ,
  20271. t.prototype.moveReticuleToScene = function(e) {
  20272. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20273. e.add(this.reticule)
  20274. }
  20275. ,
  20276. t.prototype.updateModel = function() {
  20277. function n(e) {
  20278. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20279. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20280. , n = t.position.y + (e - i.target.y)
  20281. , r = k.showFloorDuration + k.showFloorDelay;
  20282. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20283. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20284. }
  20285. this.model = this.modelManager.getActiveModel(),
  20286. this.model.on("floor.changed", function(e, t, i) {
  20287. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20288. }
  20289. .bind(this)),
  20290. this.model.on("allfloors.toggled", function(e, t) {
  20291. if (this.mode === V.DOLLHOUSE) {
  20292. var i = e ? this.model.center.y : i = t.center.y;
  20293. n.call(this, i)
  20294. }
  20295. }
  20296. .bind(this)),
  20297. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20298. var t = this;
  20299. this.model.panos.list.forEach(function(e) {
  20300. e.vrMarker.addEventListener("click", function() {
  20301. t.flyToPano({
  20302. pano: e
  20303. })
  20304. })
  20305. })
  20306. }
  20307. ,
  20308. t.prototype.updateModelDependentData = function() {
  20309. this.cameraControls.setModelForControls(this.model),
  20310. this.getPanoMarkersFromModel(this.model)
  20311. }
  20312. ,
  20313. t.prototype.onModelChanged = function() {
  20314. this.updateModel(),
  20315. this.updateModelDependentData()
  20316. }
  20317. ,
  20318. t.prototype.getPanoMarkersFromModel = function(e) {
  20319. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20320. return t.marker ? e.concat(t.marker) : e
  20321. }, [])
  20322. }
  20323. ,
  20324. t.prototype.handleControlMove = function(e) {
  20325. this.emit(W.Move, e)
  20326. }
  20327. ,
  20328. t.prototype.handleControlInputStart = function(e) {
  20329. this.emit(W.InputStart, e)
  20330. }
  20331. ,
  20332. t.prototype.onModeUpdated = function(e, t) {
  20333. this.cameraControls.activateControls(t),
  20334. this.emit(W.ModeChanged, e, t)
  20335. }
  20336. ,
  20337. t.prototype.isWarping = function() {
  20338. return this.path.warping
  20339. }
  20340. ,
  20341. t.prototype.isWaitingToWarp = function() {
  20342. return this.path.waitingToWarp
  20343. }
  20344. ,
  20345. t.prototype.getLabelScaleFactor = function() {
  20346. if (this.isOutsideMode()) {
  20347. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20348. }
  20349. return .5
  20350. }
  20351. ,
  20352. t.prototype.bindEvents = function(e) {
  20353. e !== document && e.setAttribute("tabindex", -1),
  20354. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20355. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20356. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20357. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20358. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20359. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20360. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20361. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20362. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20363. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20364. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20365. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20366. document.addEventListener("pointerup", ()=>{//add
  20367. window.transformControls && transformControls.onPointerUp()
  20368. }),
  20369. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20370. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20371. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20372. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20373. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20374. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20375. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20376. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20377. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20378. window.getSeft && getSeft(this)
  20379. }
  20380. ,
  20381. t.prototype.onMouseDown = function(e) {
  20382. e.currentTarget !== document && e.currentTarget.focus(),
  20383. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20384. this.updateIntersect())
  20385. }
  20386. ,
  20387. t.prototype.onMouseMove = function(e) {
  20388. this.isTouchEvent = !1,
  20389. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20390. }
  20391. ,
  20392. t.prototype.onMouseOver = function(e) {
  20393. this.containsMouse = !0,
  20394. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20395. }
  20396. ,
  20397. t.prototype.onMouseOut = function(e) {
  20398. this.containsMouse = !1
  20399. }
  20400. ,
  20401. t.prototype.onMouseUp = function(e) {
  20402. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20403. }
  20404. ,
  20405. t.prototype.onTouchStart = function(e) {
  20406. if (e.currentTarget !== document && e.currentTarget.focus(),
  20407. !this.mouseDown) {
  20408. this.couldBeLongTap = !0;
  20409. var t = x.average(e.changedTouches, "clientX")
  20410. , i = x.average(e.changedTouches, "clientY");
  20411. this.handleInputStart.call(this, t, i, !0),
  20412. this.mouseDownTimer = setTimeout(function() {
  20413. this.updateIntersect(),
  20414. this.handleInputEnd.call(this, t, i, !0)
  20415. }
  20416. .bind(this), k.input.longTapThreshold)
  20417. }
  20418. }
  20419. ,
  20420. t.prototype.onTouchMove = function(e) {
  20421. var t = x.average(e.changedTouches, "clientX")
  20422. , i = x.average(e.changedTouches, "clientY");
  20423. this.handleInputMove.call(this, t, i, !0)
  20424. }
  20425. ,
  20426. t.prototype.onTouchEnd = function(e) {
  20427. if (clearTimeout(this.mouseDownTimer),
  20428. this.mouseDown) {
  20429. this.couldBeLongTap = !1,
  20430. this.updateIntersect();
  20431. var t = x.average(e.changedTouches, "clientX")
  20432. , i = x.average(e.changedTouches, "clientY");
  20433. this.handleInputEnd.call(this, t, i, !0)
  20434. }
  20435. }
  20436. ,
  20437. t.prototype.onPointerDown = function(e) {
  20438. return e.currentTarget !== document && e.currentTarget.focus(),
  20439. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20440. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20441. void (this.mouseDownTimer = setTimeout(function() {
  20442. this.updateIntersect(),
  20443. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20444. }
  20445. .bind(this), k.input.longTapThreshold)))
  20446. }
  20447. ,
  20448. t.prototype.onPointerMove = function(e) {
  20449. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20450. }
  20451. ,
  20452. t.prototype.onPointerUp = function(e) {
  20453. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20454. this.couldBeLongTap = !1,
  20455. this.updateIntersect(),
  20456. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20457. }
  20458. ,
  20459. t.prototype.onPointerOut = function(e) {
  20460. this.mouseDown = !1
  20461. }
  20462. ,
  20463. t.prototype.onPointerCancel = function(e) {
  20464. this.mouseDown = !1
  20465. }
  20466. ,
  20467. t.prototype.onKeyDown = function(e) {
  20468. var t = function() {
  20469. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20470. }
  20471. .bind(this)
  20472. , i = e.which;
  20473. switch (i) {
  20474. case l.F:
  20475. t(),
  20476. this.changeFloor(-1);
  20477. break;
  20478. case l.R:
  20479. t(),
  20480. this.changeFloor(1)
  20481. }
  20482. if (this.mode === V.PANORAMA)
  20483. switch (i) {
  20484. case l.UPARROW:
  20485. case l.W:
  20486. this.flyLocalDirection(T.FORWARD.clone());
  20487. break;
  20488. case l.DOWNARROW:
  20489. case l.S:
  20490. this.flyLocalDirection(T.BACK.clone());
  20491. break;
  20492. case l.A:
  20493. this.flyLocalDirection(T.LEFT.clone());
  20494. break;
  20495. case l.D:
  20496. this.flyLocalDirection(T.RIGHT.clone())
  20497. }
  20498. }
  20499. ,
  20500. t.prototype.handleScrollPinchZoom = function(e) {
  20501. var t = e
  20502. , i = this.zoomLevel;
  20503. this.zoomBy(t),
  20504. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20505. }
  20506. ,
  20507. t.prototype.handleControlPinch = function(e) {
  20508. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20509. }
  20510. ,
  20511. t.prototype.handleControlScroll = function(e) {
  20512. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20513. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20514. }
  20515. ,
  20516. t.prototype.handleInputStart = function(e, t, i) {
  20517. var n = this.handelPadding(e, t);
  20518. e = n.x,
  20519. t = n.y,
  20520. this.isTouchEvent = i,
  20521. U.convertScreenPositionToNDC(e, t, this.mouse),
  20522. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20523. this.mouseCouldBeClickToMove = !0,
  20524. this.mouseDown = !0
  20525. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20526. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20527. window.transformControls && transformControls.onPointerDown()
  20528. }
  20529. ,
  20530. t.prototype.handelPadding = function(e, t) {
  20531. return this.pad || (this.pad = {
  20532. x: dom.getOffset("left", $("#player")[0]),
  20533. y: dom.getOffset("top", $("#player")[0])
  20534. }),
  20535. {
  20536. x: e - this.pad.x,
  20537. y: t - this.pad.y
  20538. }
  20539. }
  20540. ,
  20541. t.prototype.handleInputMove = function(e, t, i) {
  20542. var n = this.handelPadding(e, t);
  20543. e = n.x,
  20544. t = n.y,
  20545. this.isTouchEvent = i,
  20546. U.convertScreenPositionToNDC(e, t, this.mouse);
  20547. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20548. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20549. this.couldBeLongTap = !1,
  20550. clearTimeout(this.mouseDownTimer)),
  20551. this.mouseLastMoveTime = Date.now(),
  20552. this.reticule.move(e, t, i)
  20553. window.transformControls && transformControls.onPointerMove()
  20554. }
  20555. ,
  20556. t.prototype.handleInputEnd = function(e, t, i) {
  20557. if (this.isTouchEvent = i,
  20558. this.mouseDown = !1,
  20559. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20560. !i && this.couldBeLongTap)
  20561. return !0;
  20562. if (this.handleLongTap())
  20563. return !0;
  20564. window.transformControls && transformControls.onPointerUp()
  20565. if (this.mouseCouldBeClickToMove) {
  20566. if (this.flying)
  20567. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20568. !0;
  20569. //add----
  20570. if (this.checkHotClick())
  20571. return !0;
  20572. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20573. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20574. return;
  20575. }
  20576. if (window.VisiSet && VisiSet.setTagVisible ) {
  20577. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20578. return;
  20579. }
  20580. if (window.VisiSet && VisiSet.setPanoLog ) {
  20581. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  20582. return;
  20583. }
  20584. if(this.hoveringPlane){
  20585. this.clickOverlay(this.hoveringPlane)
  20586. return;
  20587. }
  20588. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20589. return EditOverlay.addPlane({intersect:this.intersect});
  20590. }
  20591. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20592. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20593. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20594. } */
  20595. //----------
  20596. if(this.intersect){// for cad add door etc.
  20597. let result = {}
  20598. this.emit('getIntersect', this.intersect, (state)=>{//consume
  20599. result.consume = true
  20600. })
  20601. if(result.consume)return; //有效使用了,就return
  20602. }
  20603. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20604. this.history.invalidate(),
  20605. this.intersect)
  20606. return this.flyToPanoClosestToMouse();
  20607. if (this.mode === V.PANORAMA) {
  20608. var n = this.closestPanoInDirection(this.getMouseDirection());
  20609. return n ? this.flyToPano({
  20610. pano: n
  20611. }) : this.bump(this.getMouseDirection())
  20612. }
  20613. }
  20614. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20615. }
  20616. ,
  20617. t.prototype.handleLongTap = function() {
  20618. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20619. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20620. !0
  20621. }
  20622. ,
  20623. t.prototype.checktagClick = function() {
  20624. if (this.tagManager.intersectTag) {
  20625. var e = this.isTouchEvent
  20626. , t = this.tagManager.clickedOnTag(e, this);
  20627. return e || t || G.cancelById(q.LookTransition),
  20628. !0
  20629. }
  20630. if (this.tagManager.activeTag)
  20631. return this.tagManager.dismissActiveTag(),
  20632. !1
  20633. }
  20634. ,
  20635. t.prototype.rankedtagInDirection = function(e, t) {
  20636. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20637. }
  20638. ,
  20639. t.prototype.start = function(e) {
  20640. $(".toolLeft").removeClass("unable");
  20641. $(".toolTop").removeClass("unable");
  20642. //-------------------
  20643. window.initTransformCtl(B)
  20644. //this.model.loadOverlays()
  20645. //window.EditOverlay && window.EditOverlay.init(B);
  20646. window.VisiSet && VisiSet.init()
  20647. //-------------------
  20648. var t = e.mode
  20649. , i = e.pano
  20650. , n = e.position
  20651. , r = e.quaternion
  20652. , o = e.tag
  20653. , a = e.quickstart
  20654. , s = $.Deferred();
  20655. this.updateModelDependentData(),
  20656. this.updateFromControls(),
  20657. this.findDefaultViews();
  20658. var l = this.is360View(t, i);
  20659. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20660. s.done(function(e) {
  20661. this.emit(W.Ready, l, e, o)
  20662. }
  20663. .bind(this)),
  20664. s.promise()
  20665. }
  20666. ,
  20667. t.prototype.startOutside = function(e, t) {
  20668. var i = e.mode
  20669. , n = e.pano
  20670. , r = e.position
  20671. , o = e.quaternion
  20672. , a = e.zoom
  20673. , s = e.floorVisibility
  20674. , l = e.tag;
  20675. this.emit(W.StartOutside, k[i].transitionTime),
  20676. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20677. G.cancelById(q.FlyToViewFloor),
  20678. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20679. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20680. }
  20681. ,
  20682. t.prototype.startInside = function(e, t, i, n, r) {
  20683. r = r || $.Deferred();
  20684. var o = (this.currentPano = e) && !e.isAligned();
  20685. window.bus.dispatchEvent({type:'playerAndModelReady'})
  20686. if (t = o ? e.position : t || e.position,
  20687. i = i || e.quaternion,
  20688. e) {
  20689. var a = this.startInside.bind(this, e, t, i, n, r);
  20690. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20691. return
  20692. }
  20693. //add
  20694. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20695. //this.updateHotVisible()
  20696. //EditOverlay.updatePano()
  20697. editTool.hotpoint.updatePano()
  20698. Hot.updateVisibles([this.currentPano])
  20699. return this.mode = V.PANORAMA,
  20700. e.floor.enter(this.mode),
  20701. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20702. this.switchCameraMode(this.mode, i),
  20703. this.emit(W.StartInside, o),
  20704. r.resolve(!0),
  20705. r
  20706. }
  20707. ,
  20708. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20709. if (r = r || $.Deferred(),
  20710. this.dollhouseMode(),
  20711. !i)
  20712. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20713. r.resolve(!1),
  20714. r;
  20715. e = e || i.position;
  20716. var o = n || this.cameraControls.activeControl.camera.quaternion
  20717. , a = i.position;
  20718. return this.fitDollhouse(a, e, o),
  20719. setTimeout(function(e) {
  20720. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20721. var t = {
  20722. mode: V.PANORAMA,
  20723. pano: i,
  20724. quaternion: n,
  20725. callback: function() {
  20726. this.emit(W.FlyinFinished),
  20727. r.resolve(!0)
  20728. }
  20729. .bind(this)
  20730. };
  20731. this.flyToNewMode(t)
  20732. }
  20733. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20734. r
  20735. }
  20736. ,
  20737. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20738. K = {},
  20739. function(t, e, i, n, r, o, a, s, l, c) {
  20740. if (function() {
  20741. for (var e in Z)
  20742. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20743. return !0;
  20744. return !1
  20745. }())
  20746. return !0;
  20747. var h = function(e, t, i) {
  20748. j.delayOneFrame(function() {
  20749. Z[e] = !1,
  20750. r && r(t, i)
  20751. }
  20752. .bind(this))
  20753. }
  20754. .bind(this, t.id)
  20755. , u = function(e, t) {
  20756. j.delayOneFrame(function() {
  20757. Z[e] = !1,
  20758. o && o(t)
  20759. }
  20760. .bind(this))
  20761. }
  20762. .bind(this, t.id);
  20763. try {
  20764. return null != s || (s = !0),
  20765. 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),
  20766. Z[t.id] && (K[t.id] = performance.now()),
  20767. Z[t.id]
  20768. } catch (e) {
  20769. throw Z[t.id] = !1,
  20770. K[t.id] = performance.now() - 5e3,
  20771. e
  20772. }
  20773. }
  20774. ),
  20775. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20776. if (!e)
  20777. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20778. return r && this.model.waitForLoad(e, function() {
  20779. return e.isLoaded(i)
  20780. }),
  20781. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20782. !0)
  20783. }
  20784. ,
  20785. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20786. function(e, t, i, n, r, o, a, s) {
  20787. if (!e)
  20788. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20789. return X.copy(T.FORWARD),
  20790. this.getDirection(X),
  20791. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20792. return e.isLoaded(t)
  20793. }),
  20794. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20795. i && i(e, t)
  20796. }
  20797. .bind(this)).fail(function(e) {
  20798. n && n(e)
  20799. }
  20800. .bind(this)).progress(function(e, t, i) {
  20801. r && r(e, t, i)
  20802. }
  20803. .bind(this)),
  20804. !0)
  20805. }
  20806. ),
  20807. t.prototype.switchCameraMode = function(e, t) {
  20808. var i = this.cameraControls.controls[e]
  20809. , n = i.camera;
  20810. switch (e) {
  20811. case V.PANORAMA:
  20812. n.position.copy(this.currentPano.position);
  20813. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20814. i.lookAt(r.add(n.position));
  20815. break;
  20816. case V.DOLLHOUSE:
  20817. var o = this.position.clone();
  20818. this.mode === V.PANORAMA ? o.add(new B.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  20819. n.position.copy(o),
  20820. i.target.copy(this.target.clone().setY(this.model.center.y));
  20821. break;
  20822. //for多楼层 且 让模型刚好适应屏幕
  20823. /* var box = this.model.boundingBox.clone();
  20824. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20825. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20826. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20827. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20828. console.log(boxSize.x,distance, boxSize.length() / 2)
  20829. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20830. if(this.mode === V.PANORAMA){
  20831. i.target.copy(this.model.center);
  20832. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20833. }else{
  20834. i.target.copy(this.target.clone().setY(this.model.center.y))
  20835. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20836. }
  20837. vec.multiplyScalar(distance )
  20838. n.position.copy(i.target.clone().add(vec)) */
  20839. break
  20840. case V.FLOORPLAN:
  20841. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20842. i.target.copy(this.model.center).setY(0),
  20843. i.zoomToContain(this.model.size),
  20844. i.rotateToView(this.model.size, this.getDirection())
  20845. }
  20846. i.update(0)
  20847. }
  20848. ,
  20849. t.prototype.update = (new B.Vector3,
  20850. N = {},
  20851. F = [],
  20852. function(e) {
  20853. this.updatePersistentZooming(e),
  20854. this.updateFromControls(e),
  20855. this.getCurrentNodePanos(F)
  20856. if(this.hasChanged(N)){
  20857. this.lastChangeTime = Date.now(),
  20858. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20859. this.emit(W.ViewChanged, N)
  20860. //add:
  20861. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) VisiSet.updateFootIconSize();
  20862. //this.intersectHot && this.intersectHot.showTitle()
  20863. //editTool.hotpoint.showTitileSpots && editTool.hotpoint.showTitileSpots.forEach(e=>e.showTitle())
  20864. for(var i in this.model.hots){
  20865. this.model.hots[i].update(this)
  20866. this.model.hots[i].updateTitle(this)
  20867. }
  20868. /* if(this.mode == 'panorama')this.model.hotGroup&&this.model.hotGroup.children.forEach(overlay=>{
  20869. overlay.update()
  20870. }) */
  20871. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20872. }
  20873. this.model.supportsTiles && (this.updateTileDownloader(F),
  20874. this.updatePanoRenderer(F)),
  20875. this.updatePreRendering(F),
  20876. this.reticule.update(),
  20877. this.path.update(),
  20878. this.spider.update(),
  20879. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20880. this.updateControlLocks(),
  20881. this.model.supportsTiles && this.updateZoomPano()
  20882. }
  20883. ),
  20884. t.prototype.updatePersistentZooming = function(e) {
  20885. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20886. }
  20887. ,
  20888. t.prototype.updateControlLocks = function() {
  20889. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20890. }
  20891. ,
  20892. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20893. function(e) {
  20894. var t = this.nextPano || this.currentPano;
  20895. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20896. this.getDirection(D),
  20897. this.panoRenderer.updateDirection(D))
  20898. }
  20899. ),
  20900. t.prototype.cleanupInactivePanos = (O = [],
  20901. L = [],
  20902. function() {
  20903. O.length = 0,
  20904. O.push(this.currentPano),
  20905. this.nextPano && O.push(this.nextPano);
  20906. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20907. L.push(this.panoRenderer.activePanos[e]);
  20908. for (var t = 0; t < L.length; t++) {
  20909. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20910. i.id === O[r].id && (n = !1);
  20911. n && i.exit()
  20912. }
  20913. }
  20914. ),
  20915. t.prototype.updatePreRendering = (w = {},
  20916. function(e) {
  20917. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20918. var t = this.nextPano || this.currentPano;
  20919. if (t && e && 1 < e.length) {
  20920. var i = e.findIndex(function(e) {
  20921. if (e.id === t.id)
  20922. return !0
  20923. });
  20924. if (0 <= i && i + 1 < e.length) {
  20925. var n = e[i + 1];
  20926. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20927. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20928. window.setTimeout(function(e) {
  20929. w[e.id] = !1
  20930. }
  20931. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20932. }
  20933. .bind(this, n), k.tiling.panoPreRenderDelay),
  20934. w[n.id] = !0)
  20935. }
  20936. }
  20937. }
  20938. }
  20939. ),
  20940. t.prototype.enablePreRendering = function() {
  20941. this.preRenderingEnabled = !0
  20942. }
  20943. ,
  20944. t.prototype.disablePreRendering = function() {
  20945. this.preRenderingEnabled = !1,
  20946. this.cleanupInactivePanos()
  20947. }
  20948. ,
  20949. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20950. function(e) {
  20951. var t = this.nextPano || this.currentPano;
  20952. t && (b.copy(T.FORWARD),
  20953. this.getDirection(b),
  20954. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20955. this.tileDownloader.processPriorityQueue = !0)
  20956. }
  20957. ),
  20958. t.prototype.updateFromControls = function(e) {
  20959. null != e || (e = 0),
  20960. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  20961. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  20962. this.position.copy(this.cameraControls.activeControl.camera.position),
  20963. this.target.copy(this.cameraControls.activeControl.target),
  20964. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  20965. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  20966. this.camera.position.copy(this.position),
  20967. this.camera.quaternion.copy(this.quaternion),
  20968. this.camera.updateMatrix(),
  20969. this.camera.updateMatrixWorld()
  20970. }
  20971. ,
  20972. t.prototype.hasChanged = function(e) {
  20973. if (!this.previousState){
  20974. e.cameraChanged = true
  20975. return this.previousState = {
  20976. allFloorsVisible: this.model.allFloorsVisible,
  20977. position: this.position.clone(),
  20978. quaternion: this.quaternion.clone(),
  20979. mouse: this.mouse.clone(),
  20980. labelScaleFactor: this.getLabelScaleFactor(),
  20981. currentFloor: this.model.currentFloor,
  20982. projectionMatrix: this.camera.projectionMatrix.clone(),
  20983. worldMatrix: this.camera.matrixWorld.clone(),
  20984. mode: this.mode,
  20985. modelPosition: this.model.position.clone(),
  20986. modelCenter: this.model.center.clone(),
  20987. zoomLevel: this.zoomLevel
  20988. },
  20989. !0;
  20990. }
  20991. //许钟文改 分成相机是否改变cameraChanged 和其他
  20992. 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)
  20993. 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 ;
  20994. e.cameraChanged = !a;
  20995. //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;
  20996. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  20997. e.moved = !this.position.equals(this.previousState.position),
  20998. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  20999. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21000. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21001. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21002. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21003. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21004. e.modeChanged = this.mode !== this.previousState.mode,
  21005. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21006. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21007. e.nextPanoActive = null !== this.nextPano,
  21008. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21009. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21010. this.previousState.position.copy(this.position),
  21011. this.previousState.quaternion.copy(this.quaternion),
  21012. this.previousState.mouse.copy(this.mouse),
  21013. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21014. this.previousState.currentFloor = this.model.currentFloor,
  21015. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21016. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21017. this.previousState.mode = this.mode,
  21018. this.previousState.modelPosition.copy(this.model.position),
  21019. this.previousState.modelCenter.copy(this.model.center),
  21020. this.previousState.zoomLevel = this.zoomLevel,
  21021. !t
  21022. }
  21023. ,
  21024. t.prototype.updateIntersect = function() {
  21025. var e = this.flying || this.isWarping()
  21026. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21027. , i = G.getById(q.LookTransition);
  21028. e || t || this.isTouchEvent || i.length && i[0].running;
  21029. {//clear:
  21030. //if(this.intersectHot) this.intersectHot.hideTitle()
  21031. if(this.intersectHot) this.intersectHot.setHoverState(false)
  21032. this.intersectHot = null
  21033. //$("#player").css("cursor", "")
  21034. CursorDeal.remove('hoverFootIcon' )
  21035. CursorDeal.remove('hoverHot' )
  21036. $(".toolRight .spotList ul li").removeClass("active")
  21037. }
  21038. var deal = ()=>{
  21039. if(this.intersect && this.intersect.object.visible ){
  21040. if("hotSprite" == this.intersect.object.type){
  21041. this.intersectHot = this.intersect.object
  21042. while(!(this.intersectHot instanceof Hot)){
  21043. this.intersectHot = this.intersectHot.parent
  21044. }
  21045. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21046. this.intersectHot.setHoverState(true)
  21047. }
  21048. }
  21049. }
  21050. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  21051. this.intersect = this.getMouseIntersect(null, this.model.hotGroup.children.concat(VisiSet.footIcons||[]) );
  21052. deal()
  21053. if(this.intersect){
  21054. CursorDeal.add('hoverFootIcon' ) //$("#player").css("cursor", "pointer");
  21055. }
  21056. if(this.intersectHot){
  21057. this.intersect = null
  21058. }
  21059. return
  21060. }else if (g_HotStatus) {//加热点
  21061. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21062. if(this.intersect){
  21063. //$("#player").css("cursor", "cell")
  21064. CursorDeal.remove('noIntersect' )
  21065. }else{
  21066. //$("#player").css("cursor", "not-allowed")
  21067. CursorDeal.add('noIntersect' )
  21068. }
  21069. return;
  21070. }else{
  21071. if(this.model.hotGroup){
  21072. if(editTool.atPanel == 'hotpoint'){
  21073. var hots = this.model.hotGroup.children
  21074. }else{
  21075. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21076. }
  21077. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21078. if(this.intersect){
  21079. deal()
  21080. this.intersectHot && CursorDeal.add('hoverHot' ) //$("#player").css("cursor", "pointer");
  21081. }
  21082. }else{
  21083. this.intersect = this.getMouseIntersect()
  21084. }
  21085. }
  21086. this.intersect && this.updateClosestPano(this.intersect),
  21087. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21088. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21089. }
  21090. ,
  21091. t.prototype.checkHotClick = function() {
  21092. if (this.intersectHot){
  21093. if (window.VisiSet && VisiSet.setTagVisible ) {
  21094. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21095. return;
  21096. }else if(editTool.atPanel == 'hotpoint'){
  21097. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21098. var sure = confirm("是否保存当前热点?")
  21099. if(sure){
  21100. editTool.hotpoint.saveHot().then(()=>{
  21101. editTool.hotpoint.editHot(this.intersectHot)
  21102. })
  21103. }else{
  21104. editTool.hotpoint.editHot(this.intersectHot)
  21105. }
  21106. }else{
  21107. editTool.hotpoint.editHot(this.intersectHot)
  21108. }
  21109. }else{
  21110. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21111. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21112. }
  21113. this.intersectHot.examine()
  21114. }
  21115. return !0
  21116. }
  21117. }
  21118. ,
  21119. t.prototype.getMouseDirection = function(e) {
  21120. e = e || this.mouse;
  21121. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21122. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21123. }
  21124. ,
  21125. /* t.prototype.hoverOverlay = function(mesh){
  21126. if(!mesh){
  21127. this.hoveringPlane = null;
  21128. $("#player").css("cursor",this.currentCursor || "" );
  21129. }else{
  21130. var overlay = mesh.parent;
  21131. $("#player").css("cursor","pointer");
  21132. this.hoveringPlane = overlay;
  21133. return true;
  21134. }
  21135. }, */
  21136. t.prototype.clickOverlay = function(overlay){
  21137. if(this.openOverlay && !overlay)return;
  21138. var plane = overlay.plane;
  21139. if(overlay.texType == "video"){
  21140. overlay.switchPlay(!!overlay.pausedByUser)
  21141. }
  21142. if(window.EditOverlay && EditOverlay.editing){
  21143. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21144. var sure = confirm("是否保存当前展览?")
  21145. if(sure){
  21146. $("#overlayProp button.submit").click()
  21147. }else{
  21148. EditOverlay.closeOverlayPanel('cancel')
  21149. }
  21150. }
  21151. EditOverlay.beginEdit(overlay);
  21152. return;
  21153. }
  21154. },
  21155. t.prototype.getMouseIntersect = function(e, t1) {
  21156. e = e || this.mouse.clone()
  21157. var t = t1 || this.model.floors.reduce(function(e, t) {
  21158. return t.hidden ? e : e.concat(t.collider.children)
  21159. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21160. t = t.slice(0)
  21161. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21162. this.raycaster.set(i, this.getMouseDirection(e));
  21163. var n = this.raycaster.intersectObjects(t , true );//add true
  21164. var o = n[0];
  21165. if(o){
  21166. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21167. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21168. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21169. o.horizontal = .8 < o.normal.y);
  21170. return o
  21171. }
  21172. }
  21173. ,
  21174. t.prototype.updateClosestPano = function(e) {
  21175. var t = [a.filters.isPanoAligned()];
  21176. if (this.mode === V.PANORAMA) {
  21177. if (!this.currentPano)
  21178. return;
  21179. t.push(a.filters.not(this.currentPano)),
  21180. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21181. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21182. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21183. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21184. } else{
  21185. t.push((pano)=>{ // add
  21186. return this.checkHasNeighbor(pano)
  21187. })
  21188. t.push(a.filters.isOnVisibleFloor()),
  21189. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21190. }
  21191. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21192. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21193. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21194. this.closestPano = i) : this.isPanoHover = !1
  21195. }
  21196. ,
  21197. t.prototype.dollhouseMode = function(e, t) {
  21198. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21199. this.mode = V.DOLLHOUSE,
  21200. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21201. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21202. , n = new B.Vector3(15,10,15);
  21203. if (e && t) {
  21204. var r = T.FORWARD.clone().applyQuaternion(t)
  21205. , o = this.model.center.clone().sub(e).dot(r);
  21206. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21207. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21208. }
  21209. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21210. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21211. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21212. this.updateFromControls(),
  21213. this.model.alpha = 1,
  21214. this.model.skybox.material.uniforms.opacity.value = 0
  21215. }
  21216. ,
  21217. t.prototype.insideMode = function(e, t) {
  21218. var i = $.Deferred()
  21219. , n = t || null;
  21220. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21221. var r = [a.filters.isPanoAligned()];
  21222. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21223. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21224. this.flyToNewMode({
  21225. mode: V.PANORAMA,
  21226. pano: e,
  21227. callback: n
  21228. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21229. } else {
  21230. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21231. i.reject(o)
  21232. }
  21233. return i.promise()
  21234. }
  21235. ,
  21236. t.prototype.fitDollhouse = function(e, t, i) {
  21237. var maxY = this.model.boundingBox.max.y;//add
  21238. var n = T.FORWARD.clone().applyQuaternion(i);
  21239. i = n.clone().add(e);
  21240. this.cameraControls.activeControl.target.copy(i),
  21241. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21242. }
  21243. ,
  21244. t.prototype.floorplanMode = function(e, t, i) {
  21245. this.mode = V.FLOORPLAN;
  21246. var n = this.cameraControls.controls[V.FLOORPLAN];
  21247. n.reset();
  21248. var r = e || this.model.center;
  21249. if (n.target.copy(r).setY(0),
  21250. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21251. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21252. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21253. t) {
  21254. var o = T.LEFT.clone().applyQuaternion(t);
  21255. n.rotateLeft(-Math.atan2(o.x, o.z))
  21256. } else
  21257. n.rotateToView(this.model.size, this.getDirection());
  21258. n.update(0)
  21259. }
  21260. ,
  21261. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21262. return e.skipWarpingCheck = !0,
  21263. this.flyToPano(e, t)
  21264. }
  21265. ,
  21266. t.prototype.updateMarkerVisi = function() {//加
  21267. if(this.mode != "panorama")return;
  21268. this.model.panos.list.forEach((pano)=>{
  21269. if(!pano.marker)return;
  21270. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21271. })
  21272. }
  21273. ,
  21274. /* t.prototype.updateHotVisible = function(pano){
  21275. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21276. var hots = this.model.hots;
  21277. pano = pano || this.currentPano;
  21278. for (var index in hots){
  21279. var visible;
  21280. if(this.mode != "panorama"){
  21281. visible = true;
  21282. }else{
  21283. //hots[index].mesh.material.depthTest = false;
  21284. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21285. }
  21286. hots[index].mesh.visible = visible;
  21287. }
  21288. }
  21289. */
  21290. t.prototype.flyToPano = function(e, t) {
  21291. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21292. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21293. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21294. if (aim){
  21295. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21296. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21297. }
  21298. else aimQua = aimQua
  21299. var zoomLevel = e.zoomLevel || 1 //add
  21300. if(this.flying) return t && t(e)
  21301. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21302. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21303. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21304. t && t(),
  21305. !1;
  21306. this.updateLastView()
  21307. if (this.mode !== V.PANORAMA)
  21308. return void this.flyToNewMode({
  21309. mode: V.PANORAMA,
  21310. pano: n,
  21311. duration: o,
  21312. quaternion: aimQua,
  21313. callback: t
  21314. });
  21315. if (!n || (h = x.deepExtend(e), u = function() {
  21316. j.delayOneFrame(function() {
  21317. this.flyToPano(h, t)
  21318. }.bind(this))
  21319. }.bind(this),
  21320. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21321. var d = function(e) {
  21322. t && t(e)
  21323. }
  21324. .bind(this);
  21325. this.currentPano || (this.currentPano = n,
  21326. this.path.placeCpm(),
  21327. this.path.fadeOutCpm(k.path.fadeOutTime),
  21328. this.spider.draw());
  21329. var p = o;
  21330. if ("number" != typeof o) {
  21331. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21332. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21333. }
  21334. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21335. zoomLevel !== this.zoomLevel)
  21336. switch (k.zoom.transitionStyle) {
  21337. case 1:
  21338. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21339. break;
  21340. case 2:
  21341. return h = x.deepExtend(e),
  21342. u = this.flyToPano.bind(this, h, t),
  21343. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21344. }
  21345. if (aimQua) {
  21346. G.cancelById(q.LookTransition),
  21347. p *= k.transition.aimSlowFactor;
  21348. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21349. , y = g.clone()
  21350. , A = new B.Vector3;
  21351. if (n === this.currentPano) {
  21352. var C = T.FORWARD.clone().applyQuaternion(g)
  21353. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21354. , E = C.angleTo(I);
  21355. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21356. void G.start(function(e) {
  21357. y.copy(g),
  21358. H.quaternion(y, aimQua)(e),
  21359. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21360. this.cameraControls.activeControl.lookAt(A)
  21361. }
  21362. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21363. }
  21364. }
  21365. if (n === this.currentPano )
  21366. return void d();
  21367. this.flying = !0;
  21368. var _ = this.position.clone()
  21369. , b = this.currentPano;
  21370. Y.debug("Flying to pano ", n.position);
  21371. this.emit(W.PanoChosen, this.currentPano, n);
  21372. this.emit(W.FlyingStarted, n.position, _, n, b);
  21373. //this.updateHotVisible(n); //更新热点显示
  21374. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21375. Hot.updateVisibles([this.currentPano, n])
  21376. aimQua && G.start(function(e) {
  21377. y.copy(g),
  21378. H.quaternion(y, aimQua)(e),
  21379. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21380. this.cameraControls.activeControl.lookAt(A)
  21381. }
  21382. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21383. var w = c ? null : z[k.transition.movementEasing];
  21384. this.nextPano = n;
  21385. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21386. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21387. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21388. this.flying = !1,
  21389. this.currentPano !== n && this.currentPano.exit(),
  21390. n.enter(),
  21391. this.currentPano = n,
  21392. this.nextPano = null,
  21393. this.path.placeCpm(),
  21394. this.path.fadeOutCpm(k.path.fadeOutTime),
  21395. this.spider.draw(),
  21396. this.emit(W.FlyingEnded, n.position, _, n, b),
  21397. this.updateMarkerVisi();//add
  21398. d(e)
  21399. if(this.mode == "panorama" ){
  21400. //EditOverlay.updatePano()
  21401. editTool.hotpoint.updatePano()
  21402. Hot.updateVisibles([this.currentPano])
  21403. }
  21404. }
  21405. .bind(this), 0, w, "camFly", q.FlyToPano)
  21406. }
  21407. }
  21408. ,
  21409. t.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  21410. if(this.flying || this.isWarping() )return;
  21411. let pano = o.pano || this.model.panos.index[o.panoId]
  21412. if(this.mode != 'panorama'){
  21413. return this.flyToNewMode({
  21414. mode : 'panorama',
  21415. pano,
  21416. quaternion: o.quaternion
  21417. })
  21418. }
  21419. let oldPos = this.position.clone();
  21420. let oldPano = this.currentPano
  21421. this.path.warpDestPano = pano
  21422. var retry = ()=>{
  21423. this.waitingToWarp = !1,
  21424. this.blackToPano(o)
  21425. }
  21426. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  21427. return void (this.waitingToWarp = !0)
  21428. this.emit("pano.chosen", oldPano, pano)
  21429. console.log('blackToPano')
  21430. this.flying = true
  21431. this.nextPano = pano //提前加载高清图片
  21432. this.path.warpDestHeroLoc = {
  21433. panoId : o.panoId,
  21434. position: pano.position,
  21435. quaternion: o.quaternion || this.quaternion.clone()
  21436. }
  21437. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  21438. pano != this.currentPano && this.currentPano.exit()
  21439. pano.enter()
  21440. this.currentPano = pano
  21441. this.emit("flying.ended", pano.position, oldPos, pano, oldPano)
  21442. this.flying = false
  21443. this.nextPano = null
  21444. this.updateMarkerVisi();//add
  21445. console.log('blackToPano end')
  21446. } )
  21447. }
  21448. window._transitionPosId = 9999
  21449. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21450. G.cancelById(_transitionPosId)
  21451. var begin = function(object, pos, qua, scale){
  21452. if(pos){
  21453. if(!same(object.position, pos, 0.01)){
  21454. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21455. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21456. }
  21457. if(qua && !same(object.quaternion, qua, 1e-6)){
  21458. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21459. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21460. }
  21461. if(scale && !same(object.scale, scale, 0.001)){
  21462. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21463. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21464. }
  21465. }
  21466. }
  21467. var same = function(vec1, vec2, diff){
  21468. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21469. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21470. return s
  21471. }
  21472. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21473. /* this.model.hotGroup.children.forEach(overlay=>{
  21474. var panoData = overlay.transformAtPanos[sid]
  21475. var useCustom = !panoData
  21476. //if(overlay.usingTransformData || !useCustom){
  21477. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21478. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21479. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21480. overlay.getScaleBySize(panoData.width , panoData.height)
  21481. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21482. begin(overlay, pos, qua, scale )
  21483. //}
  21484. overlay.usingTransformData = !useCustom
  21485. }) */
  21486. for(let i in this.model.hots){//是否判断visible?
  21487. var hot = this.model.hots[i];
  21488. var panoData = hot.info.transformAtPanos[sid];
  21489. var useCustom = !panoData
  21490. //if(hot.usingTransformData || !useCustom){
  21491. var pos = useCustom ? hot.info.position : panoData.pos;
  21492. //var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21493. begin(hot, pos/* , qua */ )
  21494. //}
  21495. //hot.usingTransformData = !useCustom;
  21496. }
  21497. }
  21498. window._tranOutsideFocus = 4399
  21499. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21500. console.log("focusPoint")
  21501. if(this.mode == "floorplan"){
  21502. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21503. var control = player.cameraControls.controls.floorplan;
  21504. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21505. var currentScale = control.absoluteScale;
  21506. var currentTarget = control.target.clone()
  21507. G.cancelById(window._tranOutsideFocus, true);
  21508. G.start(function(progress){
  21509. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21510. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21511. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21512. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21513. }else if(player.mode == "dollhouse"){
  21514. var control = player.cameraControls.controls.dollhouse;
  21515. var radius = o.radius || 8;
  21516. var currentTarget = control.target.clone()
  21517. var dir = control.offset.clone().normalize()
  21518. var currentRadius = control.offset.length();
  21519. G.cancelById(window._tranOutsideFocus, true);
  21520. G.start(function(progress){
  21521. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21522. let radius_ = radius*progress+currentRadius*(1-progress)
  21523. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21524. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21525. }else if(this.mode == 'panorama'){
  21526. this.flyToPano({
  21527. lookAtPoint: o.aim.clone() ,
  21528. pano: this.currentPano,
  21529. aimDuration: o.dur || 600
  21530. })
  21531. }
  21532. }
  21533. t.prototype.fastForwardActivePanoFlight = function(e) {
  21534. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21535. G.adjustSpeed(q.FlyToPano, e),
  21536. G.adjustSpeed(q.LookTransition, e)
  21537. }
  21538. ,
  21539. t.prototype.flyToPanoClosestToMouse = function() {
  21540. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21541. this.intersect && this.updateClosestPano(this.intersect)),
  21542. this.closestPano)
  21543. return this.flyToPano({
  21544. pano: this.closestPano
  21545. });
  21546. var e = this.getMouseDirection();
  21547. this.flyDirection(e) || this.flyToPano({
  21548. pano: this.currentPano
  21549. })
  21550. }
  21551. ,
  21552. t.prototype.flyLocalDirection = function(e) {
  21553. var t = this.getDirection(e)
  21554. , i = 1 === e.z ? .4 : .75
  21555. , n = 1 === Math.abs(e.x);
  21556. return this.flyDirection(t, i, n)
  21557. }
  21558. ,
  21559. t.prototype.flyDirection = function(e, t, i) {
  21560. Hot.closePopup();//xzw add
  21561. var n = $.Deferred();
  21562. this.history.invalidate();
  21563. var r = this.closestPanoInDirection(e, t, i);
  21564. return r ? this.flyToPano({
  21565. pano: r
  21566. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21567. n.resolve(!1)),
  21568. n.promise()
  21569. }
  21570. ,
  21571. t.prototype.closestPanoInDirection = function(e, t, i) {
  21572. return this.rankedPanoInDirection(0, e, t, i)
  21573. }
  21574. ,
  21575. t.prototype.rankedPanoInDirection = (_ = {
  21576. pano: null,
  21577. candidates: []
  21578. },
  21579. function(e, t, i, n) {
  21580. e = e || 0,
  21581. i = void 0 !== i ? i : .75;
  21582. var r = n ? "angle" : "direction";
  21583. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21584. this.cachedPanoCandidates = _.candidates,
  21585. _.pano
  21586. }
  21587. ),
  21588. t.prototype.bump = function(e) {
  21589. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21590. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21591. if (.5 < Math.abs(a))
  21592. t = function() {
  21593. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21594. }
  21595. .bind(this),
  21596. i = function() {
  21597. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21598. }
  21599. .bind(this);
  21600. else {
  21601. var s = this.camera.position.clone()
  21602. , l = e.clone();
  21603. this.raycaster.set(s, l);
  21604. var c = this.model.floors.reduce(function(e, t) {
  21605. return e.concat(t.collider.children)
  21606. }, [])
  21607. , h = this.raycaster.intersectObjects(c)
  21608. , u = 0 < h.length ? h[0].distance / 25 : .04
  21609. , d = s.clone().add(l.multiplyScalar(u));
  21610. t = function() {
  21611. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21612. }
  21613. .bind(this),
  21614. i = function() {
  21615. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21616. }
  21617. .bind(this)
  21618. }
  21619. n = function() {
  21620. this.flying = !1
  21621. }
  21622. .bind(this),
  21623. this.flying = !0,
  21624. t()
  21625. }
  21626. }
  21627. ,
  21628. t.prototype.changeFloor = function(e) {
  21629. if (!this.is360View(this.mode, this.currentPano))
  21630. if (this.mode === V.PANORAMA) {
  21631. var t = this.history.reversePano(e);
  21632. t && t.isAligned() ? this.flyToPano({
  21633. pano: t
  21634. }) : this.changeFloorByScore(e)
  21635. } else
  21636. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21637. }
  21638. ,
  21639. t.prototype.changeFloorByScore = (E = {
  21640. pano: null,
  21641. candidates: []
  21642. },
  21643. function(e) {
  21644. var t = this.model.nextFloor(e);
  21645. 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),
  21646. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21647. this.history.push(e, this.currentPano),
  21648. this.flyToPano({
  21649. pano: E.pano
  21650. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21651. }
  21652. ),
  21653. t.prototype.gotoFloor = function(e) {
  21654. var t = e - this.model.currentFloor.floorIndex;
  21655. this.changeFloor(t)
  21656. }
  21657. ,
  21658. t.prototype.getDirection = function(e) {
  21659. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21660. }
  21661. ,
  21662. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21663. if (r = r || $.Deferred(),
  21664. this.mode === V.TRANSITIONING)
  21665. return Y.warn("should not be transitioning here"),
  21666. n && n(!1),
  21667. r.reject().promise();
  21668. var o = i || !1
  21669. , a = i ? i.position : this.position
  21670. , s = this.position.clone()
  21671. , l = this.currentPano;
  21672. if (Y.debug("New pose in mode " + this.mode),
  21673. !e || (retryCallback = function() {
  21674. j.delayOneFrame(function() {
  21675. this.flyToSameMode(e, t, i, n, r)
  21676. }
  21677. .bind(this))
  21678. }
  21679. .bind(this),
  21680. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21681. var c = function() {
  21682. this.emit(W.FlyingEnded, a, s, e, l),
  21683. n && n(!0)
  21684. }
  21685. .bind(this)
  21686. , h = k[this.mode]
  21687. , u = void 0 !== t ? t : h.transitionTime
  21688. , d = new B.Vector3
  21689. , p = new B.Vector3;
  21690. if (this.emit(W.FlyingStarted, a, s, e, l),
  21691. this.mode === V.PANORAMA)
  21692. Y.warn("we should not be here for panorama views");
  21693. else if (this.mode === V.DOLLHOUSE)
  21694. if (o) {
  21695. var f = new B.Vector3(0,1,0);
  21696. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21697. this.model.warpDestFloors(i.floorVisibility),
  21698. p.copy(i.position);
  21699. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21700. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21701. , v = 3;
  21702. m.length ? (d.copy(m[0].point),
  21703. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21704. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21705. var y = (new B.Matrix4).lookAt(p, d, f)
  21706. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21707. , C = d.distanceTo(p)
  21708. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21709. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21710. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21711. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21712. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21713. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21714. this.path.burnsDir = Math.sign(b.y);
  21715. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21716. , T = new B.Vector3;
  21717. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21718. G.start(function(e, t) {
  21719. w.x = E.x + e * b.x,
  21720. w.y = E.y + e * b.y,
  21721. w.z = E.z + e * b.z;
  21722. var i = _ + e * (C - _);
  21723. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21724. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21725. }
  21726. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21727. G.start(function(e, t) {
  21728. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21729. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21730. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21731. }
  21732. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21733. } else
  21734. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21735. else if (this.path.placeCpm(),
  21736. this.path.fadeInCpm(k.path.fadeInTime),
  21737. i) {
  21738. this.model.warpDestFloors(i.floorVisibility);
  21739. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21740. , S = this.cameraControls.controls[V.FLOORPLAN]
  21741. , M = S.target.clone()
  21742. , R = i.position.clone().sub(M)
  21743. , P = x.position.clone().sub(S.target).length()
  21744. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21745. , L = Math.atan2(S.offset.x, S.offset.z)
  21746. , D = Math.atan2(O.x, O.z)
  21747. , N = S.absoluteScale
  21748. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21749. G.start(function(e, t) {
  21750. S.target.copy(R).multiplyScalar(e).add(M);
  21751. var i = L + (D - L) * e;
  21752. S.offset.x = P * Math.sin(i),
  21753. S.offset.z = P * Math.cos(i),
  21754. x.position.copy(S.target).add(S.offset),
  21755. S.absoluteScale = N + e * (F - N),
  21756. S.update(),
  21757. this.quaternion.copy(x.quaternion),
  21758. this.position.copy(x.position),
  21759. this.target.copy(S.target),
  21760. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21761. }
  21762. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21763. } else
  21764. Y.info("flyToSameMode() funny floorplan view? skipping");
  21765. return G.setTimeout(function(e) {
  21766. this.mode = e,
  21767. c(),
  21768. r.resolve(!0)
  21769. }
  21770. .bind(this, this.mode), u, q.FlyToSameMode),
  21771. this.mode = V.TRANSITIONING,
  21772. r.promise()
  21773. }
  21774. }
  21775. ,
  21776. t.prototype.flyToNewMode = function(e, t) {
  21777. Hot.closePopup();//xzw add
  21778. var i = (e = e || {}).mode
  21779. , n = e.pano
  21780. , r = e.duration
  21781. , o = e.warpDest
  21782. , a = e.callback
  21783. , s = e.force
  21784. , l = e.quaternion;
  21785. if (t = t || $.Deferred(),
  21786. this.isWarping())
  21787. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21788. a && a(!1),
  21789. t.reject("Cannot change mode during tour transition").promise();
  21790. if (this.mode === V.TRANSITIONING)
  21791. return a && a(!1),
  21792. t.reject("Cannot change mode during mode transition").promise();
  21793. if (i === this.mode)
  21794. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21795. t.promise()) : (a && a(!1),
  21796. t.reject("Already in " + i + " mode").promise());
  21797. var c = o || !1;
  21798. Y.debug("Switching mode to " + i);
  21799. var h = function() {
  21800. j.delayOneFrame(function() {
  21801. this.flyToNewMode(e, t)
  21802. }
  21803. .bind(this))
  21804. }
  21805. .bind(this);
  21806. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21807. return t.promise();
  21808. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)){
  21809. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21810. this.model.waitForLoad(this.model, function() {
  21811. return this.model.meshTexturesLoaded
  21812. }
  21813. .bind(this)),
  21814. this.model.loadMeshTextures().done(h),
  21815. t.promise();
  21816. }
  21817. this.history.invalidate()
  21818. this.updateLastView();
  21819. var u = this.mode
  21820. , d = this.cameraControls.cameras[i];
  21821. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21822. var p = void 0 !== r ? r : e.transitionTime;
  21823. this.emit(W.ModeChanging, u, i, n, p)
  21824. n && (this.currentPano = n)
  21825. this.switchCameraMode(i, l)
  21826. G.cancelById(q.LookTransition);
  21827. var f = (new B.Vector3).copy(this.position);
  21828. this.modeTran = this.mode + "-" + i;
  21829. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  21830. VisiSet.finishSetPanoVisible()
  21831. VisiSet.finishSetTagVisible()
  21832. VisiSet.finishSetPanoLog()
  21833. }
  21834. /* if(editTool.atPanel == "screen"){
  21835. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21836. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21837. } */
  21838. if(i == "panorama"){
  21839. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21840. }else{
  21841. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21842. }
  21843. window.bus.dispatchEvent({type:'playerAndModelReady'})
  21844. if (i === V.PANORAMA)
  21845. this.emit(W.PanoChosen, n, n),
  21846. setTimeout(function() {
  21847. n.floor.enter(i)
  21848. }
  21849. .bind(this), p / 2),
  21850. this.path.fadeOutCpm(k.path.fadeOutTime);
  21851. else if (i === V.DOLLHOUSE) {
  21852. if (c && (this.model.stayPut = !0),
  21853. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21854. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21855. this.path.placeCpm(),
  21856. this.path.fadeInCpm(k.path.fadeInTime),
  21857. c) {
  21858. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21859. f.set(15, 10, 15);
  21860. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21861. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21862. v.length ? (g.copy(v[0].point),
  21863. f.copy(o.position),
  21864. 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),
  21865. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21866. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21867. f.add(this.model.position),
  21868. d.position.copy(f),
  21869. this.cameraControls.controls[V.DOLLHOUSE].update()
  21870. }
  21871. } else if (this.path.placeCpm(),
  21872. this.path.fadeInCpm(k.path.fadeInTime),
  21873. o) {
  21874. this.model.warpDestFloors(o.floorVisibility);
  21875. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21876. , A = this.cameraControls.controls[V.FLOORPLAN]
  21877. , C = y.position.clone().sub(A.target)
  21878. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21879. , E = Math.atan2(I.x, I.z);
  21880. A.target.copy(o.position);
  21881. var _ = C.length();
  21882. A.offset.x = _ * Math.sin(E),
  21883. A.offset.y = 0,
  21884. A.offset.z = _ * Math.cos(E),
  21885. y.position.copy(A.target).add(A.offset),
  21886. A.target.clone().sub(d.position),
  21887. d.quaternion.copy(o.quaternion),
  21888. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21889. A.absoluteScale = A.currentScale,
  21890. A.update()
  21891. } else
  21892. this.model.currentFloor.enter(i);
  21893. var b = this.currentPano
  21894. , w = this.position.clone();
  21895. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21896. this.flying = !0,
  21897. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21898. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21899. d.controls.update()),
  21900. e.blackoutStyle = P.FADEIN,
  21901. p = k.show360Views.transitionTime,
  21902. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21903. this.mode = i,
  21904. this.path && this.path.popOutCpm(),
  21905. e.blackoutStyle = P.END,
  21906. p = k.show360Views.transitionTime,
  21907. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21908. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21909. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21910. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21911. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21912. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21913. G.setTimeout(function() {
  21914. this.flying = !1,
  21915. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21916. this.currentPano.enter(),
  21917. this.path.placeCpm(),
  21918. this.path.fadeOutCpm(k.path.fadeOutTime),
  21919. this.spider.draw()),
  21920. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21921. this.mode = i,
  21922. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21923. if (this.afterCModeFuc) {
  21924. //手动加的函数
  21925. var cf = this.afterCModeFuc;
  21926. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21927. cf();
  21928. }
  21929. this.updateMarkerVisi();//add
  21930. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  21931. if(this.mode == "panorama" ){
  21932. //EditOverlay.updatePano()
  21933. editTool.hotpoint.updatePano()
  21934. }
  21935. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  21936. if(this.mode == V.PANORAMA){
  21937. Hot.updateVisibles([this.currentPano])
  21938. }else{
  21939. Hot.updateVisibles(true)
  21940. this.model.hotGroup.children.forEach(overlay=>{
  21941. if(overlay.animateInfo){
  21942. GifTexDeal.start(overlay.animation)
  21943. }
  21944. })
  21945. }
  21946. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21947. t.resolve())
  21948. }
  21949. .bind(this), p, q.FlyToNewMode),
  21950. this.mode = V.TRANSITIONING,
  21951. //EditOverlay.updatePano(),//add
  21952. editTool.hotpoint.updatePano(),//add
  21953. //u == "panorama" && this.updateHotVisible(),
  21954. t.promise()
  21955. }
  21956. ,
  21957. t.prototype.fade360View = function(e, t, i) {
  21958. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21959. $(this.domElement).fadeOut(.5 * e, function() {
  21960. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21961. this.model.alpha = i.modelAlpha,
  21962. this.position.copy(t.position),
  21963. this.quaternion.copy(t.quaternion),
  21964. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21965. $(this.domElement).fadeIn(.5 * e)
  21966. }
  21967. .bind(this))
  21968. }
  21969. ,
  21970. t.prototype.findDefaultViews = function() {
  21971. this.findDefaultView(this.lastInsideView, !0),
  21972. this.findDefaultView(this.last360View, !1)
  21973. }
  21974. ,
  21975. t.prototype.findDefaultView = function(e, i) {
  21976. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21977. if (e.cameraMode !== V.PANORAMA)
  21978. return !1;
  21979. var t = r.get(e.panoId);
  21980. return t && t.isAligned() === i
  21981. });
  21982. 0 <= o ? (t = r.get(n[o].panoId),
  21983. e.update({
  21984. cameraMode: V.PANORAMA,
  21985. pano: t,
  21986. position: n[o].position,
  21987. quaternion: n[o].quaternion
  21988. })) : 0 <= (o = r.list.findIndex(function(e) {
  21989. return e.isAligned() === i
  21990. })) ? (t = r.list[o],
  21991. e.update({
  21992. cameraMode: V.PANORAMA,
  21993. pano: t,
  21994. position: t.position
  21995. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21996. }
  21997. ,
  21998. t.prototype.updateLastView = function() {
  21999. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22000. pano: this.currentPano,
  22001. position: this.position,
  22002. quaternion: this.quaternion
  22003. })
  22004. }
  22005. ,
  22006. t.prototype.goToLastView = function(e, t) {
  22007. var i = $.Deferred()
  22008. , n = i.resolve.bind(i)
  22009. , r = i.reject.bind(i)
  22010. , o = e ? this.lastInsideView : this.last360View;
  22011. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22012. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22013. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22014. mode: o.cameraMode,
  22015. pano: o.pano,
  22016. quaternion: o.quaternion,
  22017. callback: t
  22018. }).done(n).fail(r),
  22019. i.promise()
  22020. }
  22021. ,
  22022. t.prototype.fadeToView = function(e, t, i, n) {
  22023. var r = $.Deferred()
  22024. , o = r.resolve.bind(r)
  22025. , a = r.reject.bind(r);
  22026. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22027. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22028. a("Cannot go to illegal view"),
  22029. r.promise();
  22030. var s = (k[t.cameraMode],
  22031. function() {
  22032. $(this.domElement).fadeIn(.5 * i),
  22033. n && n(),
  22034. o()
  22035. }
  22036. .bind(this))
  22037. , l = e ? P.FADEIN : P.END;
  22038. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22039. $(this.domElement).fadeOut(.5 * i, function() {
  22040. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22041. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22042. pano: t.pano,
  22043. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22044. duration: 0
  22045. }, s) : this.flyToNewMode({
  22046. mode: t.cameraMode,
  22047. quaternion: t.quaternion,
  22048. duration: 0,
  22049. callback: s
  22050. })
  22051. }
  22052. .bind(this)),
  22053. r.promise()
  22054. }
  22055. ,
  22056. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22057. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22058. this.flying)
  22059. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22060. o && o(),
  22061. !1;
  22062. null != e || (e = M.Show),
  22063. this.history.invalidate(),
  22064. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22065. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22066. return this.emit(W.WarpStarted, a, i, n, r),
  22067. n = n || P.MIDDLE,
  22068. this.path.warpToPano(i, n, r, function() {
  22069. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22070. this.emit(W.WarpEnded, i),
  22071. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22072. o && o()
  22073. }
  22074. .bind(this)),
  22075. e === M.Hide && this.path.discardPathObject(),
  22076. !0
  22077. }
  22078. ,
  22079. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22080. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22081. s && s(),
  22082. !1)
  22083. }
  22084. ,
  22085. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22086. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22087. a && a(),
  22088. !1)
  22089. }
  22090. ,
  22091. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22092. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22093. }
  22094. ,
  22095. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22096. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22097. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22098. t && t(),
  22099. !1)
  22100. }
  22101. ,
  22102. t.prototype.aimTourCamera = function(e, t, i, n) {
  22103. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22104. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22105. }
  22106. ,
  22107. t.prototype.showPathToHeroLocation = function(e) {
  22108. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22109. }
  22110. ,
  22111. t.prototype.tourInterlude = function(e, t) {
  22112. this.history.invalidate(),
  22113. this.path.discardSlow();
  22114. var defaultRotTime = DATA.tourRotTime * 1000
  22115. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  22116. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  22117. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  22118. var rotTime
  22119. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22120. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  22121. var hasMusic = currentLocation0.musicInfo && currentLocation0.musicInfo.music
  22122. if(hasMusic){
  22123. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  22124. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22125. rotTime = currentLocation0.musicInfo.time - current
  22126. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22127. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22128. }
  22129. }else{
  22130. rotTime = defaultRotTime
  22131. }
  22132. rotTime = Math.max(0, rotTime)
  22133. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''))
  22134. }else{
  22135. rotTime = currentLocation.rotTime * 1000
  22136. console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22137. }
  22138. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22139. t && t()
  22140. }
  22141. .bind(this), rotTime)
  22142. }
  22143. ,
  22144. t.prototype.stopInterlude = function() {
  22145. this.interruptAndFastForward(null, 0)
  22146. }
  22147. ,
  22148. t.prototype.interruptAndFastForward = function(e, t) {
  22149. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22150. this.flying && this.emit(W.FlyingInterrupted),
  22151. this.path.interruptAndFastForward(e, t)
  22152. }
  22153. ,
  22154. t.prototype.setSize = function(e, t) {
  22155. var i = e / t;
  22156. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22157. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22158. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22159. this.cameraControls.cameras) {
  22160. var o = this.cameraControls.cameras[r];
  22161. o.fov = this.baseFov * (1 / this.zoomLevel),
  22162. o.updateAspect(i)
  22163. }
  22164. }
  22165. ,
  22166. t.prototype.toJSON = function() {
  22167. var e = {};
  22168. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22169. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22170. return e.hidden ? 0 : 1
  22171. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22172. e
  22173. }
  22174. ,
  22175. t.prototype.getCurrentNodePanos = function(e) {
  22176. if (this.model.panos.map,
  22177. e.length = 0,
  22178. this.path.nodes)
  22179. for (var t = 0; t < this.path.nodes.length; t++) {
  22180. var i = this.path.nodes[t];
  22181. e.push(this.model.panos.get(i))
  22182. }
  22183. }
  22184. ,
  22185. t.prototype.zoomIncrementally = function(e) {
  22186. var t = this.zoomLevel;
  22187. this.zoomTo(this.zoomLevel + e),
  22188. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22189. }
  22190. ,
  22191. t.prototype.zoomInIncrementally = function(e) {
  22192. e = e || this.defaultZoomIncrement,
  22193. this.zoomIncrementally(e)
  22194. }
  22195. ,
  22196. t.prototype.zoomOutIncrementally = function(e) {
  22197. e = e || -this.defaultZoomIncrement,
  22198. this.zoomIncrementally(e)
  22199. }
  22200. ,
  22201. t.prototype.zoomBy = function(e) {
  22202. this.zoomTo(this.zoomLevel * e)
  22203. }
  22204. ,
  22205. t.prototype.zoomIn = function() {
  22206. this.zoomBy(1 + this.zoomSpeed)
  22207. }
  22208. ,
  22209. t.prototype.zoomOut = function() {
  22210. this.zoomBy(1 - this.zoomSpeed)
  22211. }
  22212. ,
  22213. t.prototype.zoomTo = function(e, t) {
  22214. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22215. e > k.zoom.max && (e = k.zoom.max),
  22216. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22217. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22218. e === k.zoom.min && this.emit(m.ZoomMin)),
  22219. this.cameraControls.activeControl)) {
  22220. var i = this.cameraControls.activeControl.camera;
  22221. this.zoomLevel = e,
  22222. i.fov = this.baseFov * (1 / this.zoomLevel),
  22223. i.updateProjectionMatrix(),
  22224. this.zoomFov = i.fov
  22225. }
  22226. }
  22227. ,
  22228. t.prototype.increaseZoomSpeed = function() {
  22229. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22230. }
  22231. ,
  22232. t.prototype.decreaseZoomSpeed = function() {
  22233. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22234. }
  22235. ,
  22236. t.prototype.clampZoomSpeed = function(e) {
  22237. return e < 0 ? 0 : e
  22238. }
  22239. ,
  22240. t.prototype.activatePersistentZooming = function(e) {
  22241. this.zooming = e ? 1 : -1
  22242. }
  22243. ,
  22244. t.prototype.deactivatePersistentZooming = function() {
  22245. this.zooming = 0
  22246. }
  22247. ,
  22248. t.prototype.zoomDefault = function() {
  22249. this.zoomTo(1, !0)
  22250. }
  22251. window.fovTranId = 333;//add
  22252. t.prototype.smoothZoomToDefault = function(e, t) {
  22253. G.cancelById(window.fovTranId)
  22254. var i, n = this.zoomLevel, r = function(e) {
  22255. 1 < e && (e = 1),
  22256. i = n * (1 - e) + e,
  22257. this.zoomTo(i, !0)
  22258. }
  22259. .bind(this), o = function() {
  22260. this.zoomDefault(),
  22261. t && window.setTimeout(t, 50)
  22262. }
  22263. .bind(this);
  22264. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22265. }
  22266. ,
  22267. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22268. G.cancelById(window.fovTranId)
  22269. var i,
  22270. n = this.zoomLevel,
  22271. aimLevel = zoomLevel || this.baseFov / fov
  22272. if (n == aimLevel) return
  22273. var fun = function (e) {
  22274. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22275. }.bind(this)
  22276. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22277. }
  22278. ,
  22279. t.prototype.updateZoomPano = function() {
  22280. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22281. var e = this.currentPano;
  22282. if (e) {
  22283. var t = this.zoomLevel > k.zoom.activationThreshold
  22284. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22285. t);
  22286. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22287. this.panoRenderer.setZoomingActive(i, e, !0);
  22288. var n = function(e, t) {
  22289. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22290. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22291. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22292. e.setZoomed(t)
  22293. }
  22294. .bind(this);
  22295. i && !e.zoomed ? (n(e, !0),
  22296. this.panoRenderer.enableUltraHighQualityMode(function() {
  22297. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22298. i && n(e, !0)
  22299. }
  22300. .bind(this))) : !t && e.zoomed && n(e, !1)
  22301. }
  22302. }
  22303. },
  22304. //--------
  22305. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22306. var f2;
  22307. if (this.mode == mode) {
  22308. f1 && f1()
  22309. } else {
  22310. f2 = f1;
  22311. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22312. this.afterCModeFuc = function() {
  22313. this.afterCModeFuc = f2
  22314. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22315. }.bind(this)
  22316. } else {
  22317. this.afterCModeFuc = f2;//飞入后执行
  22318. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22319. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22320. }catch(e){}
  22321. }
  22322. }
  22323. }
  22324. ,
  22325. t.prototype.checkHasNeighbor = function(pano){//add
  22326. for(var i in pano.neighbourPanos ){
  22327. if(i == pano.id)continue;
  22328. if(pano.neighbourPanos[i]){
  22329. return true;
  22330. }
  22331. }
  22332. }
  22333. ,
  22334. ee.exports = t
  22335. }
  22336. ).call(this, "/js/player.js")
  22337. }
  22338. , {
  22339. "./constants": 8,
  22340. "./enum/AlignmentType": 17,
  22341. "./enum/BlackoutStyle": 18,
  22342. "./enum/ControlEvents": 21,
  22343. "./enum/Keys": 30,
  22344. "./enum/ModelManagerEvents": 33,
  22345. "./enum/PanoSizeClass": 36,
  22346. "./enum/PanoramaEvents": 37,
  22347. "./enum/PathDiscardMode": 38,
  22348. "./enum/PathDisplayMode": 39,
  22349. "./enum/PlayerEvents": 40,
  22350. "./enum/TagStates": 44,
  22351. "./enum/Vectors": 50,
  22352. "./enum/Viewmode": 51,
  22353. "./enum/WarpStyle": 52,
  22354. "./enum/ZoomEvents": 53,
  22355. "./exception/BasicException": 55,
  22356. "./model/ModelManager": 140,
  22357. "./objects/NSpider": 147,
  22358. "./objects/Panorama": 148,
  22359. "./objects/Reticule": 149,
  22360. "./objects/ShowPath": 151,
  22361. "./objects/Snapshot": 153,
  22362. "./objects/View": 154,
  22363. "./settings": 166,
  22364. "./shaders": 167,
  22365. "./tile/TileDownloader": 171,
  22366. "./tile/TilePrioritizer": 172,
  22367. "./util/ZoomStats": 179,
  22368. "./util/browser": 182,
  22369. "./util/camera": 183,
  22370. "./util/cameraLight": 184,
  22371. "./util/common": 185,
  22372. "./util/easing": 186,
  22373. "./util/history": 187,
  22374. "./util/lerp": 188,
  22375. "./util/logger": 189,
  22376. "./util/math": 190,
  22377. "./util/transitions": 195,
  22378. // hot: "hot",
  22379. scaleImg: "scaleImg",
  22380. events: 202,
  22381. three: 217
  22382. }],
  22383. scaleImg: [function(e, t) {
  22384. var i = t;
  22385. (function() {
  22386. function e(e, t, i, n) {
  22387. function r() {
  22388. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22389. U.height = p,
  22390. H = U.getContext("2d")
  22391. }
  22392. function o(e) {
  22393. if (e) {
  22394. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22395. for (t = 0; t < ie; t += 4)
  22396. n[t] = e[t] * ne | 0,
  22397. n[t + 1] = e[t + 1] * ne | 0,
  22398. n[t + 2] = e[t + 2] * ne | 0,
  22399. n[t + 3] = e[t + 3] * ne | 0;
  22400. return delete e,
  22401. i
  22402. }
  22403. return H.getImageData(0, 0, d, p)
  22404. }
  22405. function a(e, t, i, n, r) {
  22406. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22407. }
  22408. var s, l;
  22409. if (t || (t = e.input,
  22410. i = e.output,
  22411. n = e.inputRemovable,
  22412. e.scale && (e = e.scale)),
  22413. t.src)
  22414. if (s = document.createElement("canvas"),
  22415. null != t.naturalWidth)
  22416. s.width = t.naturalWidth,
  22417. s.height = t.naturalHeight;
  22418. else if (null != t.runtimeStyle) {
  22419. var c = t.runtimeStyle
  22420. , h = c.width
  22421. , u = c.height;
  22422. c.width = "auto",
  22423. c.height = "auto",
  22424. s.width = t.width,
  22425. s.height = t.height,
  22426. c.width = h,
  22427. c.height = u
  22428. } else {
  22429. h = t.width,
  22430. u = t.height;
  22431. t.removeAttribute && (t.removeAttribute("width"),
  22432. t.removeAttribute("height")),
  22433. s.width = t.width,
  22434. s.height = t.height,
  22435. t.width = h,
  22436. t.height = u
  22437. }
  22438. else
  22439. s = t;
  22440. l = s.getContext("2d"),
  22441. t.src && l.drawImage(t, 0, 0);
  22442. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22443. if (!f || !g)
  22444. return !1;
  22445. (t.src || n) && s.clearRect(0, 0, f, g),
  22446. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22447. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22448. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22449. e * g + .5 | 0);
  22450. 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;
  22451. if (1 < re || 1 < oe)
  22452. for (r(),
  22453. G = (z = o()).data,
  22454. C = 0; C < p; C++)
  22455. for (V = (y = C / oe) - (w = 0 | y),
  22456. j = w * $,
  22457. W = w < 1 ? j : j - $,
  22458. w < g - 2 ? (Y = j + $,
  22459. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22460. A = 0; A < d; A++,
  22461. te += 4)
  22462. Z = (b = 0 | (v = A / re)) << 2,
  22463. b < f - 2 ? (K = Z + 4,
  22464. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22465. 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,
  22466. ++Z,
  22467. ++K,
  22468. ++Q,
  22469. 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,
  22470. ++Z,
  22471. ++K,
  22472. ++Q,
  22473. 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,
  22474. ++Z,
  22475. ++K,
  22476. ++Q,
  22477. 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,
  22478. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22479. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22480. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22481. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22482. else {
  22483. if (le.Float32Array)
  22484. L = new Float32Array(ie);
  22485. else
  22486. for (L = [],
  22487. te = 0; te < ie; ++te)
  22488. L[te] = 0;
  22489. for (y = 0; y < g; y++)
  22490. for (I = (_ = 0 | (C = y * oe)) * J,
  22491. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22492. R = C + oe - _ - 1),
  22493. v = 0; v < f; v++,
  22494. ee += 4)
  22495. switch (A = v * re,
  22496. E = 0 | A,
  22497. te = I + (E << 2),
  22498. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22499. P && (x = 1 + E - A,
  22500. S = A + re - E - 1),
  22501. D = m[ee],
  22502. F = m[ee + 1],
  22503. B = m[ee + 2],
  22504. N = m[ee + 3],
  22505. P + O) {
  22506. case 0:
  22507. L[te] += D * ae,
  22508. L[te + 1] += F * ae,
  22509. L[te + 2] += B * ae,
  22510. L[te + 3] += N * ae;
  22511. break;
  22512. case 1:
  22513. T = x * oe,
  22514. L[te] += D * T,
  22515. L[te + 1] += F * T,
  22516. L[te + 2] += B * T,
  22517. L[te + 3] += N * T,
  22518. T = S * oe,
  22519. L[te + 4] += D * T,
  22520. L[te + 5] += F * T,
  22521. L[te + 6] += B * T,
  22522. L[te + 7] += N * T;
  22523. break;
  22524. case 2:
  22525. T = re * M,
  22526. L[te] += D * T,
  22527. L[te + 1] += F * T,
  22528. L[te + 2] += B * T,
  22529. L[te + 3] += N * T,
  22530. T = re * R,
  22531. L[te += J] += D * T,
  22532. L[te + 1] += F * T,
  22533. L[te + 2] += B * T,
  22534. L[te + 3] += N * T;
  22535. break;
  22536. default:
  22537. T = x * M,
  22538. L[te] += D * T,
  22539. L[te + 1] += F * T,
  22540. L[te + 2] += B * T,
  22541. L[te + 3] += N * T,
  22542. T = S * M,
  22543. L[te + 4] += D * T,
  22544. L[te + 5] += F * T,
  22545. L[te + 6] += B * T,
  22546. L[te + 7] += N * T,
  22547. T = x * R,
  22548. L[te += J] += D * T,
  22549. L[te + 1] += F * T,
  22550. L[te + 2] += B * T,
  22551. L[te + 3] += N * T,
  22552. T = S * R,
  22553. L[te + 4] += D * T,
  22554. L[te + 5] += F * T,
  22555. L[te + 6] += B * T,
  22556. L[te + 7] += N * T
  22557. }
  22558. delete m,
  22559. r(),
  22560. z = o(L)
  22561. }
  22562. if (H.putImageData(z, 0, 0),
  22563. "string" == typeof i) {
  22564. var se;
  22565. if ("png" === i || "jpeg" === i)
  22566. return (se = n && t.src ? t : new Image).width = d,
  22567. se.height = p,
  22568. se.src = U.toDataURL("image/" + i, .85),
  22569. se;
  22570. if ("png-src" === i || "jpeg-src" === i)
  22571. return U.toDataURL("image/" + i.split("-")[0], .85)
  22572. }
  22573. return U
  22574. }
  22575. var le = this;
  22576. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22577. exports.scale = e) : c = e
  22578. }
  22579. ).call(this),
  22580. i.exports = c
  22581. }
  22582. , {}],
  22583. 156: [function(i, n, e) {
  22584. (function(e) {
  22585. "use strict";
  22586. function t(e, t) {
  22587. this.model = e,
  22588. this.panos = e.panos,
  22589. this.player = t,
  22590. this.imagePanos = this.listImagePanos(),
  22591. this.retryMinimumTime = 1e4
  22592. }
  22593. var r = (i("three"),
  22594. i("./enum/Viewmode"))
  22595. , o = (i("./settings"),
  22596. i("./objects/Panorama"))
  22597. , a = new (i("./util/logger"))(e);
  22598. t.prototype.start = function() {
  22599. this.loadNextPano(function(e) {
  22600. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22601. setTimeout(function() {
  22602. this.start()
  22603. }
  22604. .bind(this), 1e3))
  22605. }
  22606. .bind(this))
  22607. }
  22608. ,
  22609. t.prototype.validLoadTarget = function(e) {
  22610. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22611. }
  22612. ,
  22613. t.prototype.listImagePanos = function() {
  22614. var i = []
  22615. , n = this;
  22616. return this.model.images.forEach(function(e) {
  22617. if (e.metadata && e.metadata.scan_id) {
  22618. var t = n.model.panos.get(e.metadata.scan_id);
  22619. t && !t.isLoaded("high") && i.push(t)
  22620. }
  22621. }),
  22622. i
  22623. }
  22624. ,
  22625. t.prototype.nextNotLoadedImage = function() {
  22626. for (; 0 < this.imagePanos.length; ) {
  22627. var e = this.imagePanos[0];
  22628. if (!e.isLoaded("high"))
  22629. return e;
  22630. this.imagePanos.shift()
  22631. }
  22632. return null
  22633. }
  22634. ,
  22635. t.prototype.loadNextPano = function(e) {
  22636. var t, i, n = this.model.waitQueue.filter(function(e) {
  22637. return e.object instanceof o
  22638. });
  22639. 0 < n.length ? (t = n[0].object,
  22640. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22641. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22642. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22643. t = this.imagePanos[0],
  22644. 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),
  22645. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22646. a.debug("Preloading " + i + "-res pano " + t.id),
  22647. t.loadCube(i).done(e).fail(function() {
  22648. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22649. e()
  22650. })) : e && e(null)
  22651. }
  22652. ,
  22653. n.exports = t
  22654. }
  22655. ).call(this, "/js/preloaders.js")
  22656. }
  22657. , {
  22658. "./enum/Viewmode": 51,
  22659. "./objects/Panorama": 148,
  22660. "./settings": 166,
  22661. "./util/logger": 189,
  22662. three: 217
  22663. }],
  22664. 157: [function(a, s, e) {
  22665. (function(e) {
  22666. "use strict";
  22667. function t(e, t, i, n, r) {
  22668. this.qualityManager = e,
  22669. this.scene = t,
  22670. this.camera = i,
  22671. this.container = r,
  22672. this.controls = n,
  22673. this.controls.enabled = !0,
  22674. this.controls.locked = !0,
  22675. this.quickstartCamera = n.camera,
  22676. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22677. this.skybox = null
  22678. }
  22679. var i = a("three")
  22680. , n = a("../util/logger")
  22681. , o = a("../constants")
  22682. , h = (a("../util/transitions"),
  22683. a("../util/lerp"),
  22684. a("../util/easing"),
  22685. a("../enum/Vectors"))
  22686. , u = a("../enum/PanoSizeClass")
  22687. , r = (a("../materials/ModelTextureMaterial"),
  22688. a("../materials/CubemapMaterial"))
  22689. , d = (a("../cameras/PanoramaCamera"),
  22690. a("../controls/PanoramaControls"),
  22691. a("../tile/TileUtils"),
  22692. a("../util/camera"),
  22693. a("../util/cameraLight"))
  22694. , p = (a("../util/browser"),
  22695. a("../settings"),
  22696. a("../gui/helpManager"),
  22697. new n(e));
  22698. t.prototype.load = function(e) {
  22699. e.pano.shouldRedrawOnBaseLoaded = !0;
  22700. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22701. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22702. var a = this.qualityManager.getPanoSize(u.BASE)
  22703. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22704. if (e.pano.tiled) {
  22705. p.warn("Loading startPano, TILED", e.pano.id);
  22706. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22707. , c = this.quickstartCamera.fov;
  22708. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22709. t = e.pano.loadTiledPano(s, r, {
  22710. hFov: l,
  22711. vFov: c
  22712. }, !1, !1, !0),
  22713. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22714. } else
  22715. p.warn("Loading startPano", e.pano.id),
  22716. t = e.pano.loadCube("high");
  22717. return $.when(t).then(function() {
  22718. n.init(e.pano, e.quaternion),
  22719. e.pano.tiled ? i.done(function() {
  22720. e.pano.lockUntilRenderingComplete = !1,
  22721. this.controls.locked = !1
  22722. }
  22723. .bind(this)) : this.controls.locked = !1
  22724. }
  22725. .bind(this))
  22726. }
  22727. ,
  22728. t.prototype.init = function(e, t) {
  22729. p.info("Quickstart done loading, adding scene objects"),
  22730. e.lockUntilRenderingComplete = !0,
  22731. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22732. side: i.BackSide
  22733. })),
  22734. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22735. this.skybox.quaternion.copy(e.quaternion),
  22736. this.scene.add(this.skybox),
  22737. $(this.container).show()
  22738. }
  22739. ,
  22740. t.prototype.update = function(e) {
  22741. this.controls.update(e),
  22742. this.camera.copy(this.quickstartCamera)
  22743. }
  22744. ,
  22745. t.prototype.setSize = function(e, t) {
  22746. this.quickstartCamera.updateAspect(e / t)
  22747. }
  22748. ,
  22749. t.prototype.destroy = function() {
  22750. this.scene.remove(this.skybox)
  22751. }
  22752. ,
  22753. s.exports = t
  22754. }
  22755. ).call(this, "/js/scene/QuickstartManager.js")
  22756. }
  22757. , {
  22758. "../cameras/PanoramaCamera": 7,
  22759. "../constants": 8,
  22760. "../controls/PanoramaControls": 13,
  22761. "../enum/PanoSizeClass": 36,
  22762. "../enum/Vectors": 50,
  22763. "../gui/helpManager": 68,
  22764. "../materials/CubemapMaterial": 117,
  22765. "../materials/ModelTextureMaterial": 118,
  22766. "../settings": 166,
  22767. "../tile/TileUtils": 174,
  22768. "../util/browser": 182,
  22769. "../util/camera": 183,
  22770. "../util/cameraLight": 184,
  22771. "../util/easing": 186,
  22772. "../util/lerp": 188,
  22773. "../util/logger": 189,
  22774. "../util/transitions": 195,
  22775. three: 217
  22776. }],
  22777. 158: [function(e, t, i) {
  22778. "use strict";
  22779. function h(e, t, i) {
  22780. this.scene = e,
  22781. this.camera = t,
  22782. this.renderer = null,
  22783. this.effects = i,
  22784. this.animateCallback = null,
  22785. this.composer = null,
  22786. this.qualityManager = null,
  22787. e.renderWidth = 0,
  22788. e.renderHeight = 0,
  22789. this.updateClock = new M.Clock,
  22790. this.components = [],
  22791. this.updateListeners = [],
  22792. this.resizeListeners = [],
  22793. this.forceUpdateSize = !1,
  22794. this.started = !1,
  22795. this.textures = {},
  22796. this.suspendedObjects = []
  22797. }
  22798. 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;
  22799. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22800. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22801. this.components.push(e),
  22802. e.update && this.updateListeners.push(e),
  22803. e.setSize && (this.resizeListeners.push(e),
  22804. this.forceUpdateSize = !0)
  22805. }
  22806. ,
  22807. h.prototype.removeComponent = function(t) {
  22808. function e(e) {
  22809. return e !== t
  22810. }
  22811. this.components = this.components.filter(e),
  22812. this.updateListeners = this.updateListeners.filter(e),
  22813. this.resizeListeners = this.resizeListeners.filter(e)
  22814. }
  22815. ,
  22816. h.prototype.start = function(e) {
  22817. if (this.started)
  22818. throw new l("Can't start SceneRenderer, already started");
  22819. this.createContext(e),
  22820. //u.isMobile() && this.boluoVrInit(),
  22821. this.initComposer(),
  22822. this.started = !0,
  22823. (b = b.bind(this))()
  22824. }
  22825. ,
  22826. h.prototype.createContext = function(e) {
  22827. try {
  22828. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22829. this.renderer.autoClear = !0,
  22830. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22831. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22832. this.emit(r.ContextCreated)
  22833. } catch (e) {
  22834. throw new c("Unable to create a WebGL rendering context")
  22835. }
  22836. d.profiling.enabled && this.overrideTextures(),
  22837. e.appendChild(this.renderer.domElement)
  22838. }
  22839. ,
  22840. h.prototype.overrideTextures = function() {
  22841. var d = this.renderer.context
  22842. , t = 0
  22843. , i = d.createTexture;
  22844. d.createTexture = function() {
  22845. var e = i.call(d);
  22846. return e.id = t++,
  22847. this.textures[e.id] = e
  22848. }
  22849. .bind(this);
  22850. var p = d.texImage2D;
  22851. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22852. var c, h = this.getTextureTypeFromTarget(d, e);
  22853. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22854. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22855. s = r,
  22856. n = (l = o).naturalWidth,
  22857. r = l.naturalHeight,
  22858. p.call(d, e, t, i, a, s, l));
  22859. var u = this.textures[c.id];
  22860. u.width = h === f.TextureCube ? 6 * n : n,
  22861. u.height = r
  22862. }
  22863. .bind(this);
  22864. var n = d.deleteTexture;
  22865. d.deleteTexture = function(e) {
  22866. delete this.textures[e.id],
  22867. n.call(d, e)
  22868. }
  22869. .bind(this)
  22870. }
  22871. ,
  22872. h.prototype.updateTextureMemory = (n = null,
  22873. function() {
  22874. var e = 0;
  22875. for (var t in this.textures) {
  22876. var i = this.textures[t];
  22877. i.width && i.height && (e += i.width * i.height * 4)
  22878. }
  22879. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22880. n = e
  22881. }
  22882. ),
  22883. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22884. switch (t) {
  22885. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22886. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22887. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22888. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22889. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22890. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22891. return f.TextureCube;
  22892. case e.TEXTURE_2D:
  22893. return f.Texture2D;
  22894. default:
  22895. return null
  22896. }
  22897. }
  22898. ,
  22899. h.prototype.initComposer = function() {
  22900. this.composer = new M.EffectComposer(this.renderer),
  22901. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22902. /* this.composer.addPass(this.effects.hblurPass),
  22903. this.composer.addPass(this.effects.vblurPass) */
  22904. this.composer.addPass(this.effects.transitionMaskPass)//add
  22905. }
  22906. ,
  22907. h.prototype.setSize = function(e, t, i) {
  22908. this.renderWidth = e,
  22909. this.renderHeight = t,
  22910. this.effects.aspect = e / t,
  22911. this.renderer.setSize(e, t, !1, i),
  22912. this.composer.setSize(e, t);
  22913. for (var n = 0; n < this.resizeListeners.length; n++)
  22914. this.resizeListeners[n].setSize(e, t)
  22915. }
  22916. ,
  22917. h.prototype.render = function() {
  22918. this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22919. }
  22920. ,
  22921. h.prototype.boluoVrInit = function() {
  22922. console.log("boluoVrInit"),
  22923. this.isHuawei5X = u.detectHUAWEI5X(),
  22924. this.oldRenderer = this.renderer,
  22925. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22926. window.panoCamera = this.camera;
  22927. var i = this;
  22928. window._vrEnabled = !1,
  22929. Object.defineProperty(window, "vrEnabled", {
  22930. get: function() {
  22931. return window._vrEnabled
  22932. },
  22933. set: function(e) {
  22934. (e = !!e) ? (i.renderer = i.newRenderer,
  22935. window.vrMarkers.forEach(function(e) {
  22936. e.visible = !0
  22937. })) : (i.renderer = i.oldRenderer,
  22938. window.vrMarkers.forEach(function(e) {
  22939. e.visible = !1
  22940. })),
  22941. i.cursor.visible = e,
  22942. i.setSize($("#player").width(), $("#player").height()),
  22943. window._vrEnabled = e,
  22944. setTimeout(function() {
  22945. console.log(player.cameraControls.activeControl.camera.fov)
  22946. }, 500)
  22947. }
  22948. }),
  22949. this.createCursor(.5, !1, 1, 16777215, 0);
  22950. var e = {
  22951. setSize: function(e, t) {
  22952. i.camera.aspect = e / t
  22953. }
  22954. };
  22955. this.resizeListeners.push(e),
  22956. this.vrLoadingInit()
  22957. }
  22958. ,
  22959. h.prototype.vrLoadingInit = function() {
  22960. var e = new (e = function(camera) {
  22961. var t = this
  22962. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22963. , i = new M.MeshBasicMaterial({
  22964. color: 4967932,
  22965. side: M.DoubleSide
  22966. })
  22967. , n = new M.Mesh(e,i);
  22968. (this.mesh = n).position.z = -2,
  22969. n.scale.set(.08, .08, .08),
  22970. n.visible = !1,
  22971. //window.player.camera.add(n),
  22972. camera.add(n),
  22973. t.enabled = !1,
  22974. this.update = function(e) {
  22975. 1 == t.enabled && (n.rotation.z += 15 * e)
  22976. }
  22977. }
  22978. )(this.camera);
  22979. window.Loading = e,
  22980. this.updateListeners.push(e)
  22981. }
  22982. ,
  22983. h.prototype.createCursor = function(e, t, i, n, r) {
  22984. var o, a = new M.SpriteMaterial({
  22985. opacity: i,
  22986. color: n,
  22987. transparent: t,
  22988. map: this.boluoGetTexture("images/cursor.png"),
  22989. needsUpdate: !0,
  22990. side: M.DoubleSide
  22991. });
  22992. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22993. a.map.repeat = new M.Vector2(1 / 17,1),
  22994. a.depthTest = !1,
  22995. a.blending = M.AdditiveBlending,
  22996. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22997. o.position.z = -2,
  22998. o.visible = !1,
  22999. o.name = "cursor",
  23000. this.camera.add(o),
  23001. this.scene.add(this.camera),
  23002. this.cursor = o;
  23003. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23004. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23005. this.updateListeners.push(s)
  23006. }
  23007. ,
  23008. h.prototype.CursorAnimation = function(e, t, o) {
  23009. this.cursor = t,
  23010. this.raycaster = new M.Raycaster,
  23011. this.targetEventObj = {},
  23012. this.type = 1,
  23013. this.tweenFlag = !0;
  23014. var s = this;
  23015. this.target = o,
  23016. console.log(o.uuid),
  23017. this.euler = new M.Euler,
  23018. this.q0 = new M.Quaternion,
  23019. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23020. this.zee = new M.Vector3(0,0,1),
  23021. this.alpha = -1e3,
  23022. this.beta = -1e3,
  23023. this.gamma = -1e3,
  23024. this.orient = M.Math.degToRad(window.orientation || 0),
  23025. window.addEventListener("orientationchange", function() {
  23026. s.orient = M.Math.degToRad(window.orientation || 0)
  23027. }),
  23028. window.addEventListener("deviceorientation", function(e) {
  23029. var t = M.Math.degToRad(e.alpha)
  23030. , i = M.Math.degToRad(e.beta)
  23031. , n = M.Math.degToRad(e.gamma);
  23032. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23033. -1e3 === s.beta && (s.beta = i),
  23034. -1e3 === s.gamma && (s.gamma = n),
  23035. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23036. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23037. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23038. s.beta = i,
  23039. s.gamma = n),
  23040. h.vrDebug) {
  23041. $("#info-device-orientation").css("display", "block");
  23042. var r = "";
  23043. r += "alpha=(" + s.alpha + ")<BR/>",
  23044. r += "beta=(" + s.beta + ")<BR/>",
  23045. r += "gamma=" + s.gamma + "<BR/>",
  23046. document.getElementById("info-device-orientation").innerHTML = r
  23047. }
  23048. }),
  23049. this.setObjectQuaternion = function(e, t, i, n, r) {
  23050. s.euler.set(i, t, -n, "YXZ"),
  23051. e.setFromEuler(s.euler),
  23052. e.multiply(s.q1),
  23053. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23054. o.updateMatrixWorld()
  23055. }
  23056. ,
  23057. parent !== window && window.addEventListener("message", function(e) {
  23058. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23059. o && o.alpha && o.beta && o.gamma && (t = a,
  23060. i = M.Math.degToRad(o.alpha),
  23061. n = M.Math.degToRad(o.beta),
  23062. r = M.Math.degToRad(o.gamma),
  23063. t ? (-1e3 === s.alpha && (s.alpha = i),
  23064. -1e3 === s.beta && (s.beta = n),
  23065. -1e3 === s.gamma && (s.gamma = r),
  23066. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23067. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23068. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23069. s.beta = n,
  23070. s.gamma = r))
  23071. }),
  23072. this.update = function(e) {
  23073. TWEEN.update(),
  23074. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23075. this.triggerTargetEvent())
  23076. }
  23077. ,
  23078. this.triggerTargetEvent = function() {
  23079. var e = this.choseObj()
  23080. , t = e ? e.object : void 0;
  23081. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23082. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23083. t && t.enabled && this.startAnimate(function() {
  23084. this.clickCallback(t)
  23085. }
  23086. .bind(this))) : this.type,
  23087. this.targetEventObj.lastObj = t)
  23088. }
  23089. ,
  23090. this.choseObj = function() {
  23091. this.raycaster.setFromCamera({
  23092. x: 0,
  23093. y: 0
  23094. }, o);
  23095. var e = (this.raycaster.ray,
  23096. window.vrMarkers)
  23097. , t = this.raycaster.intersectObjects(e);
  23098. if (0 < t.length)
  23099. return t[0]
  23100. }
  23101. ,
  23102. this.clickCallback = function(e) {
  23103. this.runTHREEAction(e, "onclick")
  23104. }
  23105. ,
  23106. this.runTHREEAction = function(e, t) {
  23107. switch (t) {
  23108. case "onclick":
  23109. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23110. e()
  23111. });
  23112. break;
  23113. case "onhover":
  23114. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23115. e()
  23116. });
  23117. break;
  23118. case "onout":
  23119. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23120. e()
  23121. })
  23122. }
  23123. }
  23124. ,
  23125. this.startAnimate = function(e) {
  23126. this.tweenFlag && this.initAnimation(e)
  23127. }
  23128. ,
  23129. this.initAnimation = function(e) {
  23130. var t = this
  23131. , i = this.cursor.material.map.offset;
  23132. t.tweenFlag = !1,
  23133. this.cursorAnimate = new TWEEN.Tween(i).to({
  23134. x: 1
  23135. }, 1e3).onStart(function() {
  23136. t.tweenFlag = !1
  23137. }).onStop(function() {
  23138. t.tweenFlag = !0,
  23139. this.x = 0,
  23140. i.x = 0
  23141. }).onUpdate(function() {}).onComplete(function() {
  23142. e(),
  23143. i.x = 0,
  23144. setTimeout(function() {
  23145. t.tweenFlag = !0
  23146. }, 1500)
  23147. }),
  23148. this.cursorAnimate.easing(function(e) {
  23149. return Math.floor(17 * e) / 17
  23150. }),
  23151. this.cursorAnimate.start()
  23152. }
  23153. ,
  23154. this.autoCursorPosition = function(e) {
  23155. this.cursor.scale.set(.3, .3, .3)
  23156. }
  23157. }
  23158. ,
  23159. h.prototype.vrRenderer = function(a, i, e) {
  23160. var s = new i.vrCamera(e);
  23161. s.bananaAspect = .8,
  23162. this.width,
  23163. this.height;
  23164. i = this;
  23165. this.setSize = function(e, t) {
  23166. a.setSize.call(this, e, t),
  23167. i.width = e,
  23168. i.height = t
  23169. }
  23170. ,
  23171. this.render = function(e, t, i, n) {
  23172. var r, o;
  23173. if (window.cameraQua = t.quaternion.clone(),
  23174. t.__RESS__SKIP__STEREO__)
  23175. return a.render(e, t, i, n);
  23176. if ("PerspectiveCamera" === t.type)
  23177. r = s.cameraL,
  23178. o = s.cameraR,
  23179. e.updateMatrixWorld(),
  23180. null === t.parent && t.updateMatrixWorld(),
  23181. s.vrCameraUpdate(t);
  23182. else {
  23183. if ("OrthographicCamera" !== t.type)
  23184. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23185. r = o = t
  23186. }
  23187. a.setScissorTest(!0),
  23188. a.setScissor(0, 0, this.width / 2, this.height),
  23189. a.setViewport(0, 0, this.width / 2, this.height),
  23190. a.render.call(this, e, r, i, n),
  23191. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23192. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23193. a.render.call(this, e, o, i, n),
  23194. a.setScissorTest(!1)
  23195. }
  23196. ,
  23197. this.__proto__ = {
  23198. __proto__: a
  23199. }
  23200. }
  23201. ,
  23202. h.prototype.vrCamera = function(e) {
  23203. this.type = "StereoCamera",
  23204. this._aspect = 1,
  23205. this._overlap = .064,
  23206. this.cameraL = new M.PerspectiveCamera,
  23207. this.cameraL.layers.enable(1),
  23208. this.cameraL.matrixAutoUpdate = !1,
  23209. this.cameraR = new M.PerspectiveCamera,
  23210. this.cameraR.layers.enable(2),
  23211. this.cameraR.matrixAutoUpdate = !1,
  23212. this.eyeRight = new M.Matrix4,
  23213. this.eyeLeft = new M.Matrix4,
  23214. this.vrCameraNeedsUpdate = !0,
  23215. window.vrCameraL = this.cameraL,
  23216. Object.defineProperty(this, "bananaAspect", {
  23217. get: function() {
  23218. return this._aspect
  23219. },
  23220. set: function(e) {
  23221. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23222. this._aspect = e
  23223. }
  23224. }),
  23225. Object.defineProperty(this, "overlap", {
  23226. get: function() {
  23227. return this._overlap
  23228. },
  23229. set: function(e) {
  23230. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23231. this._overlap = e
  23232. }
  23233. }),
  23234. this.vrCameraUpdate = function(e) {
  23235. if (this.vrCameraNeedsUpdate = !0,
  23236. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23237. this.vrCameraNeedsUpdate) {
  23238. this.vrCameraNeedsUpdate = !1,
  23239. console.debug("vrCameraUpdate"),
  23240. this.bananaFocus = e.focus,
  23241. this.bananaFov = e.fov,
  23242. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23243. this.bananaNear = e.near,
  23244. this.bananaFar = e.far,
  23245. console.debug(e.aspect),
  23246. this.bananaFocus = 10;
  23247. 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);
  23248. this.eyeLeft.elements[12] = -r,
  23249. this.eyeRight.elements[12] = r,
  23250. t = -a * this.bananaReal_aspect + o,
  23251. i = a * this.bananaReal_aspect + o,
  23252. n.elements[0] = 2 * this.bananaNear / (i - t),
  23253. n.elements[8] = (i + t) / (i - t),
  23254. this.cameraL.projectionMatrix.copy(n),
  23255. t = -a * this.bananaReal_aspect - o,
  23256. i = a * this.bananaReal_aspect - o,
  23257. n.elements[0] = 2 * this.bananaNear / (i - t),
  23258. n.elements[8] = (i + t) / (i - t),
  23259. this.cameraR.projectionMatrix.copy(n)
  23260. }
  23261. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23262. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23263. }
  23264. }
  23265. ,
  23266. h.prototype.boluoGetTexture = function(e) {
  23267. var t = new M.TextureLoader;
  23268. return t.crossOrigin = "anonymous",
  23269. t.load(e)
  23270. }
  23271. ,
  23272. h.prototype.updateScreenSize = function(e) {
  23273. var t, i, n, r = !1;
  23274. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23275. n = e.height,
  23276. r = !0,
  23277. t = 1) : (i = $("#player").width(),
  23278. n = $("#player").height(),
  23279. e && e.resize && (o = this.renderWidth,
  23280. a = this.renderHeight),
  23281. i === o && n === a && !this.forceUpdateSize || (o = i,
  23282. a = n,
  23283. r = !0,
  23284. t = window.devicePixelRatio)),
  23285. r && (this.setSize(i, n, t),
  23286. this.forceUpdateSize = !1)
  23287. }
  23288. ,
  23289. h.prototype.updateComponents = function() {
  23290. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23291. this.updateListeners[t].update(e)
  23292. }
  23293. ,
  23294. h.prototype.suspend = function() {
  23295. this.started = !1,
  23296. this.suspendedObjects = this.scene.children.map(function(e) {
  23297. return this.scene.remove(e),
  23298. e
  23299. }
  23300. .bind(this)),
  23301. this.render()
  23302. }
  23303. ,
  23304. h.prototype.resume = function() {
  23305. this.suspendedObjects.forEach(function(e) {
  23306. this.scene.add(e)
  23307. }
  23308. .bind(this)),
  23309. this.suspendedObjects = [],
  23310. this.started = !0,
  23311. b()
  23312. }
  23313. ;
  23314. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23315. this.started && (window.requestAnimationFrame(b),
  23316. this.updateScreenSize(),
  23317. this.updateComponents(),
  23318. this.updateTextureMemory(),
  23319. this.render(),
  23320. this.emit(r.AfterRender))
  23321. };
  23322. h.prototype.getImageData = (E = document.createElement("canvas"),
  23323. _ = E.getContext("2d"),
  23324. function(e, t, i) {
  23325. return E.width === t && E.height === i || (E.width = t,
  23326. E.height = i),
  23327. _.drawImage(e, 0, 0, t, i),
  23328. _.getImageData(0, 0, t, i)
  23329. }
  23330. ),
  23331. h.prototype.initSizedTexture2D = function(e, t, i) {
  23332. var n = this.renderer
  23333. , r = n.context
  23334. , o = n.state
  23335. , a = new M.Texture(null);
  23336. !(a.flipY = !1) !== i && (i = !1),
  23337. a.generateMipmaps = i;
  23338. var s = n.paramThreeToGL(a.format)
  23339. , l = n.paramThreeToGL(a.type)
  23340. , c = n.properties.get(a)
  23341. , h = r.createTexture();
  23342. o.bindTexture(r.TEXTURE_2D, h),
  23343. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23344. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23345. a.wrapS = t,
  23346. a.wrapT = t;
  23347. var u = n.paramThreeToGL(t);
  23348. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23349. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23350. i ? (a.magFilter = M.LinearFilter,
  23351. a.minFilter = M.LinearMipMapLinearFilter,
  23352. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23353. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23354. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23355. a.minFilter = M.LinearFilter,
  23356. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23357. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23358. o.bindTexture(r.TEXTURE_2D, null),
  23359. c.__webglTexture = h,
  23360. a
  23361. }
  23362. ,
  23363. h.prototype.initSizedCubeMap = function(e, t) {
  23364. var i = this.renderer
  23365. , n = i.context
  23366. , r = i.state
  23367. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23368. o.flipY = !1,
  23369. o.generateMipmaps = t;
  23370. var a = i.paramThreeToGL(o.format)
  23371. , s = i.paramThreeToGL(o.type)
  23372. , l = i.properties.get(o)
  23373. , c = n.createTexture();
  23374. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23375. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23376. for (var h = 0; h < 6; h++)
  23377. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23378. return t ? (o.magFilter = M.LinearFilter,
  23379. o.minFilter = M.LinearMipMapLinearFilter,
  23380. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23381. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23382. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23383. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23384. o.minFilter = M.LinearFilter,
  23385. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23386. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23387. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23388. l.__image__webglTextureCube = c,
  23389. o
  23390. }
  23391. ,
  23392. h.prototype.deallocateCubeTexture = function(e) {
  23393. var t = this.renderer
  23394. , i = t.context
  23395. , n = t.properties.get(e);
  23396. i.deleteTexture(n.__image__webglTextureCube)
  23397. }
  23398. ,
  23399. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23400. var a = this.renderer
  23401. , s = a.context
  23402. , l = a.state
  23403. , c = a.properties.get(t);
  23404. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23405. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23406. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23407. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23408. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23409. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23410. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23411. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23412. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23413. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23414. l.bindTexture(s.TEXTURE_2D, null)
  23415. }
  23416. ,
  23417. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23418. var s = this.renderer
  23419. , l = s.context
  23420. , c = s.state
  23421. , h = s.properties.get(t);
  23422. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23423. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23424. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23425. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23426. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23427. }
  23428. ,
  23429. h.prototype.rebuildMipMaps2D = function(e) {
  23430. var t = this.renderer
  23431. , i = t.context
  23432. , n = t.state;
  23433. t.properties.get(e),
  23434. i.generateMipmap(i.TEXTURE_2D),
  23435. n.bindTexture(i.TEXTURE_2D, null)
  23436. }
  23437. ,
  23438. h.prototype.rebuildMipMaps3D = function(e) {
  23439. var t = this.renderer
  23440. , i = t.context
  23441. , n = t.state
  23442. , r = t.properties.get(e);
  23443. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23444. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23445. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23446. }
  23447. ,
  23448. h.prototype.renderToCubeMap = (P = !1,
  23449. F = N = D = L = O = null,
  23450. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23451. this.renderer.context,
  23452. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23453. (O = new M.Scene).add(L),
  23454. D = new M.ShaderMaterial({
  23455. uniforms: {
  23456. tDiffuse: {
  23457. type: "t",
  23458. value: null
  23459. },
  23460. alpha: {
  23461. type: "f",
  23462. value: 1
  23463. }
  23464. },
  23465. vertexShader: R.basicTextured.vertexShader,
  23466. fragmentShader: R.basicTextured.fragmentShader,
  23467. depthWrite: !1,
  23468. depthTest: !1,
  23469. side: M.DoubleSide
  23470. }),
  23471. N = new M.PlaneBufferGeometry(1,1),
  23472. (F = new M.Mesh(N,D)).position.z = 0,
  23473. O.add(F),
  23474. P = !0);
  23475. var m = N.getAttribute("uv");
  23476. m.setDynamic(!0),
  23477. m.needsUpdate = !0;
  23478. var v = m.array
  23479. , y = r / i
  23480. , A = o / n
  23481. , C = a / i
  23482. , I = s / n;
  23483. v[0] = y,
  23484. v[1] = A + I,
  23485. v[2] = y + C,
  23486. v[3] = A + I,
  23487. v[4] = y,
  23488. v[5] = A,
  23489. v[6] = y + C,
  23490. v[7] = A;
  23491. var E = N.getAttribute("position");
  23492. E.setDynamic(!0),
  23493. E.needsUpdate = !0;
  23494. var _ = E.array
  23495. , b = l / t.width - .5
  23496. , w = c / t.height - .5
  23497. , T = h / t.width
  23498. , x = u / t.height;
  23499. _[0] = b,
  23500. _[1] = w + x,
  23501. _[3] = b + T,
  23502. _[4] = w + x,
  23503. _[6] = b,
  23504. _[7] = w,
  23505. _[9] = b + T,
  23506. _[10] = w,
  23507. this.renderer.properties.get(e),
  23508. D.uniforms.tDiffuse.value = e,
  23509. D.blending = p || M.NoBlending,
  23510. D.transparent = !!f,
  23511. null != g || (g = 1),
  23512. D.uniforms.alpha.value = g,
  23513. D.needUpdate = !0,
  23514. t.activeCubeFace = d,
  23515. t.viewport.set(0, 0, t.width, t.height);
  23516. var S = this.renderer.autoClear;
  23517. this.renderer.autoClear = !1,
  23518. this.renderer.render(O, L, t, !1),
  23519. this.renderer.autoClear = S
  23520. }
  23521. ),
  23522. h.prototype.copyCubeMap = (g = !1,
  23523. C = A = y = v = m = null,
  23524. I = new M.Euler,
  23525. new M.Vector3,
  23526. function(e, t, i, n, r, o, a, s, l) {
  23527. this.renderer,
  23528. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23529. (m = new M.Scene).add(v),
  23530. y = new M.ShaderMaterial({
  23531. uniforms: {
  23532. tDiffuse: {
  23533. type: "t",
  23534. value: null
  23535. },
  23536. alpha: {
  23537. type: "f",
  23538. value: 1
  23539. }
  23540. },
  23541. vertexShader: R.copyCubeMap.vertexShader,
  23542. fragmentShader: R.copyCubeMap.fragmentShader,
  23543. depthWrite: !1,
  23544. depthTest: !1,
  23545. side: M.DoubleSide
  23546. }),
  23547. A = new M.BoxGeometry(2,2,2),
  23548. C = new M.Mesh(A,y),
  23549. m.add(C),
  23550. g = !0);
  23551. for (var c = 0; c < 6; c++)
  23552. h.getCubeOrientationForCubeFace(c, I),
  23553. C.rotation.copy(I),
  23554. C.matrixWorldNeedsUpdate = !0,
  23555. C.updateMatrixWorld(),
  23556. y.uniforms.tDiffuse.value = e,
  23557. y.blending = a || M.NoBlending,
  23558. y.transparent = !!s,
  23559. null != l || (l = 1),
  23560. y.uniforms.alpha.value = l,
  23561. y.needUpdate = !0,
  23562. t.activeCubeFace = c,
  23563. t.viewport.set(0, 0, r, o),
  23564. this.renderer.render(m, v, t, !1)
  23565. }
  23566. ),
  23567. h.getLookAtForCubeFace = function(e, t) {
  23568. switch (e) {
  23569. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23570. t.set(1, 0, 0);
  23571. break;
  23572. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23573. t.set(-1, 0, 0);
  23574. break;
  23575. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23576. t.set(0, 1, 0);
  23577. break;
  23578. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23579. t.set(0, -1, 0);
  23580. break;
  23581. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23582. t.set(0, 0, 1);
  23583. break;
  23584. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23585. t.set(0, 0, -1)
  23586. }
  23587. }
  23588. ,
  23589. h.getCubeOrientationForCubeFace = function(e, t) {
  23590. switch (e) {
  23591. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23592. t.set(0, -Math.PI / 2, 0);
  23593. break;
  23594. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23595. t.set(0, Math.PI / 2, 0);
  23596. break;
  23597. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23598. t.set(Math.PI / 2, Math.PI, 0);
  23599. break;
  23600. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23601. t.set(-Math.PI / 2, Math.PI, 0);
  23602. break;
  23603. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23604. t.set(0, -Math.PI, 0);
  23605. break;
  23606. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23607. t.set(0, 0, 0)
  23608. }
  23609. }
  23610. ,
  23611. t.exports = h
  23612. }
  23613. , {
  23614. "../enum/GLCubeFaces": 25,
  23615. "../enum/GLTextureType": 26,
  23616. "../enum/SceneRendererEvents": 43,
  23617. "../exception/BasicException": 55,
  23618. "../exception/RendererCreationException": 57,
  23619. "../settings": 166,
  23620. "../shaders": 167,
  23621. "../util/browser": 182,
  23622. events: 202,
  23623. three: 217
  23624. }],
  23625. 159: [function(e, t, i) {
  23626. "use strict";
  23627. function n(e) {
  23628. this.messenger = new a(e),
  23629. this.clientKey = null
  23630. }
  23631. var o = e("../util/ajax")
  23632. , r = e("./PostMessageType")
  23633. , a = e("./postmessage")
  23634. , s = e("./VersionInfo")
  23635. , l = e("events").EventEmitter
  23636. , c = window.location.origin + "/api/v1/user/";
  23637. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23638. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23639. }
  23640. ,
  23641. n.prototype.waitForConnection = function() {
  23642. return new Promise(function(t, i) {
  23643. this.messenger.on(r.CONNECT, function(e) {
  23644. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23645. }
  23646. .bind(this))
  23647. }
  23648. .bind(this))
  23649. }
  23650. ,
  23651. n.prototype.onConnectionReceived = function(i) {
  23652. return this.messenger.setTarget(i.source, i.origin),
  23653. this.verifyConnection(i).then(function(e, t) {
  23654. this.messenger.send({
  23655. type: r.ACCEPT,
  23656. toId: i.fromId,
  23657. warning: t
  23658. }),
  23659. this.clientKey = e,
  23660. this.messenger.removeAllListeners(r.CONNECT),
  23661. this.bindEvents()
  23662. }
  23663. .bind(this), function(e) {
  23664. this.messenger.send({
  23665. type: r.REJECT,
  23666. toId: i.fromId,
  23667. reason: e
  23668. }),
  23669. this.messenger.setTarget()
  23670. }
  23671. .bind(this))
  23672. }
  23673. ,
  23674. n.prototype.verifyConnection = function(r) {
  23675. return new Promise(function(e, t) {
  23676. var i;
  23677. if (s.isDeprecated(r.sdkVersion))
  23678. i = "这个版本正在被弃用";
  23679. else if (!s.isSupported(r.sdkVersion))
  23680. return t("不支持此版本的SDK");
  23681. var n = {
  23682. cache: !1,
  23683. headers: {
  23684. "X-port-Application-Key": r.applicationKey,
  23685. "X-port-Referrer": r.origin
  23686. }
  23687. };
  23688. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23689. }
  23690. )
  23691. }
  23692. ,
  23693. n.prototype.onMessageReceived = function(t) {
  23694. if (this.validateClientApplicationKey(t.applicationKey)) {
  23695. var i = this;
  23696. t.onDone = function(e) {
  23697. e.toId = t.fromId,
  23698. e.uid = t.uid,
  23699. e.type = r.RESPONSE,
  23700. i.messenger.send(e)
  23701. }
  23702. ,
  23703. this.emit(r.ACTION, t)
  23704. }
  23705. }
  23706. ,
  23707. n.prototype.validateClientApplicationKey = function(e) {
  23708. return this.clientKey === e
  23709. }
  23710. ,
  23711. n.prototype.sendEvent = function(e, t) {
  23712. this.messenger.send({
  23713. type: r.EVENT,
  23714. eventType: e,
  23715. eventData: t
  23716. })
  23717. }
  23718. ,
  23719. t.exports = n
  23720. }
  23721. , {
  23722. "../util/ajax": 181,
  23723. "./PostMessageType": 160,
  23724. "./VersionInfo": 163,
  23725. "./postmessage": 165,
  23726. events: 202
  23727. }],
  23728. 160: [function(e, t, i) {
  23729. "use strict";
  23730. t.exports = Object.freeze({
  23731. CONNECT: "postmessage.connect",
  23732. ACCEPT: "postmessage.accept",
  23733. REJECT: "postmessage.reject",
  23734. ACTION: "postmessage.action",
  23735. RESPONSE: "postmessage.response",
  23736. EVENT: "postmessage.event"
  23737. })
  23738. }
  23739. , {}],
  23740. 161: [function(e, t, i) {
  23741. "use strict";
  23742. t.exports = Object.freeze({
  23743. MOVE: "sdk.move",
  23744. ENTER_PANO: "sdk.enterpano",
  23745. MODEL_LOADED: "sdk.modelloaded"
  23746. })
  23747. }
  23748. , {}],
  23749. 162: [function(e, t, i) {
  23750. "use strict";
  23751. t.exports = Object.freeze({
  23752. FLY: "transition.fly",
  23753. FADEOUT: "transition.fade",
  23754. INSTANT: "transition.instant"
  23755. })
  23756. }
  23757. , {}],
  23758. 163: [function(e, t, i) {
  23759. "use strict";
  23760. t.exports = {
  23761. current: "1.0",
  23762. supported: ["1.0"],
  23763. deprecated: [],
  23764. isSupported: function(e) {
  23765. return -1 !== this.supported.indexOf(e)
  23766. },
  23767. isDeprecated: function(e) {
  23768. return -1 !== this.deprecated.indexOf(e)
  23769. },
  23770. isValid: function(e) {
  23771. return this.isSupported(e) || this.isDeprecated(e)
  23772. }
  23773. }
  23774. }
  23775. , {}],
  23776. 164: [function(q, X, e) {
  23777. (function(e) {
  23778. "use strict";
  23779. function r(e, t, i) {
  23780. e = e && e.toLowerCase().trim();
  23781. var n = new C.UP.clone
  23782. , r = Math.PI / 3
  23783. , o = Math.PI / 2;
  23784. switch (e) {
  23785. case "left":
  23786. i.copy(t),
  23787. i.applyAxisAngle(n, o);
  23788. break;
  23789. case "right":
  23790. i.copy(t),
  23791. i.applyAxisAngle(n, -o);
  23792. break;
  23793. case "forwardleft":
  23794. i.copy(t),
  23795. i.applyAxisAngle(n, r);
  23796. break;
  23797. case "forwardright":
  23798. i.copy(t),
  23799. i.applyAxisAngle(n, -r);
  23800. break;
  23801. case "forward":
  23802. default:
  23803. i.copy(t)
  23804. }
  23805. return i
  23806. }
  23807. function o(e, t) {
  23808. if (e) {
  23809. var i = {
  23810. pano: e,
  23811. lookAtPoint: null,
  23812. duration: null,
  23813. maxDistanceOverride: null,
  23814. skipWarpingCheck: !1
  23815. };
  23816. this.player.flyToPano(i, function() {
  23817. t && t({
  23818. success: !0,
  23819. message: "Transition complete."
  23820. })
  23821. })
  23822. } else
  23823. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23824. t && t({
  23825. success: !1,
  23826. error: "Unable to find pano."
  23827. })
  23828. }
  23829. function a(e, t) {
  23830. t.copy(C.FORWARD),
  23831. e.getDirection(t)
  23832. }
  23833. function c(i) {
  23834. return {
  23835. panos: i.panos.list.map(function(e) {
  23836. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23837. return {
  23838. uuid: e.id,
  23839. aligned: e.alignmentType === g.ALIGNED,
  23840. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23841. position: function(e) {
  23842. return e.alignmentType !== g.ALIGNED ? null : {
  23843. x: e.position.x,
  23844. y: e.position.y,
  23845. z: e.position.z
  23846. }
  23847. }(e),
  23848. rotation: function(e) {
  23849. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23850. return {
  23851. x: h.Math.radToDeg(t._x),
  23852. y: h.Math.radToDeg(t._y),
  23853. z: h.Math.radToDeg(t._z)
  23854. }
  23855. }(e),
  23856. thumbnail: t
  23857. }
  23858. })
  23859. }
  23860. }
  23861. 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"),
  23862. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23863. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23864. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23865. N.angle = 0,
  23866. N.angleTravelled = 0,
  23867. N.playerDirection = new h.Vector3,
  23868. N.lastFacingDirection = new h.Vector3,
  23869. N.onDone = null,
  23870. N.player = null,
  23871. N.start = function(e, t, i, n) {
  23872. N.active = !0,
  23873. e && t && (t = 0),
  23874. N.angle = e || t,
  23875. N.xAngle = e,
  23876. N.yAngle = t,
  23877. N.angleTravelled = 0,
  23878. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23879. i.getDirection(N.playerDirection),
  23880. N.lastFacingDirection.copy(N.playerDirection),
  23881. N.projectVectors(),
  23882. N.onDone = n,
  23883. N.player = i,
  23884. N()
  23885. }
  23886. ,
  23887. N.projectVectors = function() {
  23888. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23889. N.lastFacingDirection.projectOnPlane(C.UP))
  23890. }
  23891. ,
  23892. N), P = (i = new h.Vector3,
  23893. function(e) {
  23894. e ? (i.copy(e.position),
  23895. i.add(e.discPosition),
  23896. s.projectPositionToCanvas(i, this.player.camera, i),
  23897. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23898. }
  23899. ), O = (l = new h.Vector3,
  23900. function(e) {
  23901. var t = this.player.getDirection();
  23902. l.copy(t);
  23903. var i = l.y;
  23904. l.y = 0,
  23905. l.normalize();
  23906. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23907. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23908. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23909. 0;
  23910. this.player.mode === I.DOLLHOUSE && (n = -n);
  23911. var r = function() {
  23912. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23913. }
  23914. .call(this) - .1
  23915. , o = function() {
  23916. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23917. }
  23918. .call(this) + .1
  23919. , a = n + e;
  23920. r < a ? a = r : a < o && (a = o);
  23921. var s = a - n;
  23922. return 0 < e && s < .01 && (s = 0),
  23923. e < 0 && -.01 < s && (s = 0),
  23924. s
  23925. }
  23926. ), L = (t = new h.Euler,
  23927. function(e) {
  23928. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23929. {
  23930. position: {
  23931. x: e.position.x,
  23932. y: e.position.y,
  23933. z: e.position.z
  23934. },
  23935. rotation: {
  23936. x: h.Math.radToDeg(t.x),
  23937. y: h.Math.radToDeg(t.y),
  23938. z: 0
  23939. },
  23940. pano: e.currentPano ? e.currentPano.id : null,
  23941. mode: e.mode
  23942. }
  23943. }
  23944. ), D = null;
  23945. function N() {
  23946. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23947. N.player.getDirection(N.playerDirection),
  23948. N.projectVectors();
  23949. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23950. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23951. N.onDone && (0,
  23952. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23953. window.setTimeout(N, 4))
  23954. }
  23955. X.exports = {
  23956. init: function(e, t, i, n, r) {
  23957. Y.init(e, t, i, r),
  23958. D = new Promise(function(e, t) {
  23959. i.on(_.Ready, function() {
  23960. e()
  23961. })
  23962. }
  23963. .bind(this));
  23964. var o = new u(window)
  23965. , a = o.waitForConnection();
  23966. a.then(function(e) {
  23967. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23968. });
  23969. var s, l = (s = Date.now(),
  23970. function() {
  23971. if (!(Date.now() - s < 100)) {
  23972. var e = L(i);
  23973. o.sendEvent(b.MOVE, {
  23974. state: e
  23975. }),
  23976. s = Date.now()
  23977. }
  23978. }
  23979. );
  23980. i.on(_.Move, l),
  23981. i.on(_.ViewChanged, l),
  23982. n.on(p.ActiveModelChanged, function(e) {
  23983. function t(e) {
  23984. var t, i = e.newPano.id;
  23985. e.oldPano && (t = e.oldPano.id),
  23986. i !== t && o.sendEvent(b.ENTER_PANO, {
  23987. oldPano: t,
  23988. newPano: i
  23989. })
  23990. }
  23991. var i = e.model
  23992. , n = e.oldModel;
  23993. Y.model = i,
  23994. a.then(function() {
  23995. o.sendEvent(b.MODEL_LOADED, {
  23996. metadata: c(i)
  23997. })
  23998. }),
  23999. n && n.panos.forEach(function(e) {
  24000. e.removeEventListener("enter", t)
  24001. }),
  24002. i.panos.forEach(function(e) {
  24003. e.on("enter", t)
  24004. })
  24005. })
  24006. }
  24007. };
  24008. var F, B, V, k, U, H, z, G, W, j, Y = {
  24009. director: null,
  24010. player: null,
  24011. controls: null,
  24012. sceneRenderer: null,
  24013. model: null,
  24014. init: function(e, t, i, n) {
  24015. this.director = e,
  24016. this.player = i,
  24017. this.controls = t,
  24018. this.sceneRenderer = n
  24019. },
  24020. handleToObject: {},
  24021. objectToHandle: {},
  24022. handleCount: 0,
  24023. onMessageReceive: function(e) {
  24024. if (e) {
  24025. var t = e.targetFunction
  24026. , i = e.params
  24027. , n = e.onDone;
  24028. t && this[t] && this[t](i, n)
  24029. }
  24030. },
  24031. waitForInit: function(e, t) {
  24032. D.then(t.bind({
  24033. success: !0,
  24034. message: "Init complete."
  24035. }))
  24036. },
  24037. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24038. j = new h.Quaternion,
  24039. function(e, t) {
  24040. var i = e.pano
  24041. , n = e.rotation
  24042. , r = e.transition;
  24043. if (!this.model)
  24044. return t({
  24045. success: !1,
  24046. error: "The model has not been loaded yet"
  24047. });
  24048. var o = this.model.panos.get(i);
  24049. if (!o)
  24050. return t({
  24051. success: !1,
  24052. error: i + " does not exist in this model"
  24053. });
  24054. if (!n)
  24055. return t({
  24056. sucess: !1,
  24057. erorr: n + " is not a valid rotation"
  24058. });
  24059. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24060. console.log(n.z);
  24061. var a = {
  24062. success: !0,
  24063. message: i
  24064. };
  24065. if (r === v.FADEOUT)
  24066. j.setFromEuler(W),
  24067. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24068. else {
  24069. var s, l;
  24070. r === v.INSTANT && (l = s = 0);
  24071. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24072. this.player.flyToPano({
  24073. pano: o,
  24074. lookAtPoint: c,
  24075. duration: s,
  24076. aimDuration: l
  24077. }, t.bind(this, a))
  24078. }
  24079. }
  24080. ),
  24081. moveInDirection: function(e, t) {
  24082. var i = e.direction;
  24083. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24084. void (t && t({
  24085. success: !1,
  24086. error: "Invalid direction."
  24087. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24088. t(e ? {
  24089. success: !0,
  24090. message: "moved " + i
  24091. } : {
  24092. success: !1,
  24093. error: "Cannot move in direction: " + i
  24094. })
  24095. })
  24096. },
  24097. getPose: function(e, t) {
  24098. return this.player.camera.position,
  24099. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24100. t({
  24101. success: !0,
  24102. message: L(this.player)
  24103. })
  24104. },
  24105. takeScreenShot: (z = new h.PerspectiveCamera,
  24106. G = new h.WebGLRenderTarget,
  24107. function(e, t) {
  24108. if (!e.resolution)
  24109. return t({
  24110. success: !1,
  24111. error: "An invalid resolution was specified"
  24112. });
  24113. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24114. var i = this.sceneRenderer.renderer.getSize();
  24115. e.resolution.width = i.width,
  24116. e.resolution.height = i.height
  24117. }
  24118. z.layers.set(T.DEFAULT),
  24119. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24120. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24121. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24122. var n = e.resolution.width
  24123. , r = e.resolution.height
  24124. , o = n / r;
  24125. z.position.copy(this.sceneRenderer.camera.position),
  24126. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24127. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24128. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24129. G.setSize(n, r),
  24130. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24131. var a = new Uint8Array(n * r * 4);
  24132. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24133. var s = S.encode({
  24134. data: a,
  24135. width: n,
  24136. height: r,
  24137. heading: 180,
  24138. pitch: 0
  24139. }, {
  24140. quality: 75,
  24141. flipY: !0
  24142. });
  24143. t({
  24144. success: !0,
  24145. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24146. })
  24147. }
  24148. ),
  24149. findRankedPano: (U = new h.Vector3,
  24150. H = new h.Vector3,
  24151. function(e, t) {
  24152. a(this.player, H),
  24153. r(t, H, U);
  24154. var i = this.player.rankedPanoInDirection(e, U);
  24155. if (i) {
  24156. var n = this.objectToHandle[i.id];
  24157. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24158. this.handleToObject[n] = i),
  24159. n
  24160. }
  24161. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24162. -1
  24163. }
  24164. ),
  24165. findRankedtag: (V = new h.Vector3,
  24166. k = new h.Vector3,
  24167. function(e, t) {
  24168. a(this.player, k),
  24169. r(t, k, V);
  24170. var i = this.player.rankedtagInDirection(e, V);
  24171. if (i) {
  24172. var n = this.objectToHandle[i.sid];
  24173. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24174. this.handleToObject[n] = i),
  24175. n
  24176. }
  24177. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24178. -1
  24179. }
  24180. ),
  24181. clickNearesttag: function(e) {
  24182. this.clickRankedtag(0, e)
  24183. },
  24184. clickRankedtag: function(e, t) {
  24185. var i = function(e, t) {
  24186. var i = this.findRankedtag(e, t);
  24187. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24188. null)
  24189. }
  24190. .call(this, e, t);
  24191. i && P.call(this, i)
  24192. },
  24193. clickNearestPano: function(e, t) {
  24194. this.clickRankedPano(0, e, t)
  24195. },
  24196. clickRankedPano: function(e, t, i) {
  24197. var n = function(e, t) {
  24198. var i = this.findRankedPano(e, t);
  24199. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24200. null)
  24201. }
  24202. .call(this, e, t);
  24203. n ? o.call(this, n, i) : i(null)
  24204. },
  24205. clickPano: function(e, t) {
  24206. var i = this.handleTable[e];
  24207. i ? o.call(this, i, t) : t(null)
  24208. },
  24209. rotateDirection: function(e, t) {
  24210. var i = e.direction
  24211. , n = e.angle;
  24212. if (!R.active) {
  24213. var r = 0
  24214. , o = 0
  24215. , a = 0
  24216. , s = 0;
  24217. if (!n || isNaN(n))
  24218. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24219. void (t && t({
  24220. success: !1,
  24221. error: "Invalid rotation angle."
  24222. }));
  24223. if (this.player.mode === I.TRANSITIONING)
  24224. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24225. void (t && t({
  24226. success: !1,
  24227. error: "Cannot rotate while transitioning"
  24228. }));
  24229. if (i === m.RIGHT || i === m.LEFT)
  24230. i === m.RIGHT && (n = -n),
  24231. r = 0 < n ? -1 : 1,
  24232. a = n;
  24233. else {
  24234. if (i !== m.UP && i !== m.DOWN)
  24235. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24236. void (t && t({
  24237. success: !1,
  24238. error: "Invalid direction for rotation."
  24239. }));
  24240. if (this.player.mode === I.FLOORPLAN)
  24241. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24242. void (t && t({
  24243. success: !1,
  24244. error: "Cannot rotate " + i + " in floorplan mode"
  24245. }));
  24246. if (i === m.DOWN && (n = -n),
  24247. 0 === (n = O.call(this, n)))
  24248. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24249. void (t && t({
  24250. success: !1,
  24251. error: "Already at maximum rotation in direction: " + i
  24252. }));
  24253. o = 0 < n ? 1 : -1,
  24254. s = n
  24255. }
  24256. var l = n;
  24257. n = h.Math.degToRad(n),
  24258. a = h.Math.degToRad(a),
  24259. s = h.Math.degToRad(s);
  24260. var c = this.controls.activeControl;
  24261. c.startRotating(r, o),
  24262. R.start(a, s, this.player, function() {
  24263. c.stopRotating(!0),
  24264. t && t({
  24265. success: !0,
  24266. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24267. })
  24268. })
  24269. }
  24270. },
  24271. rotate: (F = new h.Vector3,
  24272. B = new h.Vector3,
  24273. function(e, t) {
  24274. var i = e.xAngle
  24275. , n = e.yAngle;
  24276. if (!R.active) {
  24277. if (i = i || 0,
  24278. n = n || 0,
  24279. isNaN(i) || isNaN(n))
  24280. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24281. void (t && t({
  24282. success: !1,
  24283. error: "Invalid rotation angle."
  24284. }));
  24285. if (this.player.mode === I.TRANSITIONING)
  24286. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24287. void (t && t({
  24288. success: !1,
  24289. error: "Cannot rotate while transitioning"
  24290. }));
  24291. Math.abs(i) < .01 && (i = 0),
  24292. Math.abs(n) < .01 && (n = 0);
  24293. var r = n;
  24294. n = O.call(this, n);
  24295. var o = 0 < r ? "UP" : "DOWN";
  24296. if (!(i = -i) && r && !n)
  24297. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24298. void (t && t({
  24299. success: !1,
  24300. error: "Already at maximum rotation in direction: " + o
  24301. }));
  24302. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24303. var a = n;
  24304. n = h.Math.degToRad(n),
  24305. i = h.Math.degToRad(i),
  24306. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24307. this.player.getDirection(F),
  24308. B.copy(F).applyAxisAngle(C.UP, i),
  24309. B.applyAxisAngle(C.RIGHT, n);
  24310. var s = (F.angleTo(B),
  24311. 0 < i ? -1 : i < 0 ? 1 : 0)
  24312. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24313. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24314. var c = this.controls.activeControl;
  24315. c.startRotating(s, l),
  24316. R.start(i, n, this.player, function() {
  24317. c.stopRotating(!0),
  24318. t && t({
  24319. success: !0,
  24320. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24321. })
  24322. })
  24323. }
  24324. }
  24325. ),
  24326. panCamera: function(e, i) {
  24327. function t(e) {
  24328. switch (r.removeAllListeners(w.AutoPanComplete),
  24329. r.removeAllListeners(w.AutoPanInterrupt),
  24330. r.removeAllListeners(w.AutoPanClamped),
  24331. e) {
  24332. case w.AutoPanInterrupt:
  24333. i({
  24334. success: !0,
  24335. message: "Camera panning interrupted."
  24336. });
  24337. break;
  24338. case w.AutoPanClamped:
  24339. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24340. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24341. return void i({
  24342. success: !1,
  24343. error: "Already at edge of current model bounds."
  24344. });
  24345. var t = "The view point is outside the bounds for the current model. ";
  24346. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24347. console.warn(t)
  24348. }
  24349. case w.AutoPanComplete:
  24350. i({
  24351. success: !0,
  24352. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24353. })
  24354. }
  24355. }
  24356. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24357. return i({
  24358. success: !1,
  24359. error: "Camera panning is not available in the current mode: " + this.player.mode
  24360. });
  24361. var n = e.position
  24362. , r = this.player.control;
  24363. r.setAutoPanPosition(n.x, n.z),
  24364. r.autoPan = !0;
  24365. var o = function(e, t) {
  24366. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24367. };
  24368. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24369. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24370. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24371. },
  24372. click: function(e, t) {
  24373. var i = e.x
  24374. , n = e.y;
  24375. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24376. n = n / 100 * $("#player").height()),
  24377. this.player.handleInputStart(i, n),
  24378. this.player.updateIntersect(),
  24379. this.player.handleInputEnd(i, n)
  24380. },
  24381. mouseOver: function(e, t) {
  24382. var i = e.x
  24383. , n = e.y;
  24384. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24385. n = n / 100 * $("#player").height()),
  24386. this.player.handleInputMove(i, n),
  24387. this.player.updateIntersect()
  24388. },
  24389. moveToMode: function(e, t) {
  24390. function i(e) {
  24391. t(e ? {
  24392. success: !1,
  24393. error: "Failed to load new mode: " + e
  24394. } : {
  24395. success: !0,
  24396. message: "Moved to new mode: " + n
  24397. })
  24398. }
  24399. var n = e.mode;
  24400. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24401. i()
  24402. }, function(e) {
  24403. i(e)
  24404. }) : t({
  24405. success: !1,
  24406. error: "Invalid mode selection"
  24407. })
  24408. }
  24409. }
  24410. }
  24411. ).call(this, "/js/sdk/automation.js")
  24412. }
  24413. , {
  24414. "../constants": 8,
  24415. "../enum/AlignmentType": 17,
  24416. "../enum/ControlEvents": 21,
  24417. "../enum/Direction": 22,
  24418. "../enum/GLCubeFaces": 25,
  24419. "../enum/Keys": 30,
  24420. "../enum/ModelManagerEvents": 33,
  24421. "../enum/PlayerEvents": 40,
  24422. "../enum/RenderLayers": 41,
  24423. "../enum/Vectors": 50,
  24424. "../enum/Viewmode": 51,
  24425. "../enum/WarpStyle": 52,
  24426. "../lib/jpeg_encoder": 94,
  24427. "../sdk/SdkEvents": 161,
  24428. "../settings": 166,
  24429. "../util/common": 185,
  24430. "../util/logger": 189,
  24431. "../util/math": 190,
  24432. "../util/panorama": 191,
  24433. "./ApiHost": 159,
  24434. "./PostMessageType": 160,
  24435. "./TransitionStyles": 162,
  24436. three: 217
  24437. }],
  24438. 165: [function(e, t, i) {
  24439. "use strict";
  24440. function n(e) {
  24441. this.sourceWindow = e,
  24442. this.targetWindow = null,
  24443. this.targetOrigin = null,
  24444. this.id = Math.floor(1e5 * Math.random()),
  24445. this.bindEvents()
  24446. }
  24447. var r = e("./PostMessageType")
  24448. , o = e("events").EventEmitter;
  24449. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24450. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24451. }
  24452. ,
  24453. n.prototype.setTarget = function(e, t) {
  24454. this.targetWindow = e,
  24455. this.targetOrigin = t
  24456. }
  24457. ,
  24458. n.prototype.onPostmessageReceived = function(e) {
  24459. var t = e.origin || e.originalEvent.origin
  24460. , i = e.source;
  24461. switch (e.data.type) {
  24462. case r.CONNECT:
  24463. break;
  24464. case r.RESPONSE:
  24465. if (this.id !== e.data.toId)
  24466. return;
  24467. default:
  24468. if (!this.validateMessageOrigin(t))
  24469. return
  24470. }
  24471. var n = e.data;
  24472. n.source = i,
  24473. n.origin = t,
  24474. n.timestamp = Date.now(),
  24475. this.emit(e.data.type, n)
  24476. }
  24477. ,
  24478. n.prototype.validateMessageOrigin = function(e) {
  24479. return "*" === this.targetOrigin || e === this.targetOrigin
  24480. }
  24481. ,
  24482. n.prototype.send = function(e) {
  24483. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24484. this.targetWindow.postMessage(e, this.targetOrigin))
  24485. }
  24486. ,
  24487. t.exports = n
  24488. }
  24489. , {
  24490. "./PostMessageType": 160,
  24491. events: 202
  24492. }],
  24493. 166: [function(e, t, i) {
  24494. "use strict";
  24495. var n = e("three")
  24496. , r = e("./util/browser")
  24497. , o = e("./enum/Viewmode")
  24498. , a = e("./enum/VROption")
  24499. , s = e("./enum/Colors")
  24500. , l = e("./enum/WarpStyle")
  24501. , c = e("./util/easing")
  24502. , h = e("./util/common")
  24503. , u = e("./util/showcase")
  24504. , d = e("./constants")
  24505. , p = {
  24506. debug: !1,
  24507. version: "2.25.6-0-gd87e5b1",
  24508. languageTag: r.valueFromHash("lang", null),
  24509. pageTitle: "四维虚拟漫游",
  24510. authorizationHeader: u.getAuthorizationHeader(),
  24511. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24512. logLevel: r.valueFromHash("log", 2),
  24513. skyboxRadius: 2500,
  24514. modelBoundsPadding: 5,
  24515. showNeighbors: !1,
  24516. brand: r.valueFromHash("brand", !0),
  24517. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24518. startHighlights: r.valueFromHash("hl", -1),
  24519. specialEdition: r.valueFromHash("bn", 0),
  24520. useWheel: r.valueFromHash("wh", !0),
  24521. crossOrigin: "anonymous",
  24522. fancierTransition: !1,
  24523. wireframe: !1,
  24524. skyboxWireframe: !1,
  24525. modelAlpha: 1,
  24526. highlightPanoSelection: !1,
  24527. showSweeps: !0,
  24528. showSkyboxes: !1,
  24529. showMesh: !0,
  24530. showFloors: !1,
  24531. showFloorDuration: 300,
  24532. showFloorDelay: 300,
  24533. hideFloorDuration: 300,
  24534. hideFloorDelay: 0,
  24535. reticuleOpacityTransitionTime: 250,
  24536. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24537. markerOpacityTransitionTime: 500,
  24538. guiAnimationSpeed: 250,
  24539. highlightAnimationDuration: 500,
  24540. modelComponentLoadSpinnerDelay: 150,
  24541. captureErrors: !1,
  24542. maxMobileTextures: 6,
  24543. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24544. startupFlyinDelay: 3e3,
  24545. dollhouseDefault: {
  24546. minDistance: 1,//15, //编辑页面给近一些
  24547. maxDistance: 50,
  24548. minPolarAngle: n.Math.degToRad(10),
  24549. maxPolarAngle: n.Math.degToRad(90)
  24550. },
  24551. hideReticuleTimeout: 1e3,
  24552. analytics: {
  24553. inactivityThreshold: 30,
  24554. sessionTrackingRate: .15,
  24555. maxTrackedErrors: 20,
  24556. sessionDurationPingFrequency: 10,
  24557. sessionDurationTimeout: 15
  24558. },
  24559. flydown: {
  24560. movementEasing: "easeInOutQuad",
  24561. movementDelay: .001,
  24562. rotationEasing: "easeInOutQuad",
  24563. rotationDelay: .5,
  24564. modelTextureDelay: .75,
  24565. skyboxDelay: .75
  24566. },
  24567. transition: {
  24568. flySpeed: .001,
  24569. flyTime: 750,
  24570. flytimeMaxDistanceThreshold: 5,
  24571. flytimeDistanceMultiplier: 150,
  24572. aimTime: 1500,
  24573. aimSlowFactor: 1.5,
  24574. blur: .8,
  24575. movementEasing: "easeInOutQuad",
  24576. blendEasing: "easeInOutQuad",
  24577. fastForwardFactor: 4
  24578. },
  24579. show360Views: {
  24580. enabled: !0,
  24581. transitionTime: 1e3
  24582. },
  24583. quickstart: {
  24584. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24585. animation: 1400,
  24586. showTextDelay: 500,
  24587. fadeOutDelay: 3e3,
  24588. fovChange: 10
  24589. },
  24590. appConfig: {
  24591. webvr_version: null,
  24592. segment_key: null,
  24593. embedly_key: null,
  24594. branch_key: null,
  24595. keen_write_key: null,
  24596. keen_project_id: null
  24597. },
  24598. vr: {
  24599. enabled: !0,
  24600. allowWebVR: !1,
  24601. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24602. },
  24603. share: {
  24604. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24605. },
  24606. input: {
  24607. longTapThreshold: 200,
  24608. moveToleranceNDC: .08,
  24609. touchMoveThreshold: 25
  24610. },
  24611. help: {
  24612. modalStayDuration: 600
  24613. },
  24614. immersive: {
  24615. timeToShowAgain: 1250,
  24616. uiStayDuration: 600
  24617. },
  24618. tourInteraction: {
  24619. disabled: "0" === r.valueFromHash("tourcta", null),
  24620. showPauseButton: 1e3,
  24621. showModal: 1500,
  24622. allowNextClick: 200,
  24623. largeModal: "1" === r.valueFromHash("tourcta", null),
  24624. smallModal: "2" === r.valueFromHash("tourcta", null)
  24625. },
  24626. labels: {
  24627. enabled: !1,
  24628. hideUntilStart: !0,
  24629. fadeInDuration: 250,
  24630. fadeInDelay: 250,
  24631. fadeOutDuration: 250,
  24632. fadeOutDelay: 0,
  24633. zoomHideThreshhold: {
  24634. mobile: r.isSmallScreen() ? .45 : .6,
  24635. desktop: 2
  24636. },
  24637. zoomTruncateThreshhold: {
  24638. mobile: r.isSmallScreen() ? .35 : .45,
  24639. desktop: .85
  24640. },
  24641. minLengthForTruncate: 16,
  24642. truncateLength: 12,
  24643. truncateSuffix: "..."
  24644. },
  24645. tags: {
  24646. enabled: r.valueFromHash("mt", 1),
  24647. startup: {
  24648. hideUntilStart: !0,
  24649. fadeInDuration: 500,
  24650. fadeInDelay: 100
  24651. },
  24652. visibility: {
  24653. anyDistance: !0,
  24654. visibleDistance: 8,
  24655. cameraClearance: .1,
  24656. alphaTestLevel: .05,
  24657. hideViaFloor: !0,
  24658. hideOffScreenDisc: !1,
  24659. hideOffScreenObject: !1
  24660. },
  24661. disc: {
  24662. opacity: 1,
  24663. disabledOpacity: .5,
  24664. scale: {
  24665. nearBound: 1.5,
  24666. farBound: 4.8,
  24667. linkFarBound: !1,
  24668. linkPercent: 40,
  24669. maxSize: 80,
  24670. minSize: 40,
  24671. baseViewportSize: 800,
  24672. responsiveness: 100
  24673. }
  24674. },
  24675. pole: {
  24676. enabled: !0,
  24677. height: .5,
  24678. width: 2,
  24679. opacity: .5,
  24680. color: "white"
  24681. },
  24682. navigate: {
  24683. nearestPano: !0,
  24684. lineOfSight: !0,
  24685. reactivate: !0,
  24686. aimAt: "disc",
  24687. tiltTolerance: 25,
  24688. rotateSpeedFactor: .6
  24689. }
  24690. },
  24691. path: {
  24692. color: window.DATA.floorMarkerColor || s.newBlue,
  24693. colorUp: s._desat(s.newBlue, .5),
  24694. colorDown: s._darken(s.newBlue, .35),
  24695. opacity: .5,
  24696. style: "ribbon",
  24697. height: .025,
  24698. ribbonWidth: .24,
  24699. outsideHeight: .5,
  24700. waypointRadius: .5,
  24701. waypointIndoorRadius: .24,
  24702. waypointPulse: 1e3,
  24703. typ: l.BLACK,
  24704. meshFree: r.valueFromHash("mf", 1),
  24705. mapGuides: r.valueFromHash("guides", !0),
  24706. fadeInTime: 400,
  24707. fadeOutTime: 300
  24708. },
  24709. warp: {
  24710. nearPanoDist: .1,
  24711. matchCam: !1,
  24712. blur: .33,
  24713. fastTime: 1500,
  24714. teleportTime: 1500,//瞬间过渡的时间
  24715. flytimeDistanceMultiplier:150,//add
  24716. flyTime:750,//add
  24717. outsideTime: 2e3,
  24718. lookAheadMax: .3,
  24719. lookAheadDist: 2.5,
  24720. softPushDist: .37,
  24721. softPushEnd: .3,
  24722. softBendAngle: 8,
  24723. softBendTilt: 4,
  24724. softBendEnd: .3,
  24725. doBurns: !0,
  24726. burnsAngle: 8,
  24727. minBurnsAngle: 35,
  24728. minDownAngle: -35,
  24729. maxTurnPerSec: 280,
  24730. maxAimPerSec: 35,
  24731. minRotation: 12,
  24732. maxAimRotation: 33.2,
  24733. turnFriction: .2,
  24734. flySpeed: .01,
  24735. minWarpTime: 1200,
  24736. warpInterruptionRedirectTime: 500,
  24737. tourStepDelay: r.valueFromHash("st", 0),
  24738. walkDelay: 0,
  24739. walkMaxDist: 50,
  24740. walkMinDist: .8,
  24741. walkSlideShowThreshhold: 3e3,
  24742. walkExtraPanosDistance: .4,
  24743. timePerMeter: 1200,
  24744. motionLeadTime: 5e3,
  24745. movementEasing: "easeInOutQuad",
  24746. blendEasing: "easeInOutQuad",
  24747. showBunny: !1,
  24748. loop: r.valueFromHash("lp", !1),
  24749. auto: r.valueFromHash("ts", -1),
  24750. eOrder: "YXZ",
  24751. stepFactor: .25,
  24752. brakeStrength: 2,
  24753. minBrakeAngle: .1,
  24754. maxBrakeAngle: 1.8,
  24755. climbEffort: 4
  24756. },
  24757. rotationFriction: .05,
  24758. rotationAccelerationInside: 4.5,
  24759. rotationAccelerationOutside: .15,
  24760. rotationAfterMoveMultiplier: 40,
  24761. rotationAfterMoveHistoryCount: 5,
  24762. panFriction: .09,
  24763. panAccelerationOutside: 60,
  24764. onload: r.valueFromHash("onload", o.PANORAMA),
  24765. zoomNearLimit: .1,
  24766. zoomFarLimit: 50,
  24767. navigation: {
  24768. panoScores: !1,
  24769. mouseDirection: !0,
  24770. filterStrictness: .75,
  24771. angleFactor: -30,
  24772. directionFactor: 10,
  24773. distanceFactor: -1,
  24774. optionalityFactor: 3
  24775. },
  24776. sdkInit: !1,
  24777. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24778. console: r.valueFromHash("console", !1),
  24779. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24780. panoramaNeighbourMaxDistance: 5,
  24781. panoFloorClickRadius: .35,
  24782. showScreenshotLocations: !1,
  24783. showAxis: !1,
  24784. showNeighbourRaycasts: !1,
  24785. colorMarkerOnLoad: !1,
  24786. colorMarkerByFloor: !1,
  24787. tiling: {
  24788. panoPreRenderRepeatDelay: 2500,
  24789. panoPreRenderDelay: 500,
  24790. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24791. tilingFlagNames: ["usetiles", "tiles"],
  24792. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24793. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24794. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24795. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24796. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24797. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24798. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24799. customCompression: r.valueFromHash("tilecustcomp", 0),
  24800. mobileHighQualityOverride: 1,
  24801. allowUltraHighResolution: !0
  24802. },
  24803. zoom: {
  24804. enabled: !0,
  24805. forceOff: r.valueFromHash("nozoom", 0),
  24806. overridemax: r.valueFromHash("maxzoom", null),
  24807. overridemin: r.valueFromHash("minzoom", null),
  24808. max: d.highQualityMaxZoom,
  24809. min: 1,
  24810. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24811. activationThreshold: 1.1,
  24812. restoreTime: 500
  24813. },
  24814. profiling: {
  24815. enabled: r.valueFromHash("mem", !1)
  24816. }
  24817. };
  24818. (p = h.deepExtend(p, d, {
  24819. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24820. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24821. panorama: {
  24822. transitionTime: 1e3,
  24823. modelAlpha: 0,
  24824. modelAlphaDelay: p.flydown.modelTextureDelay,
  24825. modelAlphaLength: 1,
  24826. skyboxOpacity: 1,
  24827. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24828. skyboxOpacityLength: .9,
  24829. fovLength: 1,
  24830. fovDelay: 0,
  24831. cameraMatrixDuration: .8,
  24832. cameraMatrixDelay: 0,
  24833. cameraMatrixEase: c.easeInCubic,
  24834. reticuleOpacity: 1,
  24835. markerOpacity: .3,
  24836. markerOpacityOnHover: 1
  24837. },
  24838. dollhouse: {
  24839. transitionTime: 1e3,
  24840. modelAlpha: 1,
  24841. modelAlphaDelay: 0,
  24842. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24843. skyboxOpacity: 0,
  24844. skyboxOpacityDelay: 0,
  24845. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24846. fovLength: 1,
  24847. fovDelay: 0,
  24848. cameraMatrixDuration: .8,
  24849. cameraMatrixDelay: .3,
  24850. cameraMatrixEase: c.easeInCubic,
  24851. reticuleOpacity: 1,
  24852. markerOpacity: 0,
  24853. markerOpacityOnHover: 0
  24854. },
  24855. floorplan: {
  24856. transitionTime: 1e3,
  24857. modelAlpha: 1,
  24858. modelAlphaDelay: 0,
  24859. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24860. skyboxOpacity: 0,
  24861. skyboxOpacityDelay: 0,
  24862. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24863. fovLength: 1,
  24864. fovDelay: 0,
  24865. cameraMatrixDuration: .5,
  24866. cameraMatrixDelay: 0,
  24867. cameraMatrixEase: c.easeOutCubic,
  24868. reticuleOpacity: 1,
  24869. markerOpacity: 0,
  24870. markerOpacityOnHover: 0,
  24871. cameraHeight: 50
  24872. },
  24873. transitioning: {
  24874. reticuleOpacity: 0,
  24875. markerOpacity: .3,
  24876. markerOpacityOnHover: 1
  24877. },
  24878. "floorplan-dollhouse": {
  24879. rotationDelay: 0,
  24880. rotationDuration: 1
  24881. },
  24882. "floorplan-panorama": {
  24883. rotationDelay: .5,
  24884. rotationDuration: 1
  24885. },
  24886. "dollhouse-panorama": {
  24887. rotationDelay: .5,
  24888. rotationDuration: 1
  24889. },
  24890. "dollhouse-floorplan": {
  24891. rotationDelay: 0,
  24892. rotationDuration: 1,
  24893. cameraMatrixDuration: 1.05,
  24894. cameraMatrixDelay: .5
  24895. },
  24896. "panorama-dollhouse": {
  24897. rotationDelay: 0,
  24898. rotationDuration: .5
  24899. },
  24900. "panorama-floorplan": {
  24901. transitionTime: 1500,
  24902. rotationDelay: 0,
  24903. rotationDuration: .5
  24904. }
  24905. })).path.meshFree && (p.path.typ = l.WALK),
  24906. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24907. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24908. window._settings = t.exports = p
  24909. }
  24910. , {
  24911. "./constants": 8,
  24912. "./enum/Colors": 19,
  24913. "./enum/VROption": 47,
  24914. "./enum/Viewmode": 51,
  24915. "./enum/WarpStyle": 52,
  24916. "./util/browser": 182,
  24917. "./util/common": 185,
  24918. "./util/easing": 186,
  24919. "./util/showcase": 193,
  24920. three: 217
  24921. }],
  24922. 167: [function(e, t, i) {
  24923. "use strict";
  24924. var n = e("three")
  24925. , r = e("./settings")
  24926. , 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"
  24927. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24928. t.exports = {
  24929. basicTextured: {
  24930. uniforms: {
  24931. tDiffuse: {
  24932. type: "t",
  24933. value: null
  24934. },
  24935. alpha: {
  24936. type: "f",
  24937. value: 1
  24938. }
  24939. },
  24940. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24941. 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}"
  24942. },
  24943. copyCubeMap: {
  24944. uniforms: {
  24945. tDiffuse: {
  24946. type: "t",
  24947. value: null
  24948. },
  24949. alpha: {
  24950. type: "f",
  24951. value: 1
  24952. }
  24953. },
  24954. 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}",
  24955. 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}"
  24956. },
  24957. cube: {
  24958. uniforms: {
  24959. map: {
  24960. type: "t",
  24961. value: null
  24962. },
  24963. opacity: {
  24964. type: "f",
  24965. value: 1
  24966. }
  24967. },
  24968. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24969. 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"
  24970. },
  24971. model: {
  24972. uniforms: {
  24973. map: {
  24974. type: "t",
  24975. value: null
  24976. },
  24977. modelAlpha: {
  24978. type: "f",
  24979. value: r.modelAlpha
  24980. },
  24981. opacity: {
  24982. type: "f",
  24983. value: 1
  24984. },
  24985. progress: {
  24986. type: "f",
  24987. value: 0
  24988. },
  24989. blackout: {
  24990. type: "i",
  24991. value: 0
  24992. },
  24993. pano0Map: {
  24994. type: "t",
  24995. value: null
  24996. },
  24997. pano0Position: {
  24998. type: "v3",
  24999. value: new n.Vector3
  25000. },
  25001. pano0Matrix: {
  25002. type: "m4",
  25003. value: new n.Matrix4
  25004. },
  25005. pano1Map: {
  25006. type: "t",
  25007. value: null
  25008. },
  25009. pano1Position: {
  25010. type: "v3",
  25011. value: new n.Vector3
  25012. },
  25013. pano1Matrix: {
  25014. type: "m4",
  25015. value: new n.Matrix4
  25016. }
  25017. },
  25018. /* 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",
  25019. 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"
  25020. */
  25021. vertexShader: o + `uniform vec3 pano0Position;
  25022. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  25023. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  25024. varying vec3 vWorldPosition0;
  25025. varying vec3 vWorldPosition1;
  25026. uniform int blackout;
  25027. void main() {
  25028. vUv = uv;
  25029. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  25030. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  25031. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  25032. vWorldPosition0.x *= -1.0;
  25033. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  25034. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  25035. vWorldPosition1.x *= -1.0;
  25036. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  25037. }`,
  25038. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  25039. 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
  25040. void main() {
  25041. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  25042. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  25043. vec4 colorFromPanos;
  25044. if (blackout == 5){//add for TransitionPass
  25045. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  25046. }else{
  25047. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  25048. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  25049. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  25050. else if (blackout == 1) {
  25051. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  25052. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  25053. }
  25054. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  25055. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  25056. }
  25057. vec4 colorFromTexture = texture2D( map, vUv );
  25058. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  25059. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  25060. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  25061. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  25062. }`
  25063. },
  25064. hot: {
  25065. uniforms: {
  25066. color: {
  25067. type: "c",
  25068. value: new n.Color(16720384)
  25069. },
  25070. opac: {
  25071. type: "f",
  25072. value: 0
  25073. },
  25074. texture1: {
  25075. type: "t",
  25076. value: null
  25077. },
  25078. texture2: {
  25079. type: "t",
  25080. value: null
  25081. }
  25082. },
  25083. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25084. 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"
  25085. },
  25086. modelOutside: {
  25087. uniforms: {
  25088. map: {
  25089. type: "t",
  25090. value: null
  25091. },
  25092. opacity: {
  25093. type: "f",
  25094. value: 1
  25095. }
  25096. },
  25097. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25098. 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"
  25099. },
  25100. ribbon: {
  25101. uniforms: {
  25102. map: {
  25103. type: "t",
  25104. value: null
  25105. },
  25106. opacity: {
  25107. type: "f",
  25108. value: 1
  25109. },
  25110. color: {
  25111. type: "c",
  25112. value: new n.Color(r.path.color)
  25113. }
  25114. },
  25115. 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",
  25116. 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"
  25117. },
  25118. waypoint: {
  25119. uniforms: {
  25120. map: {
  25121. type: "t",
  25122. value: null
  25123. },
  25124. opacity: {
  25125. type: "f",
  25126. value: 1
  25127. },
  25128. pulse: {
  25129. type: "f",
  25130. value: 1
  25131. },
  25132. nearFade: {
  25133. type: "v2",
  25134. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25135. },
  25136. color: {
  25137. type: "c",
  25138. value: new n.Color(r.reticuleColor)
  25139. }
  25140. },
  25141. 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",
  25142. 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"
  25143. },
  25144. modelDebug: {
  25145. uniforms: {
  25146. map: {
  25147. type: "t",
  25148. value: null
  25149. },
  25150. modelAlpha: {
  25151. type: "f",
  25152. value: r.modelAlpha
  25153. },
  25154. depthmapRatio: {
  25155. type: "f",
  25156. value: 0
  25157. },
  25158. opacity: {
  25159. type: "f",
  25160. value: 1
  25161. },
  25162. progress: {
  25163. type: "f",
  25164. value: 0
  25165. },
  25166. considerOcclusion: {
  25167. type: "i",
  25168. value: r.fancierTransition
  25169. },
  25170. highlightPanoSelection: {
  25171. type: "i",
  25172. value: 0
  25173. },
  25174. useThirdPano: {
  25175. type: "i",
  25176. value: r.useThirdPano
  25177. },
  25178. pano0Map: {
  25179. type: "t",
  25180. value: null
  25181. },
  25182. pano0Depth: {
  25183. type: "t",
  25184. value: null
  25185. },
  25186. pano0Position: {
  25187. type: "v3",
  25188. value: new n.Vector3
  25189. },
  25190. pano0Matrix: {
  25191. type: "m4",
  25192. value: new n.Matrix4
  25193. },
  25194. pano0Weight: {
  25195. type: "f",
  25196. value: r.transition.pano0Weight
  25197. },
  25198. pano1Map: {
  25199. type: "t",
  25200. value: null
  25201. },
  25202. pano1Depth: {
  25203. type: "t",
  25204. value: null
  25205. },
  25206. pano1Position: {
  25207. type: "v3",
  25208. value: new n.Vector3
  25209. },
  25210. pano1Matrix: {
  25211. type: "m4",
  25212. value: new n.Matrix4
  25213. },
  25214. pano1Weight: {
  25215. type: "f",
  25216. value: r.transition.pano1Weight
  25217. },
  25218. pano2Map: {
  25219. type: "t",
  25220. value: null
  25221. },
  25222. pano2Depth: {
  25223. type: "t",
  25224. value: null
  25225. },
  25226. pano2Position: {
  25227. type: "v3",
  25228. value: new n.Vector3
  25229. },
  25230. pano2Matrix: {
  25231. type: "m4",
  25232. value: new n.Matrix4
  25233. },
  25234. pano2Weight: {
  25235. type: "f",
  25236. value: r.transition.pano2Weight
  25237. }
  25238. },
  25239. 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",
  25240. 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"
  25241. },
  25242. customDepth: {
  25243. uniforms: {
  25244. panoPosition: {
  25245. type: "v3",
  25246. value: new n.Vector3
  25247. }
  25248. },
  25249. 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",
  25250. 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"
  25251. },
  25252. skysphere: {
  25253. uniforms: {
  25254. radius: {
  25255. type: "f",
  25256. value: 0
  25257. }
  25258. },
  25259. 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",
  25260. 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"
  25261. },
  25262. tagDisc: {
  25263. uniforms: {
  25264. opacity: {
  25265. type: "f",
  25266. value: 0
  25267. },
  25268. color: {
  25269. type: "c",
  25270. value: new n.Color
  25271. },
  25272. bg: {
  25273. type: "t",
  25274. value: null
  25275. },
  25276. mask: {
  25277. type: "t",
  25278. value: null
  25279. }
  25280. },
  25281. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25282. 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"
  25283. }
  25284. }
  25285. window.shaders = t.exports;
  25286. }
  25287. , {
  25288. "./settings": 166,
  25289. three: 217
  25290. }],
  25291. 168: [function(E, _, e) {
  25292. (function(e) {
  25293. "use strict";
  25294. var t = E("three")
  25295. , i = (E("url"),
  25296. E("./util/ajax"))
  25297. , n = E("./settings")
  25298. , r = E("./util/logger")
  25299. , o = E("./util/math")
  25300. , a = E("./util/showcase")
  25301. , s = E("./objects/Panorama")
  25302. , l = new r(e)
  25303. , c = E("./model/Model")
  25304. , h = E("./shaders")
  25305. , u = E("./util/transitions")
  25306. , d = E("./objects/Chunk")
  25307. , p = E("./objects/Reticule")
  25308. , f = E("./objects/Skybox")
  25309. , g = E("./objects/Floor")
  25310. , m = E("./cameras/DollhouseCamera")
  25311. , v = E("./cameras/FloorplanCamera")
  25312. , y = E("./cameras/PanoramaCamera")
  25313. , A = E("./controls/DollhouseControls")
  25314. , C = E("./controls/FloorplanControls")
  25315. , I = E("./controls/PanoramaControls");
  25316. t.ImageUtils.crossOrigin = n.crossOrigin,
  25317. _.exports = {
  25318. shaders: h,
  25319. transitions: u,
  25320. Model: c,
  25321. Chunk: d,
  25322. Floor: g,
  25323. Skybox: f,
  25324. Reticule: p,
  25325. Panorama: s,
  25326. DollhouseCamera: m,
  25327. FloorplanCamera: v,
  25328. PanoramaCamera: y,
  25329. DollhouseControls: A,
  25330. FloorplanControls: C,
  25331. PanoramaControls: I,
  25332. getModel: function(e) {
  25333. if (!e.url)
  25334. throw 'getModel(): missing parameter "url"';
  25335. e.autoload = void 0 === e.autoload || e.autoload;
  25336. var t = a.parseSidUrl(e.url);
  25337. e.urlBase = t.urlBase,
  25338. e.urlModel = t.urlModel,
  25339. e.urlFiles = t.urlFiles;
  25340. var i = this._getPlatformError();
  25341. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25342. this._loadModel().then(this._buildModel.bind(this)))
  25343. },
  25344. _getPlatformError: function() {
  25345. 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"
  25346. },
  25347. _loadModel: function() {
  25348. return i.get(this.options.urlModel, {
  25349. responseType: "json",
  25350. prefetchFrom: "model",
  25351. auth: a.getAuthorizationHeader()
  25352. }).then(null, function() {
  25353. return l.warn("Model loading failed at initial metadata load"),
  25354. "loading-failed"
  25355. })
  25356. },
  25357. _buildModel: function(e) {
  25358. e = a.normalizeModeldata(e, o);
  25359. var t = new c(this.options,e);
  25360. return this.options.autoload ? t.load(!0) : $.when(t)
  25361. }
  25362. }
  25363. }
  25364. ).call(this, "/js/showcase.js")
  25365. }
  25366. , {
  25367. "./cameras/DollhouseCamera": 5,
  25368. "./cameras/FloorplanCamera": 6,
  25369. "./cameras/PanoramaCamera": 7,
  25370. "./controls/DollhouseControls": 10,
  25371. "./controls/FloorplanControls": 11,
  25372. "./controls/PanoramaControls": 13,
  25373. "./model/Model": 139,
  25374. "./objects/Chunk": 144,
  25375. "./objects/Floor": 146,
  25376. "./objects/Panorama": 148,
  25377. "./objects/Reticule": 149,
  25378. "./objects/Skybox": 152,
  25379. "./settings": 166,
  25380. "./shaders": 167,
  25381. "./util/ajax": 181,
  25382. "./util/logger": 189,
  25383. "./util/math": 190,
  25384. "./util/showcase": 193,
  25385. "./util/transitions": 195,
  25386. three: 217,
  25387. url: 208
  25388. }],
  25389. 169: [function(e, t, i) {
  25390. "use strict";
  25391. function l(e) {
  25392. var t = {
  25393. renderTarget: null,
  25394. inUse: !1,
  25395. size: -1,
  25396. pano: null
  25397. };
  25398. return t.inUse = !0,
  25399. t.size = e,
  25400. function(e) {
  25401. O.push(e)
  25402. }(t),
  25403. t
  25404. }
  25405. function c(e) {
  25406. for (var t = 0; t < O.length; t++) {
  25407. var i = O[t];
  25408. if (i.renderTarget === e)
  25409. return !(i.inUse = !1)
  25410. }
  25411. return !1
  25412. }
  25413. function n() {
  25414. this.tileDirectory = {},
  25415. this.activeRenderTargetDescriptors = {},
  25416. this.activePanos = [],
  25417. this.panoLODDescriptors = {},
  25418. this.panoDescriptors = {},
  25419. this.tileTrees = {},
  25420. this.sceneRenderer = null,
  25421. this.tileDownloader = null,
  25422. this.forceQueue = [],
  25423. this.uploadQueues = {},
  25424. this.uploadInterval = null,
  25425. this.uploadIntervalCancelled = !1,
  25426. this.usingTileOverlay = !1,
  25427. this.overlayTilesLoaded = !1,
  25428. this.overlayTileBase = null,
  25429. this.overlayTilesBasic = {},
  25430. this.overlayTilesEnhanced = {},
  25431. this.zoomRenderTarget = null,
  25432. this.zoomPano = null,
  25433. this.zoomingActive = !1,
  25434. this.zoomPanoId = null,
  25435. this.zoomPanoRenderingDisabled = !1,
  25436. this.direction = new _.Vector3,
  25437. this.initTime = -1,
  25438. this.maxBaseUploadsPerFrame = R,
  25439. this.maxNonBaseUploadsPerFrame = M
  25440. }
  25441. 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"),
  25442. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25443. e("../objects/Panorama"),
  25444. e("./TileTree")), y = (e("./TileDownloader"),
  25445. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25446. e("../util/browser"),
  25447. 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 = {
  25448. Base: 0,
  25449. Remaining: 1
  25450. }, O = [];
  25451. function L(e) {
  25452. var t = e.shift();
  25453. return t.uploadQueued = !1,
  25454. t
  25455. }
  25456. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25457. this.sceneRenderer = e,
  25458. this.tileDownloader = t,
  25459. this.qualityManager = i,
  25460. this.bindEvents(),
  25461. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25462. this.initTime = performance.now()
  25463. }
  25464. ,
  25465. n.prototype.getActivePanoTextures = function(e) {
  25466. e = e || [];
  25467. for (var t = 0; t < O.length; t++) {
  25468. var i = O[t];
  25469. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25470. }
  25471. }
  25472. ,
  25473. n.prototype.hasQueuedTiles = function() {
  25474. var e = this.peekNextFromUploadQueue();
  25475. return null != e
  25476. }
  25477. ,
  25478. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25479. return this.activeRenderTargetDescriptors[e]
  25480. }
  25481. ,
  25482. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25483. this.activeRenderTargetDescriptors[e] = t
  25484. }
  25485. ,
  25486. n.prototype.loadOverlayTiles = function() {
  25487. if (0 !== d.tiling.overlayStyle) {
  25488. var n = 0
  25489. , e = function(e, t, i) {
  25490. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25491. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25492. ++n === r.length && (this.overlayTilesLoaded = !0)
  25493. }
  25494. .bind(this)
  25495. , 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)]];
  25496. r.forEach(function(e) {
  25497. this.tileDownloader.loadImage(e[0], 0, e[1])
  25498. }
  25499. .bind(this)),
  25500. this.usingTileOverlay = !0
  25501. } else
  25502. this.usingTileOverlay = !1
  25503. }
  25504. ,
  25505. n.prototype.bindEvents = function() {
  25506. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25507. }
  25508. ,
  25509. n.prototype.setupZoomRenderTarget = function() {
  25510. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25511. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25512. return;
  25513. var e = this.zoomRenderTarget;
  25514. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25515. e) {
  25516. var t = e.width
  25517. , i = this.zoomRenderTarget.width;
  25518. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25519. e.texture.dispose(),
  25520. e.texture.loaded = !1,
  25521. e.texture.version = 0,
  25522. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25523. e.texture = null
  25524. }
  25525. this.zoomPanoRenderingDisabled = !1
  25526. } else
  25527. this.zoomPanoRenderingDisabled = !0
  25528. }
  25529. ,
  25530. n.prototype.enableUltraHighQualityMode = function(t) {
  25531. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25532. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25533. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25534. e && (this.qualityManager.enableUltraHighQualityMode(),
  25535. this.setupZoomRenderTarget(),
  25536. t())
  25537. }
  25538. .bind(this))
  25539. }
  25540. }
  25541. ,
  25542. n.prototype.activateTiledPano = function(e, t, i) {
  25543. i && this.clearAllQueuedUploads();
  25544. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25545. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25546. this.linkAllTilesAndNodes(e);
  25547. var r = this.getActiveRenderTargetDescriptor(e.id)
  25548. , o = t;
  25549. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25550. !r || o !== r.size) {
  25551. if (r && c(r.renderTarget),
  25552. !(r = function(e) {
  25553. for (var t = 0; t < O.length; t++) {
  25554. var i = O[t];
  25555. if (!i.inUse && i.size === e)
  25556. return i.inUse = !0,
  25557. i
  25558. }
  25559. return null
  25560. }(o))) {
  25561. var a = this.initTiledPano(o, !1);
  25562. (r = l(a.width)).renderTarget = a
  25563. }
  25564. r.pano = e,
  25565. this.resetPanoDescriptor(e.id),
  25566. this.resetPanoLODDescriptors(e.id),
  25567. this.resetRenderStatus(e.id, !0, !0)
  25568. }
  25569. this.setActiveRenderTargetDescriptor(e.id, r);
  25570. var s = i ? 0 : 1;
  25571. return this.updateActivePanos(e, s),
  25572. r.renderTarget
  25573. }
  25574. ,
  25575. n.prototype.deactivateTiledPano = function(e) {
  25576. var t = this.getActiveRenderTargetDescriptor(e.id);
  25577. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25578. this.setActiveRenderTargetDescriptor(e.id, null);
  25579. var i = this.getUploadQueueForPano(e.id);
  25580. this.clearUploadQueue(i),
  25581. this.updateActivePanos()
  25582. }
  25583. ,
  25584. n.prototype.updateActivePanos = (s = [],
  25585. function(e, t) {
  25586. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25587. e && s.length === t && s.push(e);
  25588. var n = this.activePanos[i]
  25589. , r = this.getActiveRenderTargetDescriptor(n.id);
  25590. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25591. }
  25592. e && t >= s.length && s.push(e),
  25593. this.activePanos.length = 0,
  25594. this.activePanos.push.apply(this.activePanos, s)
  25595. }
  25596. ),
  25597. n.prototype.getActivePanoCount = function() {
  25598. return this.activePanos.length
  25599. }
  25600. ,
  25601. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25602. var i = null;
  25603. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25604. for (var n = function(e, t, i, n) {
  25605. o && (t.tile.zoomUploaded = !1),
  25606. r && (t.tile.uploaded = !1)
  25607. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25608. this.getTileTree(e, a).breadthFirst({
  25609. callback: n.bind(this, a),
  25610. minLevel: i
  25611. })
  25612. }
  25613. }
  25614. ,
  25615. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25616. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25617. t.tile.zoomUploaded = t.tile.uploaded,
  25618. t.zoomCovered = t.covered
  25619. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25620. this.getTileTree(e, n).breadthFirst({
  25621. callback: i.bind(this, n),
  25622. maxLevel: t
  25623. })
  25624. }
  25625. }
  25626. ,
  25627. n.prototype.renderPanoTiles = (h = [],
  25628. function(e, t, i, n) {
  25629. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25630. t = t || this.direction || m.FORWARD;
  25631. var r = this.getActiveRenderTargetDescriptor(e);
  25632. if (!this.isRenderTargetDescriptorValid(r))
  25633. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25634. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25635. var a = this.getTileTree(e, o);
  25636. h.length = 0,
  25637. a.breadthFirst({
  25638. saveVisited: h
  25639. });
  25640. for (var s = 0; s < h.length; s++) {
  25641. var l = h[s];
  25642. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25643. }
  25644. }
  25645. this.updateDirection(t)
  25646. }
  25647. ),
  25648. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25649. return e && e.renderTarget
  25650. }
  25651. ,
  25652. n.prototype.isPanoActive = function(e) {
  25653. var t = this.getActiveRenderTargetDescriptor(e);
  25654. return this.isRenderTargetDescriptorValid(t)
  25655. }
  25656. ,
  25657. n.prototype.isPanoZoomed = function(e) {
  25658. return this.zoomingActive && this.zoomPanoId === e
  25659. }
  25660. ,
  25661. n.prototype.initTileTree = function(e, t, i) {
  25662. var n = this.tileTrees[e];
  25663. n || (n = [],
  25664. this.tileTrees[e] = n);
  25665. var r = n[t];
  25666. if (!r) {
  25667. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25668. r = new v(A.TILE_SIZE,o),
  25669. n[t] = r
  25670. }
  25671. }
  25672. ,
  25673. n.prototype.getTileTree = function(e, t) {
  25674. var i = this.tileTrees[e];
  25675. if (!i)
  25676. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25677. var n = i[t];
  25678. if (!n)
  25679. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25680. return n
  25681. }
  25682. ,
  25683. n.prototype.initTiledPano = function(e, t) {
  25684. var i = this.sceneRenderer.renderer
  25685. , n = (i.context,
  25686. new _.WebGLRenderTargetCube(e,e,{
  25687. stencilBuffer: !1
  25688. }))
  25689. , r = new _.CubeTexture([]);
  25690. (n.texture = r).image = [null, null, null, null, null, null],
  25691. r.flipY = !0,
  25692. t ? (r.generateMipmaps = !0,
  25693. r.magFilter = _.LinearFilter,
  25694. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25695. r.magFilter = _.LinearFilter,
  25696. r.minFilter = _.LinearFilter),
  25697. r.format = _.RGBAFormat,
  25698. i.setRenderTarget(n),
  25699. i.setRenderTarget(null);
  25700. var o = i.properties.get(r);
  25701. return o.__image__webglTextureCube = o.__webglTexture,
  25702. n
  25703. }
  25704. ,
  25705. n.prototype.getUploadQueueForPano = function(e) {
  25706. var t = this.uploadQueues[e];
  25707. return t || (t = [],
  25708. this.uploadQueues[e] = t),
  25709. t
  25710. }
  25711. ,
  25712. n.prototype.isTileUploaded = function(e) {
  25713. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25714. }
  25715. ,
  25716. n.prototype.setUploaded = function(e, t) {
  25717. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25718. }
  25719. ,
  25720. n.prototype.queueTileUpload = function(e, t, i) {
  25721. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25722. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25723. var r = this.getUploadQueueForPano(e.panoId);
  25724. 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),
  25725. e.uploadQueued = !0,
  25726. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25727. }
  25728. }
  25729. ,
  25730. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25731. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25732. }
  25733. ,
  25734. n.prototype.getTopUploadQueue = function() {
  25735. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25736. for (var n = 0; n < this.activePanos.length; n++)
  25737. if (e = this.activePanos[n],
  25738. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25739. switch (i) {
  25740. case P.Base:
  25741. if (0 === t[0].level)
  25742. return t;
  25743. break;
  25744. case P.Remaining:
  25745. return t
  25746. }
  25747. return null
  25748. }
  25749. ,
  25750. n.prototype.getNextFromUploadQueue = function() {
  25751. if (0 < this.forceQueue.length)
  25752. return L(this.forceQueue);
  25753. var e = this.getTopUploadQueue();
  25754. return e && 0 < e.length ? L(e) : null
  25755. }
  25756. ,
  25757. n.prototype.peekNextFromUploadQueue = function() {
  25758. if (0 < this.forceQueue.length)
  25759. return this.forceQueue[0];
  25760. var e = this.getTopUploadQueue();
  25761. return e && 0 < e.length ? e[0] : null
  25762. }
  25763. ,
  25764. n.prototype.clearAllQueuedUploads = function() {
  25765. this.clearAllUploadQueues(null, 0)
  25766. }
  25767. ,
  25768. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25769. this.clearAllUploadQueues(e, 0)
  25770. }
  25771. ,
  25772. n.prototype.clearAllUploadQueues = function(e, t) {
  25773. if (e)
  25774. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25775. this.clearUploadQueue(this.forceQueue, t, e);
  25776. else {
  25777. for (var i = 0; i < this.activePanos.length; i++) {
  25778. var n = this.activePanos[i];
  25779. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25780. }
  25781. this.clearUploadQueue(this.forceQueue, t)
  25782. }
  25783. }
  25784. ,
  25785. n.prototype.clearUploadQueue = function(e, t, i) {
  25786. null != t || (t = 0);
  25787. for (var n = 0; n < e.length; ) {
  25788. var r = e[n];
  25789. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25790. e.splice(n, 1)) : n++
  25791. }
  25792. }
  25793. ,
  25794. n.prototype.refreshUploadInterval = (a = null,
  25795. function(e) {
  25796. this.uploadIntervalCancelled || (a = a || function() {
  25797. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25798. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25799. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25800. }
  25801. .bind(this),
  25802. null != e || (e = x),
  25803. T || (e = S),
  25804. this.uploadInterval = window.setTimeout(a, e),
  25805. this.uploadIntervalDelay = e)
  25806. }
  25807. ),
  25808. n.prototype.update = (r = performance.now(),
  25809. o = 0,
  25810. function() {
  25811. this.uploadIntervalCancelled = !0,
  25812. window.clearTimeout(this.uploadInterval),
  25813. this.uploadInterval = null;
  25814. var e = performance.now() - r;
  25815. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25816. r = performance.now()),
  25817. o++
  25818. }
  25819. ),
  25820. n.prototype.updateUploadQueue = function(e, t) {
  25821. e = e || 1;
  25822. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25823. var r = this.getNextFromUploadQueue();
  25824. if (!r)
  25825. break;
  25826. if (0 !== r.level ? i++ : n++,
  25827. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25828. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25829. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25830. }
  25831. }
  25832. }
  25833. ,
  25834. n.prototype.updateDirection = function(e) {
  25835. if (e = e || this.direction) {
  25836. this.direction = e;
  25837. for (var t = 0; t < this.activePanos.length; t++) {
  25838. var i = this.activePanos[t]
  25839. , n = this.getUploadQueueForPano(i.id);
  25840. y.sortPanoTiles(n, i, this.direction)
  25841. }
  25842. }
  25843. }
  25844. ,
  25845. n.prototype.uploadTile = (I = {},
  25846. new _.Vector4,
  25847. E = d.tiling.overlayStyle,
  25848. function(e, t) {
  25849. var i = e.panoId
  25850. , n = e.image
  25851. , r = e.tileSize
  25852. , o = e.panoSize
  25853. , a = e.tileIndex
  25854. , s = (e.faceTileIndex,
  25855. e.totalTiles)
  25856. , l = (e.face,
  25857. e.tileX)
  25858. , c = e.tileY
  25859. , h = !0
  25860. , u = !1
  25861. , d = (this.getPanoDescriptor(i),
  25862. this.getPanoLODDescriptor(i, o))
  25863. , p = this.getActiveRenderTargetDescriptor(i)
  25864. , f = p.renderTarget
  25865. , g = p.size;
  25866. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25867. g = this.qualityManager.getMaxZoomPanoSize()),
  25868. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25869. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25870. this.isTileUploaded(e) && (u = h = !1)),
  25871. h) {
  25872. var m = r / o * g
  25873. , v = l * r / o * g
  25874. , y = c * r / o * g;
  25875. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25876. var A = I[r];
  25877. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25878. 1 === E || 2 === E) {
  25879. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25880. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25881. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25882. } else
  25883. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25884. d.uploadCount++,
  25885. this.emit(b.TileRenderSuccess, i, o, a, s),
  25886. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25887. this.setUploaded(e, !0),
  25888. this.addCoverageForNode(e.node)
  25889. } else
  25890. this.setUploaded(e, !1);
  25891. return e.uploadAttempted || (d.uploadAttempts++,
  25892. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25893. e.uploadAttempted = !0,
  25894. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25895. u
  25896. }
  25897. ),
  25898. n.prototype.linkTileAndNode = function(e, t) {
  25899. (t.tile = e).node = t
  25900. }
  25901. ,
  25902. n.prototype.linkAllTilesAndNodes = function(a) {
  25903. for (var e = function(e, t, i, n, r) {
  25904. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25905. this.linkTileAndNode(o, i)
  25906. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25907. var i = this.getTileTree(a.id, t);
  25908. i.breadthFirst({
  25909. callback: e.bind(this, i, t)
  25910. })
  25911. }
  25912. }
  25913. ,
  25914. n.prototype.anyUploaded = function(e) {
  25915. if (!e)
  25916. return !1;
  25917. if (e.tile && this.isTileUploaded(e.tile))
  25918. return !0;
  25919. if (e.children)
  25920. for (var t = 0; t < e.children.length; t++) {
  25921. var i = e.children[t];
  25922. if (this.anyUploaded(i))
  25923. return !0
  25924. }
  25925. return !1
  25926. }
  25927. ,
  25928. n.prototype.setNodeCovered = function(e, t) {
  25929. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25930. }
  25931. ,
  25932. n.prototype.isNodeCovered = function(e) {
  25933. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25934. }
  25935. ,
  25936. n.prototype.addCoverageForNode = function(e) {
  25937. if (this.setNodeCovered(e, !0),
  25938. e.parent && e.covered) {
  25939. var t = e.parent;
  25940. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25941. }
  25942. }
  25943. ,
  25944. n.prototype.calcFullCoverage = function(e) {
  25945. var t = !1;
  25946. if (e.children)
  25947. for (var i = 0; i < e.children.length; i++) {
  25948. var n = e.children[i];
  25949. t = t || this.calcFullCoverage(n)
  25950. }
  25951. e.covered = e.tile.uploaded || t
  25952. }
  25953. ,
  25954. n.prototype.nodeSubcovered = function(e) {
  25955. if (!e.children)
  25956. return !1;
  25957. for (var t = 0; t < e.children.length; t++)
  25958. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25959. return !1;
  25960. return !0
  25961. }
  25962. ,
  25963. n.prototype.resetPanoDescriptor = function(e) {
  25964. this.getPanoDescriptor(e)
  25965. }
  25966. ,
  25967. n.prototype.getPanoDescriptor = function(e) {
  25968. var t = this.panoDescriptors[e];
  25969. return t || (t = {},
  25970. this.panoDescriptors[e] = t),
  25971. t
  25972. }
  25973. ,
  25974. n.prototype.resetPanoLODDescriptors = function(e) {
  25975. var t = this.getPanoLODDescriptors(e);
  25976. for (var i in t)
  25977. if (t.hasOwnProperty(i)) {
  25978. var n = t[i];
  25979. n.uploadCount = 0,
  25980. n.uploadAttempts = 0
  25981. }
  25982. }
  25983. ,
  25984. n.prototype.getPanoLODDescriptor = function(e, t) {
  25985. var i = this.getPanoLODDescriptors(e)
  25986. , n = i[t];
  25987. return n || (n = {
  25988. uploadCount: 0,
  25989. uploadAttempts: 0
  25990. },
  25991. i[t] = n),
  25992. n
  25993. }
  25994. ,
  25995. n.prototype.getPanoLODDescriptors = function(e) {
  25996. var t = this.panoLODDescriptors[e];
  25997. return t || (t = {},
  25998. this.panoLODDescriptors[e] = t),
  25999. t
  26000. }
  26001. ,
  26002. n.prototype.onTileDownloaded = function(e) {
  26003. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26004. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26005. if (i.downloaded = !0,
  26006. i.image = e.image,
  26007. i.panoSize = e.panoSize,
  26008. i.tileX = e.tileX,
  26009. i.tileY = e.tileY,
  26010. i.totalTiles = e.totalTiles,
  26011. i.tileIndex = e.tileIndex,
  26012. i.faceTileIndex = e.faceTileIndex,
  26013. i.face = e.face,
  26014. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26015. i.panoId = e.panoId,
  26016. i.tileSize = e.tileSize,
  26017. i.direction = (new _.Vector3).copy(e.direction),
  26018. i.node = null,
  26019. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26020. this.isPanoActive(i.panoId)) {
  26021. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26022. this.linkTileAndNode(i, n),
  26023. this.queueTileUpload(i, !0)
  26024. }
  26025. }
  26026. ,
  26027. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26028. var r = this.tileDirectory[e];
  26029. r || (r = {},
  26030. this.tileDirectory[e] = r);
  26031. var o = 16384 * t + 1024 * i + n
  26032. , a = r[o];
  26033. return a || (a = {
  26034. downloaded: !1,
  26035. uploaded: !1,
  26036. zoomUploaded: !1
  26037. },
  26038. r[o] = a),
  26039. a._key = e + ":" + t + ":" + i + ":" + n,
  26040. a._tileKey = o,
  26041. a
  26042. }
  26043. ,
  26044. n.prototype.setZoomingActive = function(e, t, i) {
  26045. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26046. this.zoomPanoId = t.id,
  26047. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26048. }
  26049. ,
  26050. n.prototype.updateZoomedPanoFromBase = function(e) {
  26051. if (!this.zoomPanoRenderingDisabled) {
  26052. var t = this.getActiveRenderTargetDescriptor(e.id);
  26053. if (t && t.renderTarget) {
  26054. var i = this.qualityManager.getMaxZoomPanoSize()
  26055. , n = t.renderTarget
  26056. , r = t.size;
  26057. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26058. this.copyBaseRenderStatusToZoomed(e.id)
  26059. }
  26060. }
  26061. }
  26062. ,
  26063. t.exports = n
  26064. }
  26065. , {
  26066. "../enum/GLCubeFaces": 25,
  26067. "../enum/PanoRendererEvents": 35,
  26068. "../enum/PanoSizeClass": 36,
  26069. "../enum/SceneRendererEvents": 43,
  26070. "../enum/TileDownloaderEvents": 45,
  26071. "../enum/Vectors": 50,
  26072. "../exception/BasicException": 55,
  26073. "../objects/Panorama": 148,
  26074. "../settings": 166,
  26075. "../util/browser": 182,
  26076. "../util/panorama": 191,
  26077. "./TileDownloader": 171,
  26078. "./TilePrioritizer": 172,
  26079. "./TileTree": 173,
  26080. "./TileUtils": 174,
  26081. events: 202,
  26082. three: 217
  26083. }],
  26084. 170: [function(e, t, i) {
  26085. "use strict";
  26086. function n(e, t, i) {
  26087. this.maxNavPanoSize = -1,
  26088. this.maxZoomPanoSize = -1,
  26089. this.devicePixelDensity = e,
  26090. this.deviceScreenSize = t,
  26091. this.clientBandwidth = i,
  26092. this.panoSizeClassMap = {},
  26093. this.useHighResolutionPanos = !0,
  26094. this.useUltraHighResolutionPanos = !1,
  26095. this.modelHasUltraHighPanos = !1
  26096. }
  26097. var r = e("../enum/PanoSizeClass")
  26098. , o = e("../settings")
  26099. , a = e("../util/browser")
  26100. , s = e("../constants")
  26101. , l = e("../util/showcase")
  26102. , c = e("../enum/ModelManagerEvents");
  26103. n.prototype.init = function(e) {
  26104. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26105. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26106. this.highSize = this.getPanoSize(r.HIGH),
  26107. this.standardSize = this.getPanoSize(r.STANDARD),
  26108. this.baseSize = this.getPanoSize(r.BASE),
  26109. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26110. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26111. this.updateMaximums(),
  26112. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26113. }
  26114. ,
  26115. n.prototype.updateFromModel = function(e) {
  26116. this.updateHighResolutionSettings(e),
  26117. this.updateUltraHighResolutionSettings(e)
  26118. }
  26119. ,
  26120. n.prototype.updateHighResolutionSettings = function(e) {
  26121. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26122. this.updateMaximums()
  26123. }
  26124. ,
  26125. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26126. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26127. this.updateMaximums()
  26128. }
  26129. ,
  26130. n.prototype.enableUltraHighQualityMode = function() {
  26131. this.modelHasUltraHighPanos = !0,
  26132. this.updateUltraHighResolutionSettings(null)
  26133. }
  26134. ,
  26135. n.prototype.ultraHighQualityModeEnabled = function() {
  26136. return this.modelHasUltraHighPanos
  26137. }
  26138. ,
  26139. n.prototype.onModelChanged = function(e) {
  26140. this.updateFromModel(e.model),
  26141. this.updateMaximums()
  26142. }
  26143. ,
  26144. n.prototype.updateMaximums = function() {
  26145. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26146. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26147. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26148. }
  26149. ,
  26150. n.prototype.buildPanoSizeClassMap = function() {
  26151. this.panoSizeClassMap[r.BASE] = 512,
  26152. this.panoSizeClassMap[r.STANDARD] = 1024,
  26153. this.panoSizeClassMap[r.HIGH] = 2048,
  26154. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26155. }
  26156. ,
  26157. n.prototype.getPanoSize = function(e) {
  26158. return this.panoSizeClassMap[e]
  26159. }
  26160. ,
  26161. n.prototype.getMaxPossiblePanoSize = function() {
  26162. return this.getPanoSize(r.ULTRAHIGH)
  26163. }
  26164. ,
  26165. n.prototype.getMaxPanoSize = function() {
  26166. return this.maxZoomPanoSize
  26167. }
  26168. ,
  26169. n.prototype.getMaxNavPanoSize = function() {
  26170. return this.maxNavPanoSize
  26171. }
  26172. ,
  26173. n.prototype.getMaxZoomPanoSize = function() {
  26174. return this.maxZoomPanoSize
  26175. }
  26176. ,
  26177. n.prototype.detectMaxNavPanoSizeClass = function() {
  26178. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26179. }
  26180. ,
  26181. n.prototype.detectMaxNavPanoSize = function() {
  26182. var e = this.detectMaxNavPanoSizeClass();
  26183. return this.getPanoSize(e)
  26184. }
  26185. ,
  26186. n.prototype.detectMaxZoomPanoSize = function() {
  26187. 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)
  26188. }
  26189. ,
  26190. t.exports = n
  26191. }
  26192. , {
  26193. "../constants": 8,
  26194. "../enum/ModelManagerEvents": 33,
  26195. "../enum/PanoSizeClass": 36,
  26196. "../settings": 166,
  26197. "../util/browser": 182,
  26198. "../util/showcase": 193
  26199. }],
  26200. 171: [function(A, C, e) {
  26201. (function(e) {
  26202. "use strict";
  26203. function i(e) {
  26204. this.panos = null,
  26205. this.retryMinimumTime = 1e4,
  26206. this.urls = null,
  26207. this.panoLoadCallbacks = {},
  26208. this.downloadDescriptors = {},
  26209. this.priorityQueue = [],
  26210. this.forceQueue = [],
  26211. this.activeDownloads = [],
  26212. this.qualityManager = null,
  26213. this.tilePrioritizer = null,
  26214. this.refreshInterval = null,
  26215. this.processPriorityQueue = !1,
  26216. this.concurrentDownloads = e.concurrentDownloads || 1,
  26217. this.downloadTestResults = {}
  26218. }
  26219. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26220. A("../settings")), r = (A("../objects/Panorama"),
  26221. A("../util/logger")), o = (A("../enum/Vectors"),
  26222. A("../enum/PanoSizeClass"),
  26223. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26224. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26225. Object.freeze({
  26226. Testing: 1,
  26227. Success: 2,
  26228. Fail: 3
  26229. }));
  26230. i.prototype = Object.create(l.prototype),
  26231. i.IDLE_REFRESH_DELAY = 500,
  26232. i.ACTIVE_REFRESH_DELAY = 16,
  26233. i.DOWNLOAD_RETRIES = 4,
  26234. i.prototype.init = function(e) {
  26235. this.qualityManager = e
  26236. }
  26237. ,
  26238. i.prototype.setUrls = function(e) {
  26239. this.urls = e
  26240. }
  26241. ,
  26242. i.prototype.setPanoData = function(e, t, i) {
  26243. this.panos = e,
  26244. this.imagePanos = t,
  26245. this.panoGroupId = i
  26246. }
  26247. ,
  26248. i.prototype.start = function() {
  26249. this.refreshUpdateInterval(0)
  26250. }
  26251. ,
  26252. i.prototype.stop = function() {
  26253. window.cancel(this.refreshInterval)
  26254. }
  26255. ,
  26256. i.prototype.refreshUpdateInterval = function(e) {
  26257. e = e || 0,
  26258. this.refreshInterval = window.setTimeout(function() {
  26259. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26260. }
  26261. .bind(this), e)
  26262. }
  26263. ,
  26264. i.prototype.update = function() {
  26265. var e = 0 < this.forceQueue.length;
  26266. return this.processQueueForDownloading(this.forceQueue),
  26267. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26268. 0 < this.priorityQueue.length && (e = !0),
  26269. this.processQueueForDownloading(this.priorityQueue)),
  26270. e
  26271. }
  26272. ,
  26273. i.prototype.forceQueueTilesForPano = (p = [],
  26274. f = [],
  26275. function(e, t, i, n, r, o) {
  26276. p.length = 0;
  26277. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26278. var l = a[s];
  26279. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26280. }
  26281. if (i && 0 < p.length) {
  26282. g.sortPanoTiles(p, e, i),
  26283. f.length = 0,
  26284. m.matchingTilesInDirection(e, t, i, n, r, f);
  26285. for (var c = 0, h = function(e) {
  26286. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26287. }; c < p.length; ) {
  26288. var u = p[c];
  26289. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26290. }
  26291. }
  26292. for (var d = 0; d < p.length; d++)
  26293. this.forceQueue.push(p[d]);
  26294. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26295. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26296. o && this.processQueueForDownloading(this.forceQueue, !0)
  26297. }
  26298. ),
  26299. i.prototype.clearForceQueue = function() {
  26300. this.clearQueue(this.forceQueue)
  26301. }
  26302. ,
  26303. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26304. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26305. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26306. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26307. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26308. }
  26309. ,
  26310. i.prototype.clearQueue = function(e) {
  26311. this.setStatusForAllDescriptors(e, v.None),
  26312. e.length = 0
  26313. }
  26314. ,
  26315. i.prototype.clearFromQueue = function(e, t, i) {
  26316. for (var n = 0; n < e.length; n++) {
  26317. var r = e[n];
  26318. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26319. }
  26320. }
  26321. ,
  26322. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26323. for (var i = 0; i < e.length; i++) {
  26324. var n = e[i];
  26325. n && (n.status = t)
  26326. }
  26327. }
  26328. ,
  26329. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26330. for (var i = 0; i < e.length; i++) {
  26331. var n = e[i];
  26332. n && (n.status !== t ? n.status = t : e[i] = null)
  26333. }
  26334. }
  26335. ,
  26336. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26337. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26338. , n = i[t];
  26339. return n || (n = this.buildDownloadDescriptorArray(t),
  26340. i[t] = n,
  26341. this.initTileDownloadDescriptors(n, e, t)),
  26342. n
  26343. }
  26344. ,
  26345. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26346. var t = this.downloadDescriptors[e.id];
  26347. return t || (t = {},
  26348. this.downloadDescriptors[e.id] = t),
  26349. t
  26350. }
  26351. ,
  26352. i.prototype.processQueueForDownloading = function(e, t) {
  26353. if (this.cleanupActiveDownloads(),
  26354. this.activeDownloads.length < this.concurrentDownloads || t)
  26355. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26356. var r = e.shift();
  26357. r && (this.startDownload(r),
  26358. n++)
  26359. }
  26360. }
  26361. ,
  26362. i.prototype.testDownload = function(t, e, i) {
  26363. var n = this.downloadTestResults[t];
  26364. if (n)
  26365. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26366. else {
  26367. this.downloadTestResults[t] = y.Testing;
  26368. var r = this.panos.list[0]
  26369. , o = this.getTileUrl(r.id, t, e, 0)
  26370. , a = function(e) {
  26371. this.downloadTestResults[t] = y.Success,
  26372. i(!0)
  26373. }
  26374. .bind(this)
  26375. , s = function() {
  26376. this.downloadTestResults[t] = y.Fail,
  26377. i(!1)
  26378. }
  26379. .bind(this);
  26380. this.loadImage(o, 0, a, s)
  26381. }
  26382. }
  26383. ,
  26384. i.prototype.startDownload = function(e) {
  26385. e.status = v.Downloading;
  26386. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26387. this.activeDownloads.push(e),
  26388. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26389. }
  26390. ,
  26391. i.prototype.downloadFailed = function(e, t) {}
  26392. ,
  26393. i.prototype.downloadComplete = function(e, t) {
  26394. if (e.panoGroupId === this.panoGroupId) {
  26395. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26396. e.status = v.Downloaded,
  26397. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26398. var n = {
  26399. panoId: e.pano.id,
  26400. image: t,
  26401. tileSize: e.tileSize,
  26402. panoSize: e.panoSize,
  26403. tileIndex: e.tileIndex,
  26404. faceTileIndex: e.faceTileIndex,
  26405. totalTiles: e.totalTiles,
  26406. face: e.face,
  26407. tileX: e.tileX,
  26408. tileY: e.tileY,
  26409. direction: e.direction
  26410. };
  26411. e.image = t,
  26412. this.emit(o.TileDownloadSuccess, n),
  26413. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26414. panoId: e.pano.id,
  26415. tileSize: e.tileSize,
  26416. panoSize: e.panoSize
  26417. },
  26418. this.emit(o.PanoDownloadComplete, n),
  26419. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26420. }
  26421. }
  26422. ,
  26423. i.prototype.cleanupActiveDownloads = (n = [],
  26424. function() {
  26425. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26426. var t = this.activeDownloads[e];
  26427. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26428. }
  26429. this.activeDownloads.length = 0,
  26430. this.activeDownloads.push.apply(this.activeDownloads, n)
  26431. }
  26432. ),
  26433. i.prototype.isPanoDownloaded = function(e, t) {
  26434. var i = this.getTileDownloadDescriptors(e, t);
  26435. if (i.length <= 0)
  26436. return !1;
  26437. for (var n = 0; n < i.length; n++) {
  26438. if (i[n].status !== v.Downloaded)
  26439. return !1
  26440. }
  26441. return !0
  26442. }
  26443. ,
  26444. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26445. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26446. this.panoLoadCallbacks[o] = {
  26447. onLoad: i,
  26448. onFail: n,
  26449. onProgress: r
  26450. }
  26451. }
  26452. ,
  26453. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26454. var i = e.id + ":" + t;
  26455. return this.panoLoadCallbacks[i]
  26456. }
  26457. ,
  26458. i.prototype.buildDownloadDescriptorArray = function(e) {
  26459. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26460. var r = this.buildDownloadDescriptor();
  26461. i.push(r)
  26462. }
  26463. return i
  26464. }
  26465. ,
  26466. i.prototype.buildDownloadDescriptor = function() {
  26467. return {
  26468. panoGroupId: null,
  26469. pano: null,
  26470. panoSize: -1,
  26471. tileSize: -1,
  26472. tileIndex: -1,
  26473. totalTiles: -1,
  26474. faceTileIndex: -1,
  26475. status: v.None,
  26476. url: null,
  26477. image: null,
  26478. direction: new t.Vector3,
  26479. face: -1,
  26480. cubeFace: -1,
  26481. tileX: -1,
  26482. tileY: -1
  26483. }
  26484. }
  26485. ,
  26486. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26487. for (var n = 0; n < e.length; n++) {
  26488. var r = e[n];
  26489. this.initTileDownloadDescriptor(r, t, i, n)
  26490. }
  26491. }
  26492. ,
  26493. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26494. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26495. e.face = m.getFaceForTile(i, n),
  26496. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26497. e.panoGroupId = this.panoGroupId,
  26498. e.pano = t,
  26499. e.panoSize = i,
  26500. e.tileSize = r,
  26501. e.tileIndex = n,
  26502. e.totalTiles = m.getTileCountForSize(i),
  26503. e.status = v.None,
  26504. e.image = null,
  26505. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26506. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26507. }
  26508. ,
  26509. i.prototype.getTileUrl = (c = {
  26510. 256: "256",
  26511. 512: "512",
  26512. 1024: "1k",
  26513. 2048: "2k",
  26514. 4096: "4k"
  26515. },
  26516. h = {
  26517. face: -1,
  26518. faceTileIndex: -1,
  26519. tileX: -1,
  26520. tileY: -1
  26521. },
  26522. function(e, t, i, n) {
  26523. m.getTileLocation(t, n, h);
  26524. var r = Math.floor(t / i)
  26525. , o = r * r
  26526. , a = Math.floor(n / o)
  26527. , s = "";
  26528. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26529. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26530. return d.changeIfTileGenerating(l)
  26531. }
  26532. ),
  26533. i.prototype.loadImage = function(e, t, i, n) {
  26534. s.getImage(e, t).then(function(e) {
  26535. i(e)
  26536. }).fail(n)
  26537. }
  26538. ,
  26539. C.exports = i
  26540. }
  26541. ).call(this, "/js/tile/TileDownloader.js")
  26542. }
  26543. , {
  26544. "../ab": 3,
  26545. "../enum/DownloadStatus": 24,
  26546. "../enum/GLCubeFaces": 25,
  26547. "../enum/PanoSizeClass": 36,
  26548. "../enum/TileDownloaderEvents": 45,
  26549. "../enum/Vectors": 50,
  26550. "../enum/Viewmode": 51,
  26551. "../objects/Panorama": 148,
  26552. "../settings": 166,
  26553. "../util/ajax": 181,
  26554. "../util/logger": 189,
  26555. "../util/panorama": 191,
  26556. "./TilePrioritizer": 172,
  26557. "./TileUtils": 174,
  26558. events: 202,
  26559. three: 217
  26560. }],
  26561. 172: [function(n, C, e) {
  26562. (function(e) {
  26563. "use strict";
  26564. function h(e, t, i, n, r) {
  26565. this.qualityManager = e,
  26566. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26567. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26568. this.baseSize = t,
  26569. this.standardSize = i,
  26570. this.highSize = n,
  26571. this.ultraHighSize = r,
  26572. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26573. }
  26574. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26575. n("../settings"),
  26576. n("../settings"),
  26577. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26578. n("../enum/PanoSizeClass"),
  26579. n("../enum/ModelManagerEvents"),
  26580. n("../enum/GLCubeFaces"),
  26581. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26582. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26583. new t(e),
  26584. Object.freeze({
  26585. None: 0,
  26586. DirectionalFOV: 1
  26587. }));
  26588. h.PriorityCriteria = function(e, t, i, n, r) {
  26589. this.pano = e,
  26590. this.cameraPosition = (new o.Vector3).copy(t),
  26591. this.cameraDir = (new o.Vector3).copy(i),
  26592. this.panoSpaceDir = (new o.Vector3).copy(n),
  26593. this.upcomingPanos = r,
  26594. this.copy = function(e) {
  26595. this.pano = e.pano,
  26596. this.cameraPosition.copy(e.cameraPosition),
  26597. this.cameraDir.copy(e.cameraDir),
  26598. this.panoSpaceDir.copy(e.panoSpaceDir),
  26599. this.upcomingPanos = r
  26600. }
  26601. ,
  26602. this.zoomingActive = !1
  26603. }
  26604. ,
  26605. h.DIRECTIONAL_FOV = 180,
  26606. h.DIRECTIONAL_FOV_NARROW = 120,
  26607. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26608. h.MAX_SCORED_PANOS_TOADD = 2,
  26609. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26610. h.DIRECTION_SCORE_STRICTNESS = .75,
  26611. h.appendQueue = function(e, t) {
  26612. if (e && t)
  26613. for (var i = 0; i < t.length; i++)
  26614. e.push(t[i])
  26615. }
  26616. ,
  26617. h.prototype.updateCriteria = function(e, t, i, n) {
  26618. this.priorityCriteria.pano = e,
  26619. this.priorityCriteria.cameraPosition.copy(t),
  26620. this.priorityCriteria.cameraDir.copy(i),
  26621. this.priorityCriteria.upcomingPanos = n,
  26622. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26623. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26624. }
  26625. ,
  26626. h.prototype.filterAndPrioritize = (u = [],
  26627. p = [],
  26628. f = [],
  26629. function(e, t, i) {
  26630. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26631. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26632. var n = this.baseSize
  26633. , r = this.standardSize
  26634. , o = this.highSize
  26635. , a = this.ultraHighSize;
  26636. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26637. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26638. f.length = 0,
  26639. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26640. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26641. h.appendQueue(e, f),
  26642. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26643. f.length = 0,
  26644. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26645. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26646. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26647. h.appendQueue(e, f),
  26648. f.length = 0,
  26649. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26650. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26651. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26652. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26653. h.appendQueue(e, f),
  26654. this.queueTilesForPanos(e, u, i, n)
  26655. }
  26656. ),
  26657. h.prototype.canDownloadSize = function(e) {
  26658. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26659. }
  26660. ,
  26661. h.prototype.populateNeighborPanos = function(e, t, i) {
  26662. (i = i || []).length = 0;
  26663. var n = t.getNeighbours(e);
  26664. for (var r in n)
  26665. if (n.hasOwnProperty(r)) {
  26666. var o = t.get(r);
  26667. i.push(o)
  26668. }
  26669. return i
  26670. }
  26671. ,
  26672. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26673. (i = i || []).length = 0;
  26674. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26675. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26676. , s = t.sortByScore(o, a);
  26677. if (s)
  26678. for (var l = 0; l < s.length && l < r; l++) {
  26679. var c = s[l].pano;
  26680. i.push(c)
  26681. }
  26682. return i
  26683. }
  26684. ,
  26685. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26686. for (var o = 0, a = 0; a < t.length; a++) {
  26687. var s = t[a];
  26688. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26689. r && r <= o)
  26690. break
  26691. }
  26692. return o
  26693. }
  26694. ,
  26695. h.prototype.queueTilesForPano = (r = {
  26696. filter: a.None
  26697. },
  26698. function(e, t, i, n) {
  26699. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26700. }
  26701. ),
  26702. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26703. function(e, t, i, n, r, o, a, s) {
  26704. for (var l = 0, c = 0; c < i.length; c++) {
  26705. var h = i[c];
  26706. d.copy(h.position),
  26707. d.sub(r),
  26708. d.normalize();
  26709. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26710. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26711. s && s <= l))
  26712. break
  26713. }
  26714. return l
  26715. }
  26716. ),
  26717. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26718. for (var l = 0, c = 0; c < i.length; c++) {
  26719. var h = i[c];
  26720. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26721. s && s <= l)
  26722. break
  26723. }
  26724. return l
  26725. }
  26726. ,
  26727. h.prototype.queueTilesInDirectionForPano = (s = {
  26728. filter: a.DirectionalFOV,
  26729. direction: new o.Vector3,
  26730. fov: 60
  26731. },
  26732. l = new o.Vector3,
  26733. function(e, t, i, n, r, o, a) {
  26734. return l.copy(o),
  26735. m.getRelativeDirection(i.quaternion, l),
  26736. s.direction.copy(l),
  26737. s.fov = a,
  26738. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26739. }
  26740. ),
  26741. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26742. function(e, t, i, n, r) {
  26743. var o = t.getTileDownloadDescriptors(i, n);
  26744. c.length = 0,
  26745. this.filterTileDownloadDescriptors(i, o, c, r);
  26746. for (var a = 0, s = 0; s < c.length; s++) {
  26747. var l = c[s];
  26748. l && (e.push(l),
  26749. a++)
  26750. }
  26751. return a
  26752. }
  26753. ),
  26754. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26755. function(e, t, i, n) {
  26756. var r, o;
  26757. switch (n.filter) {
  26758. case a.DirectionalFOV:
  26759. for (r = 0; r < t.length; r++)
  26760. o = t[r],
  26761. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26762. break;
  26763. default:
  26764. for (r = 0; r < t.length; r++)
  26765. o = t[r],
  26766. i.push(o)
  26767. }
  26768. for (r = 0; r < i.length; r++)
  26769. o = i[r],
  26770. this.canIncludeDescriptor(o) || (i[r] = null)
  26771. }
  26772. ),
  26773. h.prototype.canIncludeDescriptor = function(e) {
  26774. return e.status !== i.Downloading && e.status !== i.Downloaded
  26775. }
  26776. ,
  26777. h.prototype.canIncludePano = function(e, t) {
  26778. return !e.isLoaded(t)
  26779. }
  26780. ,
  26781. h.getFOVDotThreshold = function(e) {
  26782. return Math.cos(o.Math.degToRad(e / 2))
  26783. }
  26784. ;
  26785. var y = (A._panoSpaceDir = new o.Vector3,
  26786. A._fovThreshold = -1,
  26787. A._fovThresholdNarrow = -1,
  26788. A);
  26789. function A(e, t) {
  26790. var i = A._panoSpaceDir
  26791. , n = A._fovThreshold
  26792. , r = A._fovThresholdNarrow
  26793. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26794. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26795. return e._dot = o,
  26796. t._dot = a,
  26797. 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)
  26798. }
  26799. h.sortPanoTiles = function(e, t, i) {
  26800. y._panoSpaceDir.copy(i),
  26801. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26802. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26803. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26804. e.sort(y)
  26805. }
  26806. ,
  26807. h.insertSortedPanoTile = function(e, t, i, n) {
  26808. y._panoSpaceDir.copy(n),
  26809. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26810. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26811. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26812. for (var r = -1, o = 0; o < e.length; o++) {
  26813. if (y(t, e[o]) <= 0) {
  26814. r = o;
  26815. break
  26816. }
  26817. }
  26818. if (-1 === r)
  26819. e[e.length] = t;
  26820. else {
  26821. for (var a = e.length; r < a; a--)
  26822. e[a] = e[a - 1];
  26823. e[r] = t
  26824. }
  26825. }
  26826. ,
  26827. h.prototype.setZoomingActive = function(e) {
  26828. e !== this.zoomingActive && (this.zoomingActive = e)
  26829. }
  26830. ,
  26831. C.exports = h
  26832. }
  26833. ).call(this, "/js/tile/TilePrioritizer.js")
  26834. }
  26835. , {
  26836. "../enum/DownloadStatus": 24,
  26837. "../enum/GLCubeFaces": 25,
  26838. "../enum/ModelManagerEvents": 33,
  26839. "../enum/PanoSizeClass": 36,
  26840. "../enum/Vectors": 50,
  26841. "../enum/Viewmode": 51,
  26842. "../objects/Panorama": 148,
  26843. "../settings": 166,
  26844. "../util/browser": 182,
  26845. "../util/logger": 189,
  26846. "../util/math": 190,
  26847. "./TileUtils": 174,
  26848. events: 202,
  26849. three: 217
  26850. }],
  26851. 173: [function(e, t, i) {
  26852. "use strict";
  26853. function f(e, t) {
  26854. this.levels = t,
  26855. this.tileSize = e,
  26856. this.root = null,
  26857. this.allNodes = [],
  26858. function(e) {
  26859. e.root = function e(t, i, n) {
  26860. if (n > t.levels)
  26861. return null;
  26862. var r = new a(t,i);
  26863. t.allNodes.push(r);
  26864. for (var o = 0; o < s; o++)
  26865. r.children[o] = e(t, r, n + 1);
  26866. return r
  26867. }(e, null, 0)
  26868. }(this)
  26869. }
  26870. function a(e, t) {
  26871. this.tree = e,
  26872. this.parent = t,
  26873. this.children = [],
  26874. this.id = ++n
  26875. }
  26876. var g = (e("three"),
  26877. e("./TileUtils"),
  26878. e("../objects/Panorama"),
  26879. e("../util/panorama"),
  26880. e("events").EventEmitter,
  26881. 2)
  26882. , s = g * g;
  26883. f.TraversalType = Object.freeze({
  26884. PreOrder: 0,
  26885. PostOrder: 1
  26886. });
  26887. var n = 0;
  26888. f.getLevelCountForSize = function(e, t) {
  26889. var i = 0;
  26890. for (t < e && (t = e); !((t /= g) < e); )
  26891. i++;
  26892. return i
  26893. }
  26894. ,
  26895. f.getSizeForLevel = function(e, t) {
  26896. return Math.pow(g, t) * e
  26897. }
  26898. ,
  26899. f.prototype.getSubNode = function(e, t, i) {
  26900. (!t || e < this.tileSize) && (t = 0),
  26901. (!i || e < this.tileSize) && (i = 0),
  26902. e < this.tileSize && (e = this.tileSize);
  26903. var n = f.getLevelCountForSize(this.tileSize, e);
  26904. return function e(t, i, n, r, o) {
  26905. if (!t)
  26906. return null;
  26907. if (0 === n)
  26908. return t;
  26909. if (!t.children || 0 === t.children.length)
  26910. return null;
  26911. var a = Math.pow(g, n) / g
  26912. , s = r % a
  26913. , l = o % a
  26914. , c = Math.floor(o / a)
  26915. , h = Math.floor(r / a)
  26916. , u = c * g + h;
  26917. return e(t.children[u], i + 1, n - 1, s, l)
  26918. }(this.root, 0, n, t, i)
  26919. }
  26920. ,
  26921. f.prototype.breadthFirst = function(e) {
  26922. var t = !!(e = e || {}).nullLevelEnd
  26923. , i = e.maxLevel
  26924. , n = e.minLevel
  26925. , r = e.callback
  26926. , o = e.saveVisited
  26927. , a = []
  26928. , s = {}
  26929. , l = 0;
  26930. for (a.push(this.root),
  26931. a.push(s); 0 < a.length && !(i && i < l); ) {
  26932. var c = a.shift();
  26933. if (c === s)
  26934. (!n || n <= l) && (r && t && r(null),
  26935. o && t && o.push(null)),
  26936. 0 < a.length && a.push(s),
  26937. l++,
  26938. 0;
  26939. else {
  26940. if (c.children)
  26941. for (var h = 0; h < c.children.length; h++) {
  26942. c.children[h] && a.push(c.children[h])
  26943. }
  26944. var u = this.getFaceIndexFromNode(c);
  26945. (!n || n <= l) && (r && r(c, l, u),
  26946. o && o.push(c)),
  26947. 0
  26948. }
  26949. }
  26950. }
  26951. ,
  26952. f.prototype.getFaceIndexFromNode = function(e) {
  26953. if (!e)
  26954. return -1;
  26955. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26956. var o = i.parent;
  26957. if (!o)
  26958. break;
  26959. for (var a = -1, s = 0; s < o.children.length; s++)
  26960. o.children[s] === i && (a = s);
  26961. n = a % g * t + n,
  26962. r = Math.floor(a / g) * t + r,
  26963. t *= g,
  26964. i = o
  26965. }
  26966. return r * t + n
  26967. }
  26968. ,
  26969. f.prototype.depthFirst = function(e, t, i) {
  26970. !function e(t, i, n, r, o, a, s, l) {
  26971. if (t) {
  26972. s = s || f.TraversalType.PreOrder;
  26973. var c = r * g + n;
  26974. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26975. a && a.push(t)),
  26976. t.children && 0 !== t.children.length) {
  26977. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26978. for (var p = 0; p < g; p++)
  26979. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26980. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26981. a && a.push(t))
  26982. }
  26983. }
  26984. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26985. }
  26986. ,
  26987. t.exports = f
  26988. }
  26989. , {
  26990. "../objects/Panorama": 148,
  26991. "../util/panorama": 191,
  26992. "./TileUtils": 174,
  26993. events: 202,
  26994. three: 217
  26995. }],
  26996. 174: [function(e, t, i) {
  26997. "use strict";
  26998. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26999. b.TILE_SIZE = 512,
  27000. b.FACES_PER_PANO = 6,
  27001. b.LocationOnTile = {
  27002. Center: 0,
  27003. UpperLeft: 1,
  27004. UpperRight: 2,
  27005. LowerRight: 3,
  27006. LowerLeft: 4
  27007. },
  27008. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27009. var l = e / t
  27010. , c = t / e * 2
  27011. , h = c / 2
  27012. , u = n / l * 2 - 1 + h
  27013. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27014. switch (o = o || b.LocationOnTile.Center) {
  27015. case b.LocationOnTile.UpperLeft:
  27016. u -= h,
  27017. d += h,
  27018. u += a * c;
  27019. break;
  27020. case b.LocationOnTile.UpperRight:
  27021. u += h,
  27022. d += h,
  27023. d -= a * c;
  27024. break;
  27025. case b.LocationOnTile.LowerRight:
  27026. u += h,
  27027. d -= h,
  27028. u -= a * c;
  27029. break;
  27030. case b.LocationOnTile.LowerLeft:
  27031. u -= h,
  27032. d -= h,
  27033. d += a * c;
  27034. break;
  27035. case b.LocationOnTile.Center:
  27036. }
  27037. switch (i) {
  27038. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27039. _.setVector(s, -1, d, -u);
  27040. break;
  27041. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27042. _.setVector(s, 1, d, u);
  27043. break;
  27044. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27045. _.setVector(s, -u, 1, -d);
  27046. break;
  27047. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27048. _.setVector(s, -u, -1, d);
  27049. break;
  27050. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27051. _.setVector(s, -u, d, 1);
  27052. break;
  27053. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27054. _.setVector(s, u, d, -1)
  27055. }
  27056. _.normalize(s)
  27057. }
  27058. ,
  27059. b.getFaceForTile = function(e, t) {
  27060. var i = b.TILE_SIZE;
  27061. e < b.TILE_SIZE && (i = e);
  27062. var n = Math.floor(e / i)
  27063. , r = n * n;
  27064. return Math.floor(t / r)
  27065. }
  27066. ,
  27067. b.getTileLocation = function(e, t, i) {
  27068. var n = b.TILE_SIZE;
  27069. e < b.TILE_SIZE && (n = e);
  27070. var r = b.getFaceForTile(e, t)
  27071. , o = Math.floor(e / n)
  27072. , a = t - r * (o * o);
  27073. i.tileX = a % o,
  27074. i.tileY = Math.floor(a / o),
  27075. i.face = r,
  27076. i.faceTileIndex = a
  27077. }
  27078. ,
  27079. b.getTileCountForSize = function(e) {
  27080. if (e <= b.TILE_SIZE)
  27081. return b.FACES_PER_PANO;
  27082. var t = Math.floor(e / b.TILE_SIZE);
  27083. return t * t * b.FACES_PER_PANO
  27084. }
  27085. ,
  27086. b.getRelativeDirection = (r = new _.Matrix4,
  27087. o = new _.Quaternion,
  27088. function(e, t) {
  27089. o.copy(e),
  27090. o.inverse(),
  27091. r.makeRotationFromQuaternion(o),
  27092. r.applyToVector3(t),
  27093. _.normalize(t)
  27094. }
  27095. ),
  27096. b.matchingTilesInDirection = (c = new _.Vector3,
  27097. h = new _.Vector3(0,0,-1),
  27098. u = new _.Quaternion,
  27099. l = {
  27100. face: -1,
  27101. faceTileIndex: -1,
  27102. tileX: -1,
  27103. tileY: -1
  27104. },
  27105. d = function(e, t, i) {
  27106. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27107. b.getTileLocation(e, o, l),
  27108. t && !t(l) || (r++,
  27109. i && (a = l,
  27110. i.push({
  27111. face: a.face,
  27112. faceTileIndex: a.faceTileIndex,
  27113. tileX: a.tileX,
  27114. tileY: a.tileY
  27115. })));
  27116. var a;
  27117. return r
  27118. }
  27119. ,
  27120. function(e, t, i, n, r, o) {
  27121. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27122. if (b.getTileCountForSize(t),
  27123. !n && !r)
  27124. return d(t, null, o);
  27125. var s = !!r;
  27126. return r = r || n,
  27127. r = Math.max(0, Math.min(r, 360)),
  27128. n = Math.max(0, Math.min(n, 360)),
  27129. _.copyVector(i, c),
  27130. b.getRelativeDirection(e.quaternion, c),
  27131. s ? (u.setFromUnitVectors(c, h),
  27132. d(t, function(e) {
  27133. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27134. }, o)) : d(t, function(e) {
  27135. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27136. }, o)
  27137. }
  27138. ),
  27139. b.isTileWithinFrustum = (E = new _.Vector3,
  27140. function(e, t, i, n, r, o, a, s) {
  27141. 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++)
  27142. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27143. _.applyQuaternionToVector(o, E),
  27144. -1e-5 <= E.z)
  27145. ;
  27146. else {
  27147. var A = -1 / E.z
  27148. , C = E.x * A
  27149. , I = E.y * A;
  27150. l < I ? p++ : I < c && f++,
  27151. h < C ? g++ : C < u && m++,
  27152. v++
  27153. }
  27154. return f !== v && p !== v && g !== v && m !== v
  27155. }
  27156. ),
  27157. b.isTileWithinFOV = (p = new _.Vector3,
  27158. f = new _.Vector3(0,1,0),
  27159. g = new _.Vector3(1,0,0),
  27160. function(e, t, i, n, r, o, a) {
  27161. var s = b.mapFaceToCubemapFace(i);
  27162. if (_.cross(o, f, g),
  27163. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27164. b.isWithinFOV(p, o, a, null))
  27165. return !0;
  27166. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27167. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27168. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27169. b.isWithinFOV(p, o, a, null))
  27170. return !0;
  27171. h += l
  27172. }
  27173. return !1
  27174. }
  27175. ),
  27176. b.isWithinFOV = (a = new _.Vector3,
  27177. s = new _.Vector3,
  27178. function(e, t, i, n) {
  27179. if (_.copyVector(e, s),
  27180. n) {
  27181. _.copyVector(n, a),
  27182. _.normalize(a);
  27183. var r = _.dot(a, e);
  27184. a.x *= r,
  27185. a.y *= r,
  27186. a.z *= r,
  27187. _.subVector(s, a)
  27188. }
  27189. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27190. return Math.cos(o) <= _.dot(s, t)
  27191. }
  27192. ),
  27193. b.mapFaceToCubemapFace = (n = {
  27194. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27195. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27196. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27197. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27198. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27199. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27200. },
  27201. function(e) {
  27202. return n[e]
  27203. }
  27204. ),
  27205. t.exports = b
  27206. }
  27207. , {
  27208. "../enum/GLCubeFaces": 25,
  27209. "../util/MathLight": 176
  27210. }],
  27211. 175: [function(i, n, e) {
  27212. (function(e) {
  27213. "use strict";
  27214. function t() {
  27215. this.list = [],
  27216. this.index = {},
  27217. Object.defineProperty(this, "length", {
  27218. get: function() {
  27219. return this.list.length
  27220. }
  27221. })
  27222. }
  27223. new (i("./common"),
  27224. i("./logger"))(e),
  27225. t.prototype.forEach = function(e) {
  27226. this.list.forEach(e)
  27227. }
  27228. ,
  27229. t.prototype.add = function(e) {
  27230. this.list.push(e),
  27231. this.index[this.getIndex(e)] = e
  27232. }
  27233. ,
  27234. t.prototype.getIndex = function(e) {
  27235. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27236. }
  27237. ,
  27238. t.prototype.extend = function(e) {
  27239. for (var t = 0; t < e.length; t++)
  27240. this.add(e[t])
  27241. }
  27242. ,
  27243. t.prototype.get = function(e) {
  27244. return this.index[e]
  27245. }
  27246. ,
  27247. t.prototype.first = function() {
  27248. return this.list[0]
  27249. }
  27250. ,
  27251. t.prototype.last = function() {
  27252. return this.list[this.list.length - 1]
  27253. }
  27254. ,
  27255. t.prototype.reIndex = function() {
  27256. this.index = {};
  27257. var t = this;
  27258. this.forEach(function(e) {
  27259. t.index[t.getIndex(e)] = e
  27260. })
  27261. }
  27262. ,
  27263. t.prototype.filter = function(e) {
  27264. var t = this.list.filter(e);
  27265. return this.reIndex(),
  27266. t
  27267. }
  27268. ,
  27269. t.prototype.reduce = function(e, t) {
  27270. return this.list.reduce(e, t)
  27271. }
  27272. ,
  27273. t.prototype.sort = function(e) {
  27274. return this.list.sort(e)
  27275. }
  27276. ,
  27277. t.prototype.indexOf = function(e) {
  27278. for (var t = 0; t < this.list.length; ++t)
  27279. if (this.list[t] === e)
  27280. return t;
  27281. return -1
  27282. }
  27283. ,
  27284. n.exports = t
  27285. }
  27286. ).call(this, "/js/util/IndexedCollection.js")
  27287. }
  27288. , {
  27289. "./common": 185,
  27290. "./logger": 189
  27291. }],
  27292. 176: [function(e, t, i) {
  27293. "use strict";
  27294. e("../constants");
  27295. var n, r, o = {};
  27296. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27297. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27298. o.Vector3 = function(e, t, i) {
  27299. this.x = e || 0,
  27300. this.y = t || 0,
  27301. this.z = i || 0
  27302. }
  27303. ,
  27304. o.Matrix4 = function() {
  27305. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27306. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27307. }
  27308. ,
  27309. o.Matrix4.prototype = {
  27310. identity: function() {
  27311. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27312. this
  27313. },
  27314. copy: function(e) {
  27315. return this.elements.set(e.elements),
  27316. this
  27317. },
  27318. applyToVector3: function(e) {
  27319. var t = e.x
  27320. , i = e.y
  27321. , n = e.z
  27322. , r = this.elements;
  27323. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27324. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27325. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27326. this
  27327. },
  27328. getInverse: function(e, t) {
  27329. var i = this.elements
  27330. , n = e.elements
  27331. , r = n[0]
  27332. , o = n[1]
  27333. , a = n[2]
  27334. , s = n[3]
  27335. , l = n[4]
  27336. , c = n[5]
  27337. , h = n[6]
  27338. , u = n[7]
  27339. , d = n[8]
  27340. , p = n[9]
  27341. , f = n[10]
  27342. , g = n[11]
  27343. , m = n[12]
  27344. , v = n[13]
  27345. , y = n[14]
  27346. , A = n[15]
  27347. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27348. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27349. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27350. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27351. , b = r * C + o * I + a * E + s * _;
  27352. if (0 == b) {
  27353. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27354. if (t)
  27355. throw new Error(w);
  27356. return console.warn(w),
  27357. this.identity()
  27358. }
  27359. var T = 1 / b;
  27360. return i[0] = C * T,
  27361. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27362. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27363. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27364. i[4] = I * T,
  27365. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27366. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27367. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27368. i[8] = E * T,
  27369. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27370. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27371. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27372. i[12] = _ * T,
  27373. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27374. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27375. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27376. this
  27377. },
  27378. makeRotationFromQuaternion: function(e) {
  27379. var t = this.elements
  27380. , i = e.x
  27381. , n = e.y
  27382. , r = e.z
  27383. , o = e.w
  27384. , a = i + i
  27385. , s = n + n
  27386. , l = r + r
  27387. , c = i * a
  27388. , h = i * s
  27389. , u = i * l
  27390. , d = n * s
  27391. , p = n * l
  27392. , f = r * l
  27393. , g = o * a
  27394. , m = o * s
  27395. , v = o * l;
  27396. return t[0] = 1 - (d + f),
  27397. t[4] = h - v,
  27398. t[8] = u + m,
  27399. t[1] = h + v,
  27400. t[5] = 1 - (c + f),
  27401. t[9] = p - g,
  27402. t[2] = u - m,
  27403. t[6] = p + g,
  27404. t[10] = 1 - (c + d),
  27405. t[3] = 0,
  27406. t[7] = 0,
  27407. t[11] = 0,
  27408. t[12] = 0,
  27409. t[13] = 0,
  27410. t[14] = 0,
  27411. t[15] = 1,
  27412. this
  27413. }
  27414. },
  27415. o.Quaternion = function(e, t, i, n) {
  27416. this._x = e || 0,
  27417. this._y = t || 0,
  27418. this._z = i || 0,
  27419. this._w = void 0 !== n ? n : 1
  27420. }
  27421. ,
  27422. o.Quaternion.prototype = {
  27423. get x() {
  27424. return this._x
  27425. },
  27426. set x(e) {
  27427. this._x = e
  27428. },
  27429. get y() {
  27430. return this._y
  27431. },
  27432. set y(e) {
  27433. this._y = e
  27434. },
  27435. get z() {
  27436. return this._z
  27437. },
  27438. set z(e) {
  27439. this._z = e
  27440. },
  27441. get w() {
  27442. return this._w
  27443. },
  27444. set w(e) {
  27445. this._w = e
  27446. },
  27447. copy: function(e) {
  27448. this._x = e.x,
  27449. this._y = e.y,
  27450. this._z = e.z,
  27451. this._w = e.w
  27452. },
  27453. inverse: function() {
  27454. return this.conjugate().normalize()
  27455. },
  27456. conjugate: function() {
  27457. return this._x *= -1,
  27458. this._y *= -1,
  27459. this._z *= -1,
  27460. this
  27461. },
  27462. length: function() {
  27463. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27464. },
  27465. normalize: function() {
  27466. var e = this.length();
  27467. return 0 === e ? (this._x = 0,
  27468. this._y = 0,
  27469. this._z = 0,
  27470. this._w = 1) : (e = 1 / e,
  27471. this._x = this._x * e,
  27472. this._y = this._y * e,
  27473. this._z = this._z * e,
  27474. this._w = this._w * e),
  27475. this
  27476. },
  27477. setFromAxisAngle: function(e, t) {
  27478. var i = t / 2
  27479. , n = Math.sin(i);
  27480. return this._x = e.x * n,
  27481. this._y = e.y * n,
  27482. this._z = e.z * n,
  27483. this._w = Math.cos(i),
  27484. this
  27485. },
  27486. setFromUnitVectors: function(e, t) {
  27487. return void 0 === n && (n = new o.Vector3),
  27488. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27489. 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),
  27490. this._x = n.x,
  27491. this._y = n.y,
  27492. this._z = n.z,
  27493. this._w = r,
  27494. this.normalize()
  27495. },
  27496. multiply: function(e) {
  27497. return this.multiplyQuaternions(this, e)
  27498. },
  27499. premultiply: function(e) {
  27500. return this.multiplyQuaternions(e, this)
  27501. },
  27502. multiplyQuaternions: function(e, t) {
  27503. var i = e._x
  27504. , n = e._y
  27505. , r = e._z
  27506. , o = e._w
  27507. , a = t._x
  27508. , s = t._y
  27509. , l = t._z
  27510. , c = t._w;
  27511. return this._x = i * c + o * a + n * l - r * s,
  27512. this._y = n * c + o * s + r * a - i * l,
  27513. this._z = r * c + o * l + i * s - n * a,
  27514. this._w = o * c - i * a - n * s - r * l,
  27515. this
  27516. }
  27517. },
  27518. o.convertWorkshopVector = function(e) {
  27519. return new o.Vector3(-e.x,e.y,e.z)
  27520. }
  27521. ,
  27522. o.convertWorkshopQuaternion = function(e) {
  27523. 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))
  27524. }
  27525. ,
  27526. o.convertWorkshopOrthoZoom = function(e) {
  27527. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27528. }
  27529. ,
  27530. o.convertWorkshopPanoramaQuaternion = function(e) {
  27531. 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))
  27532. }
  27533. ,
  27534. o.normalize = function(e) {
  27535. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27536. , i = Math.sqrt(t);
  27537. e.x /= i,
  27538. e.y /= i,
  27539. e.z /= i
  27540. }
  27541. ,
  27542. o.dot = function(e, t) {
  27543. return e.x * t.x + e.y * t.y + e.z * t.z
  27544. }
  27545. ,
  27546. o.cross = function(e, t, i) {
  27547. var n = e.x
  27548. , r = e.y
  27549. , o = e.z;
  27550. i.x = r * t.z - o * t.y,
  27551. i.y = o * t.x - n * t.z,
  27552. i.z = n * t.y - r * t.x
  27553. }
  27554. ,
  27555. o.setVector = function(e, t, i, n) {
  27556. e.x = t,
  27557. e.y = i,
  27558. e.z = n
  27559. }
  27560. ,
  27561. o.copyVector = function(e, t) {
  27562. t.x = e.x,
  27563. t.y = e.y,
  27564. t.z = e.z
  27565. }
  27566. ,
  27567. o.addVector = function(e, t) {
  27568. e.x += t.x,
  27569. e.y += t.y,
  27570. e.z += t.z
  27571. }
  27572. ,
  27573. o.subVector = function(e, t) {
  27574. e.x -= t.x,
  27575. e.y -= t.y,
  27576. e.z -= t.z
  27577. }
  27578. ,
  27579. o.applyQuaternionToVector = function(e, t) {
  27580. var i = t.x
  27581. , n = t.y
  27582. , r = t.z
  27583. , o = e.x
  27584. , a = e.y
  27585. , s = e.z
  27586. , l = e.w
  27587. , c = l * i + a * r - s * n
  27588. , h = l * n + s * i - o * r
  27589. , u = l * r + o * n - a * i
  27590. , d = -o * i - a * n - s * r;
  27591. t.x = c * l + d * -o + h * -s - u * -a,
  27592. t.y = h * l + d * -a + u * -o - c * -s,
  27593. t.z = u * l + d * -s + c * -a - h * -o
  27594. }
  27595. ,
  27596. o.angleBetweenVectors = function(e, t) {
  27597. return Math.acos(o.dot(e, t))
  27598. }
  27599. ,
  27600. t.exports = o
  27601. }
  27602. , {
  27603. "../constants": 8
  27604. }],
  27605. 177: [function(c, h, e) {
  27606. (function(e) {
  27607. "use strict";
  27608. function t(e) {
  27609. this.cache = null,
  27610. this.expires = 0
  27611. }
  27612. function i() {
  27613. this.baseUrl = null,
  27614. this.cache = null,
  27615. this.expires = 0
  27616. }
  27617. function n() {
  27618. this.baseUrl = null,
  27619. this.expires = 0
  27620. }
  27621. function r(e) {
  27622. this.initialLoadingPromise = null,
  27623. this.endpoint = e + "?type=3",
  27624. this.urlContainer = null,
  27625. this.authorizationHeader = s.getAuthorizationHeader(),
  27626. this.containerClasses = [n, i, t]
  27627. }
  27628. c("./ajax");
  27629. var o = c("./logger")
  27630. , a = c("../constants")
  27631. , s = c("./showcase")
  27632. , l = (c("../ab"),
  27633. new o(e));
  27634. t.prototype = {
  27635. version: 1,
  27636. validate: function(e) {
  27637. return "catalog.json"in e && 0 < Object.keys(e).length
  27638. },
  27639. update: function(e) {
  27640. return this.cache = e,
  27641. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27642. $.when()
  27643. },
  27644. get: function(e) {
  27645. return this.cache[e]
  27646. }
  27647. },
  27648. i.prototype = {
  27649. version: 2,
  27650. validate: function(e) {
  27651. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27652. },
  27653. update: function(e) {
  27654. return this.baseUrl = e["base.url"],
  27655. this.cache = e,
  27656. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27657. $.when()
  27658. },
  27659. get: function(e) {
  27660. var t = this.cache[e];
  27661. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27662. }
  27663. },
  27664. n.prototype = {
  27665. version: 3,
  27666. validate: function(e) {
  27667. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27668. },
  27669. update: function(e) {
  27670. return this.baseUrl = e.templates[0],
  27671. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27672. $.when()
  27673. },
  27674. get: function(e) {
  27675. return this.baseUrl.replace("{{filename}}", e)
  27676. }
  27677. },
  27678. r.prototype = {
  27679. init: function() {
  27680. return this.initialLoadingPromise || (setInterval(function() {
  27681. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27682. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27683. this.refresh().done(function() {
  27684. l.debug("Refreshed")
  27685. }).fail(function() {
  27686. l.error("Failed url refresh, urls might go stale soon")
  27687. }))
  27688. }
  27689. .bind(this), a.signedUrlCheckInterval),
  27690. this.initialLoadingPromise = this.refresh()),
  27691. this.initialLoadingPromise
  27692. },
  27693. refresh: function(e) {
  27694. return {},
  27695. $.Deferred().resolve()
  27696. },
  27697. get: function(e) {
  27698. return window.DATA.files.templates[0].replace("{{filename}}", e)
  27699. }
  27700. },
  27701. h.exports = r
  27702. }
  27703. ).call(this, "/js/util/ModelUrls.js")
  27704. }
  27705. , {
  27706. "../ab": 3,
  27707. "../constants": 8,
  27708. "./ajax": 181,
  27709. "./logger": 189,
  27710. "./showcase": 193
  27711. }],
  27712. 178: [function(l, c, e) {
  27713. (function(e) {
  27714. "use strict";
  27715. function t() {
  27716. i.call(this),
  27717. this.neighbourMap = {},
  27718. this.map = null
  27719. }
  27720. 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"),
  27721. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27722. n.inherit(t, i),
  27723. t.prototype.getIndex = function(e) {
  27724. return e.id
  27725. }
  27726. ,
  27727. t.prototype.find = function(e, t) {
  27728. var i = n.filterAll(this.list, e);
  27729. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27730. i = n.stableSort(i, e)
  27731. }),
  27732. i[0])
  27733. }
  27734. ,
  27735. t.prototype.sortByScore = function(e, t) {
  27736. var i = n.filterAll(this.list, e);
  27737. return 0 === i.length ? null : i = i.map(function(i) {
  27738. return {
  27739. pano: i,
  27740. score: t.reduce(function(e, t) {
  27741. return e + t(i)
  27742. }, 0)
  27743. }
  27744. }).sort(function(e, t) {
  27745. return t.score - e.score
  27746. })
  27747. }
  27748. ,
  27749. t.prototype.lowestByScore = function(e, t, i) {
  27750. return this.findRankedByScore(0, e, t, i)
  27751. }
  27752. ,
  27753. t.prototype.findRankedByScore = function(e, t, i, n) {
  27754. n && (n.candidates = null,
  27755. n.pano = null),
  27756. e = e || 0;
  27757. var r = this.sortByScore(t, i);
  27758. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27759. n.pano = r[e].pano),
  27760. r[e].pano)
  27761. }
  27762. ,
  27763. t.prototype.showPanoScores = function(e) {
  27764. this.list.forEach(function(e) {
  27765. e.removeTextSprite()
  27766. });
  27767. var t = 6344768;
  27768. e.forEach(function(e) {
  27769. e.pano.addTextSprite(e.score.toFixed(2), t),
  27770. t = 16428055
  27771. })
  27772. }
  27773. ,
  27774. t.prototype.isNeighbour = function(e, t) {
  27775. return this.neighbourMap[e.id][t.id]
  27776. }
  27777. ,
  27778. t.prototype.getNeighbours = function(e) {
  27779. return this.neighbourMap[e.id]
  27780. }
  27781. ,
  27782. t.prototype.setNeighbour = function(e, t, i) {
  27783. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27784. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27785. this.neighbourMap[e.id][e.id] = !0,
  27786. this.neighbourMap[t.id][t.id] = !0,
  27787. this.neighbourMap[e.id][t.id] = i,
  27788. this.neighbourMap[t.id][e.id] = i,
  27789. this.neighbourMap[e.id]
  27790. }
  27791. ,
  27792. t.prototype.findClosest = function(e, t) {
  27793. var i = [r.filters.isPanoAligned()];
  27794. return t && i.push(r.filters.inDirection(e, t, .75)),
  27795. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27796. }
  27797. ,
  27798. t.prototype.dualNeighbors = function(e, t) {
  27799. var i, n = [];
  27800. for (i in this.neighbourMap[e.id])
  27801. this.neighbourMap[t.id][i] && n.push(i);
  27802. return n
  27803. }
  27804. ,
  27805. t.prototype.populate_path_graph = function() {
  27806. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27807. for (e = 0; e < this.list.length; e += 1) {
  27808. for (t in s = !(a = {}),
  27809. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27810. if (i[t]) {
  27811. o = this.index[t],
  27812. u.copy(r.floorPosition),
  27813. u.sub(o.floorPosition);
  27814. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27815. , p = (Math.abs(u.y),
  27816. Math.max(d, .01),
  27817. Math.max(0, Math.abs(u.y) - .2));
  27818. n = 0 < p ? (1,
  27819. p = Math.pow(4 * p, 2),
  27820. d = Math.pow(d, 2),
  27821. Math.sqrt(p * p + d * d)) : (1,
  27822. u.length()),
  27823. a[o.id] = n,
  27824. s = !0
  27825. }
  27826. s ? c[r.id] = a : h += 1
  27827. }
  27828. this.map = c,
  27829. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27830. }
  27831. ,
  27832. t.prototype.aStarSearch = function(e, t) {
  27833. var i = Date.now()
  27834. , n = new o({
  27835. start: e,
  27836. isEnd: function(e) {
  27837. return e === t
  27838. },
  27839. neighbor: function(e) {
  27840. var t = e.neighbourPanos || e.findNeighourPanos()
  27841. , i = [];
  27842. for (var n in t)
  27843. t[n] && i.push(this.index[n]); //add: t[n] &&
  27844. return i
  27845. }
  27846. .bind(this),
  27847. distance: function(e, t) {
  27848. return this.map[e.id][t.id]
  27849. }
  27850. .bind(this),
  27851. heuristic: function(e, t) {
  27852. return 1
  27853. }
  27854. .bind(this),
  27855. hash: function(e) {
  27856. return e.id
  27857. },
  27858. timeout: 5e3
  27859. });
  27860. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27861. "success" !== n.status)
  27862. return T.debug("Did not find A* path from " + e + " to " + t),
  27863. null;
  27864. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27865. var r = [];
  27866. return n.path.forEach(function(e) {
  27867. r.push(e.id)
  27868. }),
  27869. r
  27870. }
  27871. ,
  27872. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27873. g = new w.Vector3,
  27874. m = new w.Vector3,
  27875. v = new w.Vector3,
  27876. y = new w.Vector3,
  27877. A = new w.Vector3,
  27878. C = new w.Vector3,
  27879. I = new w.Vector3,
  27880. E = [],
  27881. _ = new w.Vector3,
  27882. b = new w.Vector3,
  27883. function(e, t) {
  27884. if (e)
  27885. for (var i = function(e, t, i) {
  27886. return y.copy(t).sub(e),
  27887. y.dot(i)
  27888. }, n = function(e, t) {
  27889. return i(_, e.position, m) - i(_, t.position, m)
  27890. }, r = 0; r < e.length - 1; ) {
  27891. var o = e[r]
  27892. , a = e[r + 1]
  27893. , s = this.index[o]
  27894. , l = this.index[a];
  27895. _.copy(s.position),
  27896. b.copy(l.position),
  27897. E.length = 0,
  27898. f.copy(b).sub(_),
  27899. m.copy(f).normalize();
  27900. for (var c = 0; c < this.list.length; c++) {
  27901. var h = this.list[c];
  27902. y.copy(h.position).sub(_);
  27903. var u = y.dot(m);
  27904. 0 < u && (C.copy(m),
  27905. C.multiplyScalar(u),
  27906. A.copy(y),
  27907. A.sub(C),
  27908. A.length() < t && (g.copy(f).negate(),
  27909. v.copy(g).normalize(),
  27910. I.copy(h.position).sub(b),
  27911. 0 < I.dot(v) && E.push(h)))
  27912. }
  27913. if (0 < E.length) {
  27914. E.sort(n);
  27915. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27916. e[d] = e[d - E.length];
  27917. for (var p = 0; p < E.length; p++)
  27918. e[p + r + 1] = E[p].id
  27919. }
  27920. r += E.length + 1
  27921. }
  27922. }
  27923. ),
  27924. t.prototype.fadeMarkerOpacity = function(e, t) {
  27925. var i = void 0 === e ? a.panorama.markerOpacity : e
  27926. , n = this.list.findIndex(function(e) {
  27927. return e.marker
  27928. });
  27929. if (!(n < 0)) {
  27930. var r = this.list[n].marker.material.opacity;
  27931. if (r !== e) {
  27932. var o = i - r;
  27933. s.trigger({
  27934. func: function(e, t) {
  27935. var i = r + e * o;
  27936. this.forEach(function(e) {
  27937. e.marker && (e.marker.material.opacity = i)
  27938. })
  27939. }
  27940. .bind(this),
  27941. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27942. name: "_fpm"
  27943. })
  27944. }
  27945. }
  27946. }
  27947. ,
  27948. c.exports = t
  27949. }
  27950. ).call(this, "/js/util/PanoramaCollection.js")
  27951. }
  27952. , {
  27953. "../objects/Panorama": 148,
  27954. "../settings": 166,
  27955. "./IndexedCollection": 175,
  27956. "./aStar": 180,
  27957. "./common": 185,
  27958. "./logger": 189,
  27959. "./transitions": 195,
  27960. three: 217
  27961. }],
  27962. 179: [function(e, t, i) {
  27963. "use strict";
  27964. function n() {
  27965. this.actionSequence = [],
  27966. this.actionSequenceInProgress = !1
  27967. }
  27968. function r(e, t, i, n) {
  27969. c.trackAlways("zoom_" + e, {
  27970. from: t,
  27971. to: i,
  27972. pano: n
  27973. })
  27974. }
  27975. var o, a, s, l, c = e("../analytics");
  27976. n.prototype.reset = function(e) {
  27977. this.actionSequenceInProgress = !1,
  27978. this.actionSequence.length = 0
  27979. }
  27980. ,
  27981. n.prototype.addZoomAction = (a = o = null,
  27982. s = !1,
  27983. l = function() {
  27984. if (o = null,
  27985. 0 < this.actionSequence.length) {
  27986. var e = this.actionSequence[0].start
  27987. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27988. 1 === e ? function(e, t) {
  27989. r("initial", 1, e, t)
  27990. }(t, a) : function(e, t, i) {
  27991. r("followup", e, t, i)
  27992. }(e, t, a)
  27993. }
  27994. this.reset()
  27995. }
  27996. ,
  27997. function(e, t, i) {
  27998. if (e !== t) {
  27999. s || (l = l.bind(this),
  28000. s = !0),
  28001. o && (window.clearTimeout(o),
  28002. o = null),
  28003. i === a && this.actionSequenceInProgress || (this.reset(),
  28004. a = i),
  28005. this.actionSequenceInProgress = !0;
  28006. var n = {
  28007. start: e,
  28008. end: t
  28009. };
  28010. this.actionSequence.push(n),
  28011. o = window.setTimeout(l, 150)
  28012. }
  28013. }
  28014. ),
  28015. t.exports = n
  28016. }
  28017. , {
  28018. "../analytics": 4
  28019. }],
  28020. 180: [function(e, t, i) {
  28021. "use strict";
  28022. function g(e) {
  28023. if (void 0 === e.parent)
  28024. return [e.data];
  28025. var t = g(e.parent);
  28026. return t.push(e.data),
  28027. t
  28028. }
  28029. function m(e) {
  28030. return e.toString()
  28031. }
  28032. function v(e, t) {
  28033. return e.f - t.f
  28034. }
  28035. var y = e("Set")
  28036. , A = e("heap")
  28037. , C = e("dict");
  28038. t.exports = function(e) {
  28039. void 0 === e.timeout && (e.timeout = 1 / 0);
  28040. var t = e.hash || m
  28041. , i = {
  28042. data: e.start,
  28043. g: 0,
  28044. h: e.heuristic(e.start)
  28045. }
  28046. , n = i;
  28047. i.f = i.h;
  28048. var r = new y
  28049. , o = new A(v)
  28050. , a = C();
  28051. o.push(i),
  28052. a.set(t(i.data), i);
  28053. for (var s = new Date; o.size(); ) {
  28054. if (new Date - s > e.timeout)
  28055. return {
  28056. status: "timeout",
  28057. cost: n.g,
  28058. path: g(n)
  28059. };
  28060. var l = o.pop();
  28061. if (a.delete(t(l.data)),
  28062. e.isEnd(l.data))
  28063. return {
  28064. status: "success",
  28065. cost: l.g,
  28066. path: g(l)
  28067. };
  28068. r.add(t(l.data));
  28069. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28070. var u = c[h];
  28071. if (!r.contains(t(u))) {
  28072. var d = l.g + e.distance(l.data, u)
  28073. , p = a.get(t(u))
  28074. , f = !1;
  28075. if (void 0 === p)
  28076. p = {
  28077. data: u
  28078. },
  28079. a.set(t(u), p);
  28080. else {
  28081. if (p.g < d)
  28082. continue;
  28083. f = !0
  28084. }
  28085. p.parent = l,
  28086. p.g = d,
  28087. p.h = e.heuristic(u),
  28088. p.f = d + p.h,
  28089. p.h < n.h && (n = p),
  28090. f ? o.heapify() : o.push(p)
  28091. }
  28092. }
  28093. }
  28094. return {
  28095. status: "noPath",
  28096. cost: n.g,
  28097. path: g(n)
  28098. }
  28099. }
  28100. }
  28101. , {
  28102. Set: 196,
  28103. dict: 210,
  28104. heap: 211
  28105. }],
  28106. 181: [function(i, n, e) {
  28107. (function(e) {
  28108. "use strict";
  28109. function s(e, t, i) {
  28110. function n() {
  28111. l.warn("Retrying ", t),
  28112. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28113. }
  28114. var r = function(e, t, i) {
  28115. var n = new XMLHttpRequest;
  28116. if (i && "withCredentials"in n)
  28117. n.open(e, t, i);
  28118. else if ("undefined" != typeof XDomainRequest)
  28119. (n = new XDomainRequest).open(e, t);
  28120. else {
  28121. if (i)
  28122. throw "Browser does not support CORS!";
  28123. n.open(e, t)
  28124. }
  28125. return n
  28126. }(e, t, !1);
  28127. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28128. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28129. i.responseType)
  28130. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28131. r.responseType = i.responseType;
  28132. else {
  28133. if ("image/jpeg" !== i.responseType)
  28134. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28135. r.responseType = "arraybuffer"
  28136. }
  28137. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28138. i.auth && r.setRequestHeader("Authorization", i.auth),
  28139. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28140. r.setRequestHeader("Content-Type", "application/json")),
  28141. "object" == typeof i.headers)
  28142. for (var o in i.headers)
  28143. r.setRequestHeader(o, i.headers[o]);
  28144. var a = $.Deferred();
  28145. return r.onreadystatechange = function(e) {
  28146. if (4 === this.readyState)
  28147. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28148. i.retries++,
  28149. setTimeout(n, 1e3);
  28150. else if (200 === this.status) {
  28151. var t = function(e, t) {
  28152. var i = e.response;
  28153. if ("json" === t && "object" != typeof i)
  28154. try {
  28155. i = JSON.parse(e.responseText)
  28156. } catch (e) {
  28157. return void a.reject({
  28158. error: "Failed parsing JSON"
  28159. })
  28160. }
  28161. else if ("image/jpeg" === t) {
  28162. var n = new Uint8Array(e.response)
  28163. , r = new Blob([n],{
  28164. type: "image/jpeg"
  28165. })
  28166. , o = URL.createObjectURL(r);
  28167. (i = new Image).src = o,
  28168. i.crossOrigin = "Anonymous",
  28169. i.onload = function() {
  28170. URL.revokeObjectURL(o)
  28171. }
  28172. }
  28173. return i
  28174. }(this, i.responseType);
  28175. a.resolve(t)
  28176. } else
  28177. a.reject(this)
  28178. }
  28179. ,
  28180. r.onprogress = function(e) {
  28181. a.notify(e)
  28182. }
  28183. ,
  28184. r.send(i.data),
  28185. a.promise()
  28186. }
  28187. function o(e, t) {
  28188. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28189. return t.headers && function(t) {
  28190. return Object.keys(t).sort().map(function(e) {
  28191. return {
  28192. key: e,
  28193. value: t[e]
  28194. }
  28195. })
  28196. }(t.headers).forEach(function(e) {
  28197. i += "__" + e.key + ":" + e.value
  28198. }),
  28199. i
  28200. }
  28201. var t = i("./logger")
  28202. , a = i("../ab")
  28203. , l = new t(e);
  28204. window.URL = window.URL || window.webkitURL,
  28205. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28206. window.DATA = window.DATA || {},
  28207. n.exports = {
  28208. get: function(e, t) {
  28209. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28210. if (n) {
  28211. var r = function(e, t) {
  28212. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28213. }(e, t);
  28214. if (r)
  28215. return r
  28216. }
  28217. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28218. n && function(e, t, i) {
  28219. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28220. }(e, t, i),
  28221. i
  28222. },
  28223. post: function(e, t) {
  28224. return s("POST", e, t)
  28225. },
  28226. patch: function(e, t) {
  28227. return s("PATCH", e, t)
  28228. },
  28229. getImage: function(e, t) {
  28230. function i() {
  28231. l.warn("Retrying ", e),
  28232. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28233. }
  28234. var n = $.Deferred()
  28235. , r = new Image
  28236. , o = this;
  28237. return e = a.changeIfImageOptimzing(e),
  28238. null != t || (t = 3),
  28239. r.onerror = function() {
  28240. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28241. }
  28242. ,
  28243. r.onload = function() {
  28244. n.resolve(r)
  28245. }
  28246. ,
  28247. r.crossOrigin = "anonymous",
  28248. r.src = e,
  28249. n
  28250. }
  28251. }
  28252. }
  28253. ).call(this, "/js/util/ajax.js")
  28254. }
  28255. , {
  28256. "../ab": 3,
  28257. "./logger": 189
  28258. }],
  28259. 182: [function(e, t, i) {
  28260. "use strict";
  28261. function n(e, t) {
  28262. var i = window.navigator.userAgent.match(e);
  28263. return i = i ? i[1].split(t) : [],
  28264. {
  28265. major: parseInt(i[0]) || 0,
  28266. minor: parseInt(i[1]) || 0,
  28267. patch: parseInt(i[2]) || 0
  28268. }
  28269. }
  28270. var r = e("../exception/DeviceMismatchException");
  28271. window.browser = t.exports = {
  28272. isFullscreen: function() {
  28273. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28274. },
  28275. supportsFullscreen: function() {
  28276. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28277. },
  28278. isPointerLocked: function() {
  28279. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28280. },
  28281. requestFullscreen: function(e, t) {
  28282. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28283. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28284. },
  28285. requestPointerLock: function() {
  28286. var e;
  28287. if (document.fullscreenElement)
  28288. e = document.fullscreenElement();
  28289. else if (document.mozFullscreenElement)
  28290. e = document.mozFullscreenElement();
  28291. else if (document.mozFullScreenElement)
  28292. e = document.mozFullScreenElement();
  28293. else {
  28294. if (!document.webkitFullscreenElement)
  28295. return;
  28296. e = document.webkitFullscreenElement()
  28297. }
  28298. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28299. e.requestPointerLock(),
  28300. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28301. },
  28302. exitPointerLock: function() {
  28303. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28304. document.exitPointerLock()
  28305. },
  28306. exitFullscreen: function() {
  28307. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28308. },
  28309. details: function() {
  28310. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28311. return e ? {
  28312. name: e[1],
  28313. version: parseInt(e[2]),
  28314. platform: navigator.platform
  28315. } : {}
  28316. },
  28317. is: function(e) {
  28318. return this.details() && this.details().name === e
  28319. },
  28320. inIframe: function() {
  28321. return window.parent !== window
  28322. },
  28323. aspectRatio: function() {
  28324. var e = $("#player").width() / $("#player").height();
  28325. return isFinite(e) ? e : 0
  28326. },
  28327. userAgent: function() {
  28328. return window.navigator.userAgent
  28329. },
  28330. isMobile: function() {
  28331. var e = navigator.userAgent || navigator.vendor || window.opera;
  28332. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  28333. },
  28334. isLandscape: function() {
  28335. return this.isMobile && 1 < this.aspectRatio()
  28336. },
  28337. isSmallScreen: function() {
  28338. return screen.width / window.devicePixelRatio < 240
  28339. },
  28340. detectIE: function() {
  28341. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28342. },
  28343. detectSafari: function() {
  28344. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28345. },
  28346. detectFirefox: function() {
  28347. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28348. },
  28349. detectChrome: function() {
  28350. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28351. },
  28352. detectOpera: function() {
  28353. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28354. },
  28355. detectIOS: function() {
  28356. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28357. },
  28358. detectIPad: function() {
  28359. var e = window.navigator.userAgent;
  28360. return /iPad/.test(e)
  28361. },
  28362. detectIPod: function() {
  28363. var e = window.navigator.userAgent;
  28364. return /iPod/.test(e)
  28365. },
  28366. detectIPhone: function() {
  28367. var e = window.navigator.userAgent;
  28368. return /iPhone/.test(e)
  28369. },
  28370. detectAndroid: function() {
  28371. return -1 !== window.navigator.userAgent.indexOf("Android")
  28372. },
  28373. detectAndroidMobile: function() {
  28374. var e = window.navigator.userAgent;
  28375. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28376. },
  28377. detectSamsungNative: function() {
  28378. var e = window.navigator.userAgent;
  28379. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28380. },
  28381. detectSamsungS6: function() {
  28382. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28383. },
  28384. detectHUAWEI5X: function() {
  28385. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28386. },
  28387. detectWebVR: function() {
  28388. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28389. },
  28390. getVRDisplay: function() {
  28391. var t = $.Deferred();
  28392. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28393. 1 <= e.length && t.resolve(e[0]),
  28394. t.reject(null)
  28395. }),
  28396. t) : t.reject(null)
  28397. },
  28398. iosVersion: function() {
  28399. if (!this.detectIOS())
  28400. throw new r("Did not detect an iDevice");
  28401. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28402. },
  28403. androidVersion: function() {
  28404. if (!this.detectAndroid())
  28405. throw new r("Did not detect an Android based device");
  28406. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28407. },
  28408. valueFromCookie: function(e, t) {
  28409. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28410. if (!i)
  28411. return t;
  28412. var n = i[1];
  28413. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28414. },
  28415. valueFromHash: function(e, t) {
  28416. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28417. if (!i)
  28418. return t;
  28419. var n = i[1];
  28420. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28421. }
  28422. }
  28423. }
  28424. , {
  28425. "../exception/DeviceMismatchException": 56
  28426. }],
  28427. 183: [function(i, n, e) {
  28428. (function(e) {
  28429. "use strict";
  28430. var o = i("../controls/serializer")
  28431. , a = i("../util/math")
  28432. , s = i("./browser")
  28433. , l = i("../enum/Viewmode")
  28434. , t = i("../util/logger")
  28435. , c = i("three")
  28436. , h = new t(e);
  28437. n.exports = {
  28438. getStartCameraOptions: function(e, t) {
  28439. var i = function(e) {
  28440. var t = s.valueFromHash("start", "")
  28441. , i = {};
  28442. if ("" !== t) {
  28443. h.debug("Start override found in parameters, trying to parse..."),
  28444. i = function(e) {
  28445. return o.deserialize(e)
  28446. }(t) || {};
  28447. var n = s.valueFromHash("tag", null);
  28448. n && (i.tag = n),
  28449. i.panoId && (i.pano = e.get(i.panoId))
  28450. }
  28451. return i
  28452. }(t);
  28453. if (0 < Object.keys(i).length)
  28454. return i;
  28455. if (e.heroImage)
  28456. i = function(e, t) {
  28457. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28458. return {};
  28459. var i = {}
  28460. , n = e.heroImage.metadata;
  28461. h.debug("Using start position from thumbnail image"),
  28462. i.position = n.camera_position,
  28463. i.quaternion = n.camera_quaternion;
  28464. try {
  28465. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28466. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28467. } catch (e) {
  28468. h.debug(e.message)
  28469. }
  28470. return i
  28471. }(e, t);
  28472. else if (window.DATA.camera_start) {
  28473. var n = window.DATA.camera_start;
  28474. try {
  28475. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28476. i.position = (new c.Vector3).fromArray(n.camera.position),
  28477. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28478. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28479. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28480. h.debug("Using camera_start"),
  28481. h.debug("Modeldata pano: ", i.pano.quaternion),
  28482. h.debug("Camera start pano: ", n.pano.quaternion)),
  28483. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28484. } catch (e) {
  28485. h.warn(e.message)
  28486. if(i.mode == "panorama" && !i.pano){
  28487. i.pano = t.list[0]
  28488. }
  28489. }
  28490. }
  28491. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28492. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28493. i.pano = t.findClosest(i.position) ,
  28494. i.quaternion = i.pano.quaternion),
  28495. 0 === Object.keys(i).length) {
  28496. var r = t.list[0];
  28497. r && (i.mode = l.PANORAMA,
  28498. i.pano = r,
  28499. i.position = r.position,
  28500. i.quaternion = r.quaternion,
  28501. h.info("Starting at 1st pano " + r.id))
  28502. }
  28503. return i.mode = i.mode || l.DOLLHOUSE,
  28504. i
  28505. }
  28506. }
  28507. }
  28508. ).call(this, "/js/util/camera.js")
  28509. }
  28510. , {
  28511. "../controls/serializer": 14,
  28512. "../enum/Viewmode": 51,
  28513. "../util/logger": 189,
  28514. "../util/math": 190,
  28515. "./browser": 182,
  28516. three: 217
  28517. }],
  28518. 184: [function(e, t, i) {
  28519. "use strict";
  28520. function r(e, t, i) {
  28521. var n = t
  28522. , r = i;
  28523. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28524. }
  28525. function o(e, t, i) {
  28526. var n = t
  28527. , r = i;
  28528. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28529. }
  28530. var a = e("./MathLight");
  28531. t.exports = {
  28532. clampVFOV: function(e, t, i, n) {
  28533. return t < r(e, i, n) ? o(t, i, n) : e
  28534. },
  28535. getHFOVForCamera: function(e, t, i) {
  28536. return r(e.fov, t, i)
  28537. },
  28538. getHFOVFromVFOV: r,
  28539. getVFOVFromHFOV: o
  28540. }
  28541. window.MathLight = t.exports
  28542. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28543. var prec = Math.pow(10, - (precision || 4));
  28544. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28545. if(e1.w){
  28546. return s1 && Math.abs(e1.w - e2.w) < prec
  28547. }else return s1
  28548. }
  28549. }
  28550. , {
  28551. "./MathLight": 176
  28552. }],
  28553. 185: [function(e, t, i) {
  28554. "use strict";
  28555. var a = e("three");
  28556. t.exports = {
  28557. delayOneFrame: function(e) {
  28558. window.setTimeout(e, 1)
  28559. },
  28560. normalizeUrl: function(e) {
  28561. return e.replace("https://", "http://")
  28562. },
  28563. domainFromUrl: function(e) {
  28564. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28565. return t ? t[3] : e
  28566. },
  28567. average: function(e, t) {
  28568. if (0 === e.length)
  28569. return null;
  28570. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28571. i += t ? e[r][t] : e[r],
  28572. n++
  28573. }
  28574. return i / n
  28575. },
  28576. countUnique: function(e) {
  28577. for (var t = {}, i = 0; i < e.length; i++)
  28578. t[e[i]] = 1 + (t[e[i]] || 0);
  28579. return Object.keys(t).length
  28580. },
  28581. averageVectors: function(e, t) {
  28582. var i = new a.Vector3;
  28583. if (0 === e.length)
  28584. return i;
  28585. for (var n = 0, r = 0; r < e.length; r++) {
  28586. var o = t ? e[r][t] : e[r];
  28587. i.add(o),
  28588. n++
  28589. }
  28590. return i.divideScalar(n)
  28591. },
  28592. equalLists: function(e, t) {
  28593. if (e.length !== t.length)
  28594. return !1;
  28595. for (var i = 0; i < e.length; i++)
  28596. if (e[i] !== t[i])
  28597. return !1;
  28598. return !0
  28599. },
  28600. lowerMedian: function(e, t) {
  28601. return 0 === e.length ? null : (t = t || 2,
  28602. e.sort(function(e, t) {
  28603. return e - t
  28604. }),
  28605. e[Math.floor(e.length / t)])
  28606. },
  28607. stableSort: function(e, n) {
  28608. return e.map(function(e, t) {
  28609. return {
  28610. value: e,
  28611. index: t
  28612. }
  28613. }).sort(function(e, t) {
  28614. var i = n(e.value, t.value);
  28615. return 0 !== i ? i : e.index - t.index
  28616. }).map(function(e) {
  28617. return e.value
  28618. })
  28619. },
  28620. filterAll: function(e, i) {
  28621. return e.filter(function(t) {
  28622. return i.every(function(e) {
  28623. return e(t)
  28624. })
  28625. })
  28626. },
  28627. formatDate: function(e) {
  28628. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28629. },
  28630. formatDatetime: function(e) {
  28631. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28632. },
  28633. randomString: function(e) {
  28634. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28635. t += i.charAt(Math.floor(Math.random() * i.length));
  28636. return t
  28637. },
  28638. uint8ToBase64: function(e, t) {
  28639. t && "number" == typeof t || (t = 8192);
  28640. for (var i = [], n = 0; n < e.length; n += t)
  28641. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28642. return btoa(i.join(""))
  28643. },
  28644. uuid4: function e(t) {
  28645. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28646. },
  28647. nth: function(e) {
  28648. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28649. },
  28650. extendObject: function(t, i) {
  28651. return Object.keys(i).forEach(function(e) {
  28652. t[e] = i[e]
  28653. }),
  28654. t
  28655. },
  28656. deepExtend: function e(t) {
  28657. t = t || {};
  28658. for (var i = 1; i < arguments.length; i++) {
  28659. var n = arguments[i];
  28660. if (n)
  28661. for (var r in n)
  28662. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28663. }
  28664. return t
  28665. },
  28666. inherit: function(e, t) {
  28667. e.prototype = Object.create(t.prototype),
  28668. e.prototype.constructor = e
  28669. },
  28670. extend: function(e, t) {
  28671. for (var i in t.prototype)
  28672. e.prototype[i] = t.prototype[i]
  28673. },
  28674. getVisiblePano : function(positions = [], panos, options={}){//add
  28675. var visiblePanos = [];
  28676. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  28677. panos.forEach((pano)=>{
  28678. if(!pano.isAligned())return;
  28679. var A = pano.position.clone();
  28680. var posB = options.posAtPanos[pano.id] || positions;
  28681. var posLength = posB.length
  28682. for(let i=0;i<posLength;i++){
  28683. var B = posB[i];
  28684. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  28685. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  28686. if (!o || !o.length){ //只要有一点可见,就算整体可见
  28687. visiblePanos.push(pano.id);
  28688. break;
  28689. }
  28690. }
  28691. })
  28692. return visiblePanos
  28693. }
  28694. ,
  28695. sortByScore : function(list, request, rank) {
  28696. var i = this.filterAll(list, request);
  28697. return 0 === i.length ? null : i = i.map(function(e) {
  28698. return {
  28699. item: e,
  28700. score: rank.reduce(function(t, i) {
  28701. return t + i(e);
  28702. }, 0)
  28703. };
  28704. }).sort(function(e, t) {
  28705. return t.score - e.score;
  28706. });
  28707. }
  28708. ,
  28709. getFileNameFromUrl:function(url){
  28710. return url.split('/').pop();
  28711. }
  28712. },
  28713. Math.sign = function(e) {
  28714. return e < 0 ? -1 : 1
  28715. }
  28716. window.common = t.exports
  28717. }
  28718. , {
  28719. three: 217
  28720. }],
  28721. 186: [function(e, t, i) {
  28722. "use strict";
  28723. var r = {
  28724. linearTween: function(e, t, i, n) {
  28725. return i * e / n + t
  28726. },
  28727. easeInQuad: function(e, t, i, n) {
  28728. return i * (e /= n) * e + t
  28729. },
  28730. easeOutQuad: function(e, t, i, n) {
  28731. return -i * (e /= n) * (e - 2) + t
  28732. },
  28733. easeInOutQuad: function(e, t, i, n) {
  28734. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28735. },
  28736. easeInCubic: function(e, t, i, n) {
  28737. return i * (e /= n) * e * e + t
  28738. },
  28739. easeOutCubic: function(e, t, i, n) {
  28740. return e /= n,
  28741. i * (--e * e * e + 1) + t
  28742. },
  28743. easeInOutCubic: function(e, t, i, n) {
  28744. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28745. },
  28746. easeInQuart: function(e, t, i, n) {
  28747. return i * (e /= n) * e * e * e + t
  28748. },
  28749. easeOutQuart: function(e, t, i, n) {
  28750. return e /= n,
  28751. -i * (--e * e * e * e - 1) + t
  28752. },
  28753. easeInOutQuart: function(e, t, i, n) {
  28754. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28755. },
  28756. easeInQuint: function(e, t, i, n) {
  28757. return i * (e /= n) * e * e * e * e + t
  28758. },
  28759. easeOutQuint: function(e, t, i, n) {
  28760. return e /= n,
  28761. i * (--e * e * e * e * e + 1) + t
  28762. },
  28763. easeInOutQuint: function(e, t, i, n) {
  28764. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28765. },
  28766. easeInSine: function(e, t, i, n) {
  28767. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28768. },
  28769. easeOutSine: function(e, t, i, n) {
  28770. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28771. },
  28772. easeInOutSine: function(e, t, i, n) {
  28773. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28774. },
  28775. easeInExpo: function(e, t, i, n) {
  28776. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28777. },
  28778. easeOutExpo: function(e, t, i, n) {
  28779. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28780. },
  28781. easeInOutExpo: function(e, t, i, n) {
  28782. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28783. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28784. },
  28785. easeInCirc: function(e, t, i, n) {
  28786. return e /= n,
  28787. -i * (Math.sqrt(1 - e * e) - 1) + t
  28788. },
  28789. easeOutCirc: function(e, t, i, n) {
  28790. return e /= n,
  28791. e--,
  28792. i * Math.sqrt(1 - e * e) + t
  28793. },
  28794. easeInOutCirc: function(e, t, i, n) {
  28795. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28796. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28797. },
  28798. easeInElastic: function(e, t, i, n) {
  28799. var r = 1.70158
  28800. , o = 0
  28801. , a = i;
  28802. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28803. r = a < Math.abs(i) ? (a = i,
  28804. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28805. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28806. },
  28807. easeOutElastic: function(e, t, i, n) {
  28808. var r = 1.70158
  28809. , o = 0
  28810. , a = i;
  28811. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28812. r = a < Math.abs(i) ? (a = i,
  28813. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28814. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28815. },
  28816. easeInOutElastic: function(e, t, i, n) {
  28817. var r = 1.70158
  28818. , o = 0
  28819. , a = i;
  28820. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28821. r = a < Math.abs(i) ? (a = i,
  28822. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28823. 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)
  28824. },
  28825. easeInBack: function(e, t, i, n, r) {
  28826. return void 0 === r && (r = 1.70158),
  28827. i * (e /= n) * e * ((r + 1) * e - r) + t
  28828. },
  28829. easeOutBack: function(e, t, i, n, r) {
  28830. return void 0 === r && (r = 1.70158),
  28831. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28832. },
  28833. easeInOutBack: function(e, t, i, n, r) {
  28834. return void 0 === r && (r = 1.70158),
  28835. (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
  28836. },
  28837. easeOutBounce: function(e, t, i, n) {
  28838. 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
  28839. },
  28840. easeInBounce: function(e, t, i, n) {
  28841. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28842. },
  28843. easeInOutBounce: function(e, t, i, n) {
  28844. 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
  28845. }
  28846. };
  28847. window.easing = t.exports = r
  28848. }
  28849. , {}],
  28850. 187: [function(e, t, i) {
  28851. "use strict";
  28852. function n() {
  28853. this.events = [],
  28854. this.valid = !1
  28855. }
  28856. var r = e("../enum/Joystick");
  28857. n.prototype.push = function(e, t) {
  28858. this.events.push({
  28859. direction: e,
  28860. pano: t
  28861. }),
  28862. this.valid = !0
  28863. }
  28864. ,
  28865. n.prototype.pop = function(e) {
  28866. var t = this.events.pop();
  28867. return this.events.length < 1 && (this.valid = !1),
  28868. t
  28869. }
  28870. ,
  28871. n.prototype.peek = function() {
  28872. return this.events.length ? this.events[this.events.length - 1] : {
  28873. direction: null,
  28874. pano: null
  28875. }
  28876. }
  28877. ,
  28878. n.prototype.invalidate = function() {
  28879. this.events = [],
  28880. this.valid = !1
  28881. }
  28882. ,
  28883. n.prototype.reversePano = function(e) {
  28884. if (!this.valid)
  28885. return null;
  28886. var t = this.peek();
  28887. return r.opposite(e) === t.direction ? (this.pop(),
  28888. t.pano) : null
  28889. }
  28890. ,
  28891. t.exports = n
  28892. }
  28893. , {
  28894. "../enum/Joystick": 29
  28895. }],
  28896. 188: [function(e, t, i) {
  28897. "use strict";
  28898. t.exports = {
  28899. vector: function(t, i) {
  28900. var n = t.clone();
  28901. return i = i.clone(),
  28902. function(e) {
  28903. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28904. }
  28905. },
  28906. quaternion: function(t, i) {
  28907. var n = t.clone();
  28908. return function(e) {
  28909. t.copy(n).slerp(i, e)
  28910. }
  28911. },
  28912. property: function(t, i, n, r) {
  28913. var o = t[i];
  28914. return function(e) {
  28915. t[i] = o * (1 - e) + n * e,
  28916. r && r(t[i])
  28917. }
  28918. },
  28919. uniform: function(t, i, n) {
  28920. var r = t.material.uniforms[i].value;
  28921. return function(e) {
  28922. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28923. }
  28924. },
  28925. matrix4: function(o, a) {
  28926. var s = o.clone();
  28927. return function(e) {
  28928. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28929. t[r] = i[r] * (1 - e) + n[r] * e
  28930. }
  28931. },
  28932. allUniforms: function(e, t, i) {
  28933. var n = e.map(function(e) {
  28934. return this.uniform(e, t, i)
  28935. }
  28936. .bind(this));
  28937. return function(t) {
  28938. n.forEach(function(e) {
  28939. e(t)
  28940. })
  28941. }
  28942. }
  28943. }
  28944. }
  28945. , {}],
  28946. 189: [function(e, t, i) {
  28947. "use strict";
  28948. function h(n) {
  28949. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28950. if (h.consoleEnabled) {
  28951. var l = function(e) {
  28952. $("#debug-console").append("<p>" + e + "</p>"),
  28953. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28954. };
  28955. e = function(e) {
  28956. l(Array.prototype.slice.call(arguments).join(" "))
  28957. }
  28958. ,
  28959. t = function(e) {
  28960. l(Array.prototype.slice.call(arguments).join(" "))
  28961. }
  28962. ,
  28963. i = function(e) {
  28964. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28965. }
  28966. ,
  28967. r = function(e) {
  28968. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28969. }
  28970. } else
  28971. console.log ? (e = console.log,
  28972. t = console.info ? console.info : console.log,
  28973. i = console.warn ? console.warn : console.log,
  28974. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28975. ;
  28976. function c(e) {
  28977. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28978. }
  28979. return {
  28980. debug: function() {
  28981. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28982. },
  28983. info: function() {
  28984. h.level >= h.levels.info && t.apply(console, c(arguments))
  28985. },
  28986. warn: function() {
  28987. (function(e, t) {
  28988. if (u) {
  28989. var i = Array.prototype.slice.call(e).join(" ");
  28990. u.captureMessage(i, {
  28991. level: t,
  28992. path: n,
  28993. timestamp: h.timestamp()
  28994. })
  28995. }
  28996. }
  28997. )(arguments, "warn"),
  28998. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28999. },
  29000. error: function() {
  29001. (function(e, t) {
  29002. if (u) {
  29003. var i = Array.prototype.slice.call(e).join(" ");
  29004. u.captureException(new Error(i), {
  29005. level: t,
  29006. path: n,
  29007. timestamp: h.timestamp()
  29008. })
  29009. }
  29010. }
  29011. )(arguments, "error"),
  29012. h.level >= h.levels.error && r.apply(console, c(arguments))
  29013. },
  29014. v3str: function(e, t) {
  29015. var i = void 0 === t ? 2 : t;
  29016. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29017. },
  29018. eulstr: function(e, t) {
  29019. var i = void 0 === t ? 2 : t;
  29020. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29021. },
  29022. time: function(e) {
  29023. h.level >= h.levels.debug && (s[e] = Date.now())
  29024. },
  29025. timeEnd: function(e) {
  29026. if (h.level >= h.levels.debug) {
  29027. var t = s[e];
  29028. if (!t)
  29029. return;
  29030. var i = (Date.now() - t) / 1e3;
  29031. this.debug(e, i + "s")
  29032. }
  29033. }
  29034. }
  29035. }
  29036. var u = window.Raven;
  29037. h.timestamp = function() {
  29038. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29039. }
  29040. ,
  29041. h.level = (h.levels = {
  29042. debug: 3,
  29043. info: 2,
  29044. warn: 1,
  29045. error: 0
  29046. }).info,
  29047. t.exports = h
  29048. }
  29049. , {}],
  29050. 190: [function(e, t, i) {
  29051. "use strict";
  29052. var o = e("three")
  29053. , r = e("../enum/GLCubeFaces");
  29054. e("../constants");
  29055. t.exports = {
  29056. convertVisionVector: function(e) {
  29057. return new o.Vector3(e.x,e.z,-e.y)
  29058. },
  29059. convertVisionQuaternion: function(e) {
  29060. 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)))
  29061. },
  29062. convertWorkshopVector: function(e) {
  29063. return new o.Vector3(-e.x,e.y,e.z)
  29064. },
  29065. convertWorkshopQuaternion: function(e) {
  29066. 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))
  29067. },
  29068. convertWorkshopPanoramaQuaternion: function(e) {
  29069. 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)))
  29070. },
  29071. convertWorkshopOrthoZoom: function(e) {
  29072. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29073. },
  29074. toPrecision: function(e, t) {
  29075. function i(e, t) {
  29076. var i = Math.pow(10, t);
  29077. return Math.round(e * i) / i
  29078. }
  29079. if (e instanceof Array) {
  29080. for (var n = 0; n < e.length; n++)
  29081. e[n] = i(e[n], t);
  29082. return e
  29083. }
  29084. return i(e, t)
  29085. },
  29086. isEmptyQuaternion: function(e) {
  29087. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29088. },
  29089. projectPositionToCanvas: function(e, t, i) {
  29090. (i = i || new o.Vector3).copy(e);
  29091. var n = .5 * $("#player").width()
  29092. , r = .5 * $("#player").height();
  29093. return i.project(t),
  29094. i.x = i.x * n + n,
  29095. i.y = -i.y * r + r,
  29096. i
  29097. },
  29098. convertScreenPositionToNDC: function(e, t, i) {
  29099. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29100. i.y = -t / $("#player").height() * 2 + 1,
  29101. i
  29102. },
  29103. constrainedTurn: function(e) {
  29104. var t = e % (2 * Math.PI);
  29105. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29106. },
  29107. getFOVDotThreshold: function(e) {
  29108. return Math.cos(o.Math.degToRad(e / 2))
  29109. },
  29110. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29111. switch (e) {
  29112. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29113. i.set(1, t.y, t.x);
  29114. break;
  29115. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29116. i.set(-1, t.y, -t.x);
  29117. break;
  29118. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29119. i.set(-t.x, 1, -t.y);
  29120. break;
  29121. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29122. i.set(-t.x, -1, t.y);
  29123. break;
  29124. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29125. i.set(-t.x, t.y, 1);
  29126. break;
  29127. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29128. i.set(t.x, t.y, -1)
  29129. }
  29130. n && i.normalize()
  29131. },
  29132. //add:
  29133. getPos2d : function(point, camera, dom){
  29134. var camera = camera ;
  29135. var dom = dom;
  29136. 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);
  29137. var x,y;
  29138. x = (pos.x + 1) / 2 * dom.clientWidth;
  29139. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29140. var inSight = x <= dom.clientWidth && x >= 0
  29141. && y <= dom.clientHeight && y >= 0
  29142. return {
  29143. pos: new THREE.Vector2(x,y),
  29144. vector: pos,
  29145. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29146. inSight : inSight //在屏幕范围内可见
  29147. };
  29148. },
  29149. getDirByLonLat: function(lon, lat) {
  29150. var dir = new THREE.Vector3();
  29151. var phi = THREE.Math.degToRad(90 - lat);
  29152. var theta = THREE.Math.degToRad(lon);
  29153. dir.x = Math.sin(phi) * Math.cos(theta);
  29154. dir.y = Math.cos(phi);
  29155. dir.z = Math.sin(phi) * Math.sin(theta);
  29156. return dir.negate();
  29157. }
  29158. }
  29159. window.math = t.exports
  29160. }
  29161. , {
  29162. "../constants": 8,
  29163. "../enum/GLCubeFaces": 25,
  29164. three: 217
  29165. }],
  29166. 191: [function(e, t, i) {
  29167. "use strict";
  29168. function o(e) {
  29169. return r[e]
  29170. }
  29171. var n = e("../enum/GLCubeFaces")
  29172. , a = [0, 1, 2, 3, 4, 5]
  29173. , r = {
  29174. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29175. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29176. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29177. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29178. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29179. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29180. };
  29181. t.exports = {
  29182. mapFaceToCubemapFace: o,
  29183. getCubemapUrls: function(i, n, r) {
  29184. return a.map(function(e, t) {
  29185. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29186. }
  29187. .bind(this))
  29188. }
  29189. }
  29190. }
  29191. , {
  29192. "../enum/GLCubeFaces": 25
  29193. }],
  29194. 192: [function(e, t, i) {
  29195. "use strict";
  29196. t.exports = {
  29197. captureErrors: function(e, t, i) {
  29198. if ("Raven"in window) {
  29199. Raven.config(e, t).install(),
  29200. i && Raven.setTagsContext(i);
  29201. var n = console.warn
  29202. , r = console.error;
  29203. console.warn = function() {
  29204. var e = Array.prototype.slice.call(arguments);
  29205. Raven.captureMessage(e.join(" "), {
  29206. level: "warning"
  29207. }),
  29208. n.apply(console, e)
  29209. }
  29210. ,
  29211. console.error = function() {
  29212. var e = Array.prototype.slice.call(arguments);
  29213. Raven.captureException(new Error(e.join(" ")), {
  29214. level: "error"
  29215. }),
  29216. r.apply(console, e)
  29217. }
  29218. } else
  29219. console.error("Raven not found, not capturing errors.")
  29220. }
  29221. }
  29222. }
  29223. , {}],
  29224. 193: [function(c, h, e) {
  29225. (function(e) {
  29226. "use strict";
  29227. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29228. getAuthorizationHeader: function() {
  29229. var e = n.valueFromHash("auth");
  29230. if (e)
  29231. return e.replace(",", " ");
  29232. var t = n.valueFromCookie("token");
  29233. return t ? "Token " + t : null
  29234. },
  29235. parseSidUrl: function(e) {
  29236. var t, i;
  29237. if (t = g_Prefix,
  29238. (e = e || "").match(/^https?/)) {
  29239. o.parse(e);
  29240. t = g_Prefix,
  29241. i = e
  29242. } else
  29243. i = (t = g_Prefix) + "data/" + e;
  29244. return {
  29245. urlBase: t,
  29246. urlModel: i,
  29247. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29248. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29249. }
  29250. },
  29251. getModelIDFromQueryString: function() {
  29252. return n.valueFromHash("model") || n.valueFromHash("m")
  29253. },
  29254. /* normalizeModeldata: function(e, i) {
  29255. e = JSON.parse(JSON.stringify(e));
  29256. var n = null;
  29257. if (e.images.forEach(function(t) {
  29258. if (t.metadata) {
  29259. if ("string" == typeof t.metadata)
  29260. try {
  29261. t.metadata = JSON.parse(t.metadata)
  29262. } catch (e) {
  29263. s.warn("Unable to parse image metadata"),
  29264. t.metadata = null
  29265. }
  29266. else
  29267. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29268. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29269. 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)),
  29270. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29271. t.metadata.zoom = t.metadata.zoom || 1),
  29272. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29273. }
  29274. }),
  29275. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29276. var t = {};
  29277. t.pano = {
  29278. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29279. position: i.convertWorkshopVector(n.scan_position),
  29280. uuid: n.scan_id
  29281. },
  29282. t.camera = {
  29283. quaternion: n.camera_quaternion,
  29284. position: n.camera_position
  29285. },
  29286. e.startPano = t
  29287. }
  29288. return e
  29289. }, */
  29290. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29291. e = JSON.parse(JSON.stringify(e));
  29292. var i = null;
  29293. var deal = function(n) {
  29294. if(!n.metadata) return;
  29295. if ("string" == typeof n.metadata)
  29296. try {
  29297. n.metadata = JSON.parse(n.metadata)
  29298. } catch (e) {
  29299. s.warn("Unable to parse image metadata"),
  29300. n.metadata = null
  29301. }
  29302. else{
  29303. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29304. }
  29305. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29306. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29307. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29308. }else{
  29309. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29310. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29311. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29312. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29313. }
  29314. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29315. }
  29316. //改
  29317. e.images.forEach(info=>{
  29318. if(info.locations){
  29319. info.locations.forEach(a=>deal(a))
  29320. }else{
  29321. deal(info)
  29322. }
  29323. })
  29324. //icon初始视角的:
  29325. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29326. var n = {};
  29327. n.pano = {
  29328. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29329. position: t.convertWorkshopVector(i.scan_position),
  29330. uuid: i.scan_id
  29331. },
  29332. n.camera = {
  29333. quaternion: i.camera_quaternion,
  29334. position: i.camera_position
  29335. },
  29336. e.startPano = n
  29337. }
  29338. return e
  29339. },
  29340. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29341. function(e) {
  29342. if (!e)
  29343. throw new Error("Vision version is required");
  29344. var t = i.exec(e);
  29345. if (null === t)
  29346. throw new Error("String is not a vision version: " + e);
  29347. return parseInt(t[1])
  29348. }
  29349. ),
  29350. modelDataPromisesTiles: function(e) {
  29351. var t = e.vision_version || window.DATA.vision_version;
  29352. if (t)
  29353. try {
  29354. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29355. } catch (e) {
  29356. s.warn("Invalid vision version: " + t)
  29357. }
  29358. return !1
  29359. }
  29360. };
  29361. h.exports = l
  29362. }
  29363. ).call(this, "/js/util/showcase.js")
  29364. }
  29365. , {
  29366. "../constants": 8,
  29367. "./browser": 182,
  29368. "./logger": 189,
  29369. three: 217,
  29370. url: 208
  29371. }],
  29372. 194: [function(e, t, i) {
  29373. "use strict";
  29374. var r = e("../util/ajax")
  29375. , o = e("three")
  29376. , a = e("../settings")
  29377. , s = {};
  29378. t.exports = {
  29379. load: function(e, t, i) {
  29380. var n = s[e];
  29381. return n ? t && setTimeout(function() {
  29382. t(n)
  29383. }, 1) : (n = new o.Texture,
  29384. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29385. n.magFilter = o.LinearFilter,
  29386. n.generateMipmaps = !1),
  29387. n.sourceFile = e,
  29388. s[e] = n,
  29389. r.getImage(e).then(function(e) {
  29390. n.image = e,
  29391. n.needsUpdate = !0,
  29392. t && t(n)
  29393. }).fail(i)),
  29394. n
  29395. },
  29396. loadBase64: function(e, t) {
  29397. t = t || "png";
  29398. var i = new o.Texture;
  29399. return i.image = document.createElement("img"),
  29400. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29401. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29402. i.magFilter = o.LinearFilter,
  29403. i.generateMipmaps = !1),
  29404. i.needsUpdate = !0,
  29405. i
  29406. },
  29407. isLoaded: function(e) {
  29408. return !!s[e]
  29409. }
  29410. }
  29411. window.Texture = t.exports
  29412. }
  29413. , {
  29414. "../settings": 166,
  29415. "../util/ajax": 181,
  29416. three: 217
  29417. }],
  29418. 195: [function(e, t, i) {
  29419. "use strict";
  29420. var l = e("./easing");
  29421. window.transitions = t.exports = {
  29422. globalDone: null,
  29423. funcs: [],
  29424. counter: 0,
  29425. uniqueID: 0,
  29426. start: function(e, t, i, n, r, o, a) {
  29427. return n = n || 0,
  29428. this.funcs.push({
  29429. func: e,
  29430. current: -n * Math.abs(t),
  29431. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29432. done: i,
  29433. easing: r || l.linearTween,
  29434. cycling: t < 0,
  29435. running: !0,
  29436. debug: n < 0,
  29437. name: o || "T" + this.counter,
  29438. id: void 0 === a ? this.counter : a,
  29439. paused: !1
  29440. }),
  29441. e(0, 16),
  29442. this.counter += 1,
  29443. e
  29444. },
  29445. trigger: function(e) {
  29446. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29447. , i = e.func || function() {}
  29448. , n = void 0 === e.duration ? 0 : e.duration;
  29449. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29450. var r = e.done || null
  29451. , o = e.easing || l.linearTween
  29452. , a = e.name || "R" + this.counter
  29453. , s = void 0 === e.id ? this.counter : e.id;
  29454. return this.start(i, n, r, t, o, a, s)
  29455. },
  29456. setTimeout: function(e, t, i) {
  29457. var n = void 0 === i ? this.counter : i;
  29458. return this.trigger({
  29459. done: e,
  29460. duration: void 0 === t ? 0 : t,
  29461. name: "O" + this.counter,
  29462. id: n
  29463. })
  29464. },
  29465. pause: function() {
  29466. this.paused = !0
  29467. },
  29468. resume: function() {
  29469. this.paused = !1
  29470. },
  29471. update: function(n) {
  29472. this.funcs.forEach(function(e) {
  29473. if (!(e.paused || (e.current += 1e3 * n,
  29474. e.current < 0)))
  29475. if (e.current >= e.duration && !e.cycling) {
  29476. var t = e.easing(1, 0, 1, 1);
  29477. e.func(t, 1e3 * n),
  29478. e.done && e.done(),
  29479. e.running = !1
  29480. } else {
  29481. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29482. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29483. e.running = !1)
  29484. }
  29485. });
  29486. var e = this.funcs.length;
  29487. this.funcs = this.funcs.filter(function(e) {
  29488. return e.running
  29489. });
  29490. var t = this.funcs.length;
  29491. if (0 < e && 0 === t && this.globalDone) {
  29492. var i = this.globalDone;
  29493. this.globalDone = null,
  29494. i()
  29495. }
  29496. },
  29497. adjustSpeed: function(e, t) {
  29498. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29499. var r = i[n];
  29500. r.duration /= t,
  29501. r.current /= t
  29502. }
  29503. },
  29504. getById: function(t) {
  29505. return this.funcs.filter(function(e) {
  29506. return t === e.id
  29507. })
  29508. },
  29509. get: function(e) {
  29510. for (var t = 0; t < this.funcs.length; t += 1)
  29511. if (this.funcs[t].func === e)
  29512. return this.funcs[t];
  29513. return null
  29514. },
  29515. isRunning: function(e) {
  29516. var t = this.get(e);
  29517. return null !== t && t.running
  29518. },
  29519. countActive: function() {
  29520. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29521. e += this.funcs[t].running;
  29522. return e
  29523. },
  29524. listActive: function() {
  29525. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29526. this.funcs[t].running && e.push(this.funcs[t].name);
  29527. return e
  29528. },
  29529. done: function(e) {
  29530. this.globalDone = e
  29531. },
  29532. cancelById: function(e) {
  29533. var t = void 0 === e ? 0 : e;
  29534. this.funcs = this.funcs.filter(function(e) {
  29535. return e.id !== t
  29536. })
  29537. },
  29538. cancel: function(t) {
  29539. this.funcs = this.funcs.filter(function(e) {
  29540. return e.func !== t
  29541. })
  29542. },
  29543. getUniqueId: function() {
  29544. return this.uniqueID -= 1,
  29545. this.uniqueID
  29546. }
  29547. }
  29548. }
  29549. , {
  29550. "./easing": 186
  29551. }],
  29552. 196: [function(e, t, i) {
  29553. function n(e) {
  29554. if (this.set = {},
  29555. this.infContains = function() {
  29556. return !0
  29557. }
  29558. ,
  29559. "object" == typeof e)
  29560. if (e instanceof Array)
  29561. for (var t = 0; t < e.length; t++)
  29562. this.set[e[t]] = !0;
  29563. else
  29564. this.set = e;
  29565. else if ("function" == typeof e)
  29566. this.infContains = e;
  29567. else if (void 0 !== e)
  29568. throw new Error("set must be either an array or an object.")
  29569. }
  29570. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29571. return !!this.set[e]
  29572. }
  29573. ,
  29574. n.prototype.add = function(e) {
  29575. if (1 == arguments.length)
  29576. this.set[e] = !0;
  29577. else
  29578. for (var t = 0; t < arguments.length; t++)
  29579. this.set[arguments[t]] = !0
  29580. }
  29581. ,
  29582. n.prototype.addAll = function(e) {
  29583. if ("object" != typeof e && !(e instanceof Array))
  29584. throw new Error("arr must be an array.");
  29585. for (var t = 0; t < e.length; t++)
  29586. this.add(e[t])
  29587. }
  29588. ,
  29589. n.prototype.delete = n.prototype.remove = function(e) {
  29590. if (1 == arguments.length)
  29591. delete this.set[e];
  29592. else
  29593. for (var t = 0; t < arguments.length; t++)
  29594. delete this.set[arguments[t]]
  29595. }
  29596. ,
  29597. n.prototype.clear = function() {
  29598. this.set = {}
  29599. }
  29600. ,
  29601. n.prototype.size = function() {
  29602. return Object.keys(this.set).length
  29603. }
  29604. ,
  29605. n.prototype.toString = function() {
  29606. return "{" + Object.keys(this.set).toString() + "}"
  29607. }
  29608. ,
  29609. n.prototype["*values"] = n.prototype.toArray = function() {
  29610. return void 0 === this.set ? [] : Object.keys(this.set)
  29611. }
  29612. }
  29613. , {}],
  29614. 197: [function(e, t, i) {}
  29615. , {}],
  29616. 198: [function(N, e, F) {
  29617. (function(e) {
  29618. "use strict";
  29619. function i() {
  29620. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29621. }
  29622. function o(e, t) {
  29623. if (i() < t)
  29624. throw new RangeError("Invalid typed array length");
  29625. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29626. e.length = t),
  29627. e
  29628. }
  29629. function u(e, t, i) {
  29630. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29631. return new u(e,t,i);
  29632. if ("number" != typeof e)
  29633. return n(this, e, t, i);
  29634. if ("string" == typeof t)
  29635. throw new Error("If encoding is specified then the first argument must be a string");
  29636. return a(this, e)
  29637. }
  29638. function n(e, t, i, n) {
  29639. if ("number" == typeof t)
  29640. throw new TypeError('"value" argument must not be a number');
  29641. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29642. if (t.byteLength,
  29643. i < 0 || t.byteLength < i)
  29644. throw new RangeError("'offset' is out of bounds");
  29645. if (t.byteLength < i + (n || 0))
  29646. throw new RangeError("'length' is out of bounds");
  29647. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29648. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29649. e
  29650. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29651. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29652. !u.isEncoding(i))
  29653. throw new TypeError('"encoding" must be a valid string encoding');
  29654. var n = 0 | c(t, i)
  29655. , r = (e = o(e, n)).write(t, i);
  29656. return r !== n && (e = e.slice(0, r)),
  29657. e
  29658. }(e, t, i) : function(e, t) {
  29659. if (u.isBuffer(t)) {
  29660. var i = 0 | l(t.length);
  29661. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29662. e
  29663. }
  29664. if (t) {
  29665. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29666. return "number" != typeof t.length || function(e) {
  29667. return e != e
  29668. }(t.length) ? o(e, 0) : s(e, t);
  29669. if ("Buffer" === t.type && L(t.data))
  29670. return s(e, t.data)
  29671. }
  29672. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29673. }(e, t)
  29674. }
  29675. function r(e) {
  29676. if ("number" != typeof e)
  29677. throw new TypeError('"size" argument must be a number');
  29678. if (e < 0)
  29679. throw new RangeError('"size" argument must not be negative')
  29680. }
  29681. function a(e, t) {
  29682. if (r(t),
  29683. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29684. !u.TYPED_ARRAY_SUPPORT)
  29685. for (var i = 0; i < t; ++i)
  29686. e[i] = 0;
  29687. return e
  29688. }
  29689. function s(e, t) {
  29690. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29691. e = o(e, i);
  29692. for (var n = 0; n < i; n += 1)
  29693. e[n] = 255 & t[n];
  29694. return e
  29695. }
  29696. function l(e) {
  29697. if (e >= i())
  29698. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29699. return 0 | e
  29700. }
  29701. function c(e, t) {
  29702. if (u.isBuffer(e))
  29703. return e.length;
  29704. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29705. return e.byteLength;
  29706. "string" != typeof e && (e = "" + e);
  29707. var i = e.length;
  29708. if (0 === i)
  29709. return 0;
  29710. for (var n = !1; ; )
  29711. switch (t) {
  29712. case "ascii":
  29713. case "latin1":
  29714. case "binary":
  29715. return i;
  29716. case "utf8":
  29717. case "utf-8":
  29718. case void 0:
  29719. return S(e).length;
  29720. case "ucs2":
  29721. case "ucs-2":
  29722. case "utf16le":
  29723. case "utf-16le":
  29724. return 2 * i;
  29725. case "hex":
  29726. return i >>> 1;
  29727. case "base64":
  29728. return M(e).length;
  29729. default:
  29730. if (n)
  29731. return S(e).length;
  29732. t = ("" + t).toLowerCase(),
  29733. n = !0
  29734. }
  29735. }
  29736. function h(e, t, i) {
  29737. var n = e[t];
  29738. e[t] = e[i],
  29739. e[i] = n
  29740. }
  29741. function d(e, t, i, n, r) {
  29742. if (0 === e.length)
  29743. return -1;
  29744. if ("string" == typeof i ? (n = i,
  29745. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29746. i = +i,
  29747. isNaN(i) && (i = r ? 0 : e.length - 1),
  29748. i < 0 && (i = e.length + i),
  29749. i >= e.length) {
  29750. if (r)
  29751. return -1;
  29752. i = e.length - 1
  29753. } else if (i < 0) {
  29754. if (!r)
  29755. return -1;
  29756. i = 0
  29757. }
  29758. if ("string" == typeof t && (t = u.from(t, n)),
  29759. u.isBuffer(t))
  29760. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29761. if ("number" == typeof t)
  29762. return t &= 255,
  29763. 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);
  29764. throw new TypeError("val must be string, number or Buffer")
  29765. }
  29766. function p(e, t, i, n, r) {
  29767. function o(e, t) {
  29768. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29769. }
  29770. var a, s = 1, l = e.length, c = t.length;
  29771. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29772. if (e.length < 2 || t.length < 2)
  29773. return -1;
  29774. l /= s = 2,
  29775. c /= 2,
  29776. i /= 2
  29777. }
  29778. if (r) {
  29779. var h = -1;
  29780. for (a = i; a < l; a++)
  29781. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29782. if (-1 === h && (h = a),
  29783. a - h + 1 === c)
  29784. return h * s
  29785. } else
  29786. -1 !== h && (a -= a - h),
  29787. h = -1
  29788. } else
  29789. for (l < i + c && (i = l - c),
  29790. a = i; 0 <= a; a--) {
  29791. for (var u = !0, d = 0; d < c; d++)
  29792. if (o(e, a + d) !== o(t, d)) {
  29793. u = !1;
  29794. break
  29795. }
  29796. if (u)
  29797. return a
  29798. }
  29799. return -1
  29800. }
  29801. function g(e, t, i, n) {
  29802. i = Number(i) || 0;
  29803. var r = e.length - i;
  29804. n ? r < (n = Number(n)) && (n = r) : n = r;
  29805. var o = t.length;
  29806. if (o % 2 != 0)
  29807. throw new TypeError("Invalid hex string");
  29808. o / 2 < n && (n = o / 2);
  29809. for (var a = 0; a < n; ++a) {
  29810. var s = parseInt(t.substr(2 * a, 2), 16);
  29811. if (isNaN(s))
  29812. return a;
  29813. e[i + a] = s
  29814. }
  29815. return a
  29816. }
  29817. function m(e, t, i, n) {
  29818. return R(function(e) {
  29819. for (var t = [], i = 0; i < e.length; ++i)
  29820. t.push(255 & e.charCodeAt(i));
  29821. return t
  29822. }(t), e, i, n)
  29823. }
  29824. function f(e, t, i) {
  29825. i = Math.min(e.length, i);
  29826. for (var n = [], r = t; r < i; ) {
  29827. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29828. if (r + u <= i)
  29829. switch (u) {
  29830. case 1:
  29831. c < 128 && (h = c);
  29832. break;
  29833. case 2:
  29834. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29835. break;
  29836. case 3:
  29837. o = e[r + 1],
  29838. a = e[r + 2],
  29839. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29840. break;
  29841. case 4:
  29842. o = e[r + 1],
  29843. a = e[r + 2],
  29844. s = e[r + 3],
  29845. 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))
  29846. }
  29847. null === h ? (h = 65533,
  29848. u = 1) : 65535 < h && (h -= 65536,
  29849. n.push(h >>> 10 & 1023 | 55296),
  29850. h = 56320 | 1023 & h),
  29851. n.push(h),
  29852. r += u
  29853. }
  29854. return function(e) {
  29855. var t = e.length;
  29856. if (t <= D)
  29857. return String.fromCharCode.apply(String, e);
  29858. for (var i = "", n = 0; n < t; )
  29859. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29860. return i
  29861. }(n)
  29862. }
  29863. function v(e, t, i) {
  29864. var n = "";
  29865. i = Math.min(e.length, i);
  29866. for (var r = t; r < i; ++r)
  29867. n += String.fromCharCode(127 & e[r]);
  29868. return n
  29869. }
  29870. function y(e, t, i) {
  29871. var n = "";
  29872. i = Math.min(e.length, i);
  29873. for (var r = t; r < i; ++r)
  29874. n += String.fromCharCode(e[r]);
  29875. return n
  29876. }
  29877. function A(e, t, i) {
  29878. var n, r = e.length;
  29879. (!t || t < 0) && (t = 0),
  29880. (!i || i < 0 || r < i) && (i = r);
  29881. for (var o = "", a = t; a < i; ++a)
  29882. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29883. return o
  29884. }
  29885. function C(e, t, i) {
  29886. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29887. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29888. return r
  29889. }
  29890. function I(e, t, i) {
  29891. if (e % 1 != 0 || e < 0)
  29892. throw new RangeError("offset is not uint");
  29893. if (i < e + t)
  29894. throw new RangeError("Trying to access beyond buffer length")
  29895. }
  29896. function E(e, t, i, n, r, o) {
  29897. if (!u.isBuffer(e))
  29898. throw new TypeError('"buffer" argument must be a Buffer instance');
  29899. if (r < t || t < o)
  29900. throw new RangeError('"value" argument is out of bounds');
  29901. if (i + n > e.length)
  29902. throw new RangeError("Index out of range")
  29903. }
  29904. function _(e, t, i, n) {
  29905. t < 0 && (t = 65535 + t + 1);
  29906. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29907. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29908. }
  29909. function b(e, t, i, n) {
  29910. t < 0 && (t = 4294967295 + t + 1);
  29911. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29912. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29913. }
  29914. function w(e, t, i, n) {
  29915. if (i + n > e.length)
  29916. throw new RangeError("Index out of range");
  29917. if (i < 0)
  29918. throw new RangeError("Index out of range")
  29919. }
  29920. function T(e, t, i, n, r) {
  29921. return r || w(e, 0, i, 4),
  29922. O.write(e, t, i, n, 23, 4),
  29923. i + 4
  29924. }
  29925. function x(e, t, i, n, r) {
  29926. return r || w(e, 0, i, 8),
  29927. O.write(e, t, i, n, 52, 8),
  29928. i + 8
  29929. }
  29930. function S(e, t) {
  29931. t = t || 1 / 0;
  29932. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29933. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29934. if (!r) {
  29935. if (56319 < i) {
  29936. -1 < (t -= 3) && o.push(239, 191, 189);
  29937. continue
  29938. }
  29939. if (a + 1 === n) {
  29940. -1 < (t -= 3) && o.push(239, 191, 189);
  29941. continue
  29942. }
  29943. r = i;
  29944. continue
  29945. }
  29946. if (i < 56320) {
  29947. -1 < (t -= 3) && o.push(239, 191, 189),
  29948. r = i;
  29949. continue
  29950. }
  29951. i = 65536 + (r - 55296 << 10 | i - 56320)
  29952. } else
  29953. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29954. if (r = null,
  29955. i < 128) {
  29956. if ((t -= 1) < 0)
  29957. break;
  29958. o.push(i)
  29959. } else if (i < 2048) {
  29960. if ((t -= 2) < 0)
  29961. break;
  29962. o.push(i >> 6 | 192, 63 & i | 128)
  29963. } else if (i < 65536) {
  29964. if ((t -= 3) < 0)
  29965. break;
  29966. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29967. } else {
  29968. if (!(i < 1114112))
  29969. throw new Error("Invalid code point");
  29970. if ((t -= 4) < 0)
  29971. break;
  29972. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29973. }
  29974. }
  29975. return o
  29976. }
  29977. function M(e) {
  29978. return P.toByteArray(function(e) {
  29979. if ((e = function(e) {
  29980. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29981. }(e).replace(t, "")).length < 2)
  29982. return "";
  29983. for (; e.length % 4 != 0; )
  29984. e += "=";
  29985. return e
  29986. }(e))
  29987. }
  29988. function R(e, t, i, n) {
  29989. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29990. t[r + i] = e[r];
  29991. return r
  29992. }
  29993. var P = N("base64-js")
  29994. , O = N("ieee754")
  29995. , L = N("isarray");
  29996. F.Buffer = u,
  29997. F.SlowBuffer = function(e) {
  29998. return +e != e && (e = 0),
  29999. u.alloc(+e)
  30000. }
  30001. ,
  30002. F.INSPECT_MAX_BYTES = 50,
  30003. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30004. try {
  30005. var e = new Uint8Array(1);
  30006. return e.__proto__ = {
  30007. __proto__: Uint8Array.prototype,
  30008. foo: function() {
  30009. return 42
  30010. }
  30011. },
  30012. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30013. } catch (e) {
  30014. return !1
  30015. }
  30016. }(),
  30017. F.kMaxLength = i(),
  30018. u.poolSize = 8192,
  30019. u._augment = function(e) {
  30020. return e.__proto__ = u.prototype,
  30021. e
  30022. }
  30023. ,
  30024. u.from = function(e, t, i) {
  30025. return n(null, e, t, i)
  30026. }
  30027. ,
  30028. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30029. u.__proto__ = Uint8Array,
  30030. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30031. value: null,
  30032. configurable: !0
  30033. })),
  30034. u.alloc = function(e, t, i) {
  30035. return function(e, t, i, n) {
  30036. return r(t),
  30037. 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)
  30038. }(null, e, t, i)
  30039. }
  30040. ,
  30041. u.allocUnsafe = function(e) {
  30042. return a(null, e)
  30043. }
  30044. ,
  30045. u.allocUnsafeSlow = function(e) {
  30046. return a(null, e)
  30047. }
  30048. ,
  30049. u.isBuffer = function(e) {
  30050. return !(null == e || !e._isBuffer)
  30051. }
  30052. ,
  30053. u.compare = function(e, t) {
  30054. if (!u.isBuffer(e) || !u.isBuffer(t))
  30055. throw new TypeError("Arguments must be Buffers");
  30056. if (e === t)
  30057. return 0;
  30058. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30059. if (e[r] !== t[r]) {
  30060. i = e[r],
  30061. n = t[r];
  30062. break
  30063. }
  30064. return i < n ? -1 : n < i ? 1 : 0
  30065. }
  30066. ,
  30067. u.isEncoding = function(e) {
  30068. switch (String(e).toLowerCase()) {
  30069. case "hex":
  30070. case "utf8":
  30071. case "utf-8":
  30072. case "ascii":
  30073. case "latin1":
  30074. case "binary":
  30075. case "base64":
  30076. case "ucs2":
  30077. case "ucs-2":
  30078. case "utf16le":
  30079. case "utf-16le":
  30080. return !0;
  30081. default:
  30082. return !1
  30083. }
  30084. }
  30085. ,
  30086. u.concat = function(e, t) {
  30087. if (!L(e))
  30088. throw new TypeError('"list" argument must be an Array of Buffers');
  30089. if (0 === e.length)
  30090. return u.alloc(0);
  30091. var i;
  30092. if (void 0 === t)
  30093. for (i = t = 0; i < e.length; ++i)
  30094. t += e[i].length;
  30095. var n = u.allocUnsafe(t)
  30096. , r = 0;
  30097. for (i = 0; i < e.length; ++i) {
  30098. var o = e[i];
  30099. if (!u.isBuffer(o))
  30100. throw new TypeError('"list" argument must be an Array of Buffers');
  30101. o.copy(n, r),
  30102. r += o.length
  30103. }
  30104. return n
  30105. }
  30106. ,
  30107. u.byteLength = c,
  30108. u.prototype._isBuffer = !0,
  30109. u.prototype.swap16 = function() {
  30110. var e = this.length;
  30111. if (e % 2 != 0)
  30112. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30113. for (var t = 0; t < e; t += 2)
  30114. h(this, t, t + 1);
  30115. return this
  30116. }
  30117. ,
  30118. u.prototype.swap32 = function() {
  30119. var e = this.length;
  30120. if (e % 4 != 0)
  30121. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30122. for (var t = 0; t < e; t += 4)
  30123. h(this, t, t + 3),
  30124. h(this, t + 1, t + 2);
  30125. return this
  30126. }
  30127. ,
  30128. u.prototype.swap64 = function() {
  30129. var e = this.length;
  30130. if (e % 8 != 0)
  30131. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30132. for (var t = 0; t < e; t += 8)
  30133. h(this, t, t + 7),
  30134. h(this, t + 1, t + 6),
  30135. h(this, t + 2, t + 5),
  30136. h(this, t + 3, t + 4);
  30137. return this
  30138. }
  30139. ,
  30140. u.prototype.toString = function() {
  30141. var e = 0 | this.length;
  30142. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30143. var n, r, o, a = !1;
  30144. if ((void 0 === t || t < 0) && (t = 0),
  30145. t > this.length)
  30146. return "";
  30147. if ((void 0 === i || i > this.length) && (i = this.length),
  30148. i <= 0)
  30149. return "";
  30150. if ((i >>>= 0) <= (t >>>= 0))
  30151. return "";
  30152. for (e = e || "utf8"; ; )
  30153. switch (e) {
  30154. case "hex":
  30155. return A(this, t, i);
  30156. case "utf8":
  30157. case "utf-8":
  30158. return f(this, t, i);
  30159. case "ascii":
  30160. return v(this, t, i);
  30161. case "latin1":
  30162. case "binary":
  30163. return y(this, t, i);
  30164. case "base64":
  30165. return n = this,
  30166. o = i,
  30167. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30168. case "ucs2":
  30169. case "ucs-2":
  30170. case "utf16le":
  30171. case "utf-16le":
  30172. return C(this, t, i);
  30173. default:
  30174. if (a)
  30175. throw new TypeError("Unknown encoding: " + e);
  30176. e = (e + "").toLowerCase(),
  30177. a = !0
  30178. }
  30179. }
  30180. .apply(this, arguments)
  30181. }
  30182. ,
  30183. u.prototype.equals = function(e) {
  30184. if (!u.isBuffer(e))
  30185. throw new TypeError("Argument must be a Buffer");
  30186. return this === e || 0 === u.compare(this, e)
  30187. }
  30188. ,
  30189. u.prototype.inspect = function() {
  30190. var e = ""
  30191. , t = F.INSPECT_MAX_BYTES;
  30192. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30193. this.length > t && (e += " ... ")),
  30194. "<Buffer " + e + ">"
  30195. }
  30196. ,
  30197. u.prototype.compare = function(e, t, i, n, r) {
  30198. if (!u.isBuffer(e))
  30199. throw new TypeError("Argument must be a Buffer");
  30200. if (void 0 === t && (t = 0),
  30201. void 0 === i && (i = e ? e.length : 0),
  30202. void 0 === n && (n = 0),
  30203. void 0 === r && (r = this.length),
  30204. t < 0 || i > e.length || n < 0 || r > this.length)
  30205. throw new RangeError("out of range index");
  30206. if (r <= n && i <= t)
  30207. return 0;
  30208. if (r <= n)
  30209. return -1;
  30210. if (i <= t)
  30211. return 1;
  30212. if (this === e)
  30213. return 0;
  30214. 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)
  30215. if (l[h] !== c[h]) {
  30216. o = l[h],
  30217. a = c[h];
  30218. break
  30219. }
  30220. return o < a ? -1 : a < o ? 1 : 0
  30221. }
  30222. ,
  30223. u.prototype.includes = function(e, t, i) {
  30224. return -1 !== this.indexOf(e, t, i)
  30225. }
  30226. ,
  30227. u.prototype.indexOf = function(e, t, i) {
  30228. return d(this, e, t, i, !0)
  30229. }
  30230. ,
  30231. u.prototype.lastIndexOf = function(e, t, i) {
  30232. return d(this, e, t, i, !1)
  30233. }
  30234. ,
  30235. u.prototype.write = function(e, t, i, n) {
  30236. if (void 0 === t)
  30237. n = "utf8",
  30238. i = this.length,
  30239. t = 0;
  30240. else if (void 0 === i && "string" == typeof t)
  30241. n = t,
  30242. i = this.length,
  30243. t = 0;
  30244. else {
  30245. if (!isFinite(t))
  30246. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30247. t |= 0,
  30248. isFinite(i) ? (i |= 0,
  30249. void 0 === n && (n = "utf8")) : (n = i,
  30250. i = void 0)
  30251. }
  30252. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30253. if ((void 0 === i || p < i) && (i = p),
  30254. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30255. throw new RangeError("Attempt to write outside buffer bounds");
  30256. n = n || "utf8";
  30257. for (var f = !1; ; )
  30258. switch (n) {
  30259. case "hex":
  30260. return g(this, e, t, i);
  30261. case "utf8":
  30262. case "utf-8":
  30263. return u = t,
  30264. d = i,
  30265. R(S(e, (h = this).length - u), h, u, d);
  30266. case "ascii":
  30267. return m(this, e, t, i);
  30268. case "latin1":
  30269. case "binary":
  30270. return m(this, e, t, i);
  30271. case "base64":
  30272. return s = this,
  30273. l = t,
  30274. c = i,
  30275. R(M(e), s, l, c);
  30276. case "ucs2":
  30277. case "ucs-2":
  30278. case "utf16le":
  30279. case "utf-16le":
  30280. return o = t,
  30281. a = i,
  30282. R(function(e, t) {
  30283. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30284. i = e.charCodeAt(a),
  30285. n = i >> 8,
  30286. r = i % 256,
  30287. o.push(r),
  30288. o.push(n);
  30289. return o
  30290. }(e, (r = this).length - o), r, o, a);
  30291. default:
  30292. if (f)
  30293. throw new TypeError("Unknown encoding: " + n);
  30294. n = ("" + n).toLowerCase(),
  30295. f = !0
  30296. }
  30297. }
  30298. ,
  30299. u.prototype.toJSON = function() {
  30300. return {
  30301. type: "Buffer",
  30302. data: Array.prototype.slice.call(this._arr || this, 0)
  30303. }
  30304. }
  30305. ;
  30306. var D = 4096;
  30307. u.prototype.slice = function(e, t) {
  30308. var i, n = this.length;
  30309. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30310. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30311. t < e && (t = e),
  30312. u.TYPED_ARRAY_SUPPORT)
  30313. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30314. else {
  30315. var r = t - e;
  30316. i = new u(r,void 0);
  30317. for (var o = 0; o < r; ++o)
  30318. i[o] = this[o + e]
  30319. }
  30320. return i
  30321. }
  30322. ,
  30323. u.prototype.readUIntLE = function(e, t, i) {
  30324. e |= 0,
  30325. t |= 0,
  30326. i || I(e, t, this.length);
  30327. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30328. n += this[e + o] * r;
  30329. return n
  30330. }
  30331. ,
  30332. u.prototype.readUIntBE = function(e, t, i) {
  30333. e |= 0,
  30334. t |= 0,
  30335. i || I(e, t, this.length);
  30336. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30337. n += this[e + --t] * r;
  30338. return n
  30339. }
  30340. ,
  30341. u.prototype.readUInt8 = function(e, t) {
  30342. return t || I(e, 1, this.length),
  30343. this[e]
  30344. }
  30345. ,
  30346. u.prototype.readUInt16LE = function(e, t) {
  30347. return t || I(e, 2, this.length),
  30348. this[e] | this[e + 1] << 8
  30349. }
  30350. ,
  30351. u.prototype.readUInt16BE = function(e, t) {
  30352. return t || I(e, 2, this.length),
  30353. this[e] << 8 | this[e + 1]
  30354. }
  30355. ,
  30356. u.prototype.readUInt32LE = function(e, t) {
  30357. return t || I(e, 4, this.length),
  30358. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30359. }
  30360. ,
  30361. u.prototype.readUInt32BE = function(e, t) {
  30362. return t || I(e, 4, this.length),
  30363. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30364. }
  30365. ,
  30366. u.prototype.readIntLE = function(e, t, i) {
  30367. e |= 0,
  30368. t |= 0,
  30369. i || I(e, t, this.length);
  30370. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30371. n += this[e + o] * r;
  30372. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30373. n
  30374. }
  30375. ,
  30376. u.prototype.readIntBE = function(e, t, i) {
  30377. e |= 0,
  30378. t |= 0,
  30379. i || I(e, t, this.length);
  30380. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30381. o += this[e + --n] * r;
  30382. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30383. o
  30384. }
  30385. ,
  30386. u.prototype.readInt8 = function(e, t) {
  30387. return t || I(e, 1, this.length),
  30388. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30389. }
  30390. ,
  30391. u.prototype.readInt16LE = function(e, t) {
  30392. t || I(e, 2, this.length);
  30393. var i = this[e] | this[e + 1] << 8;
  30394. return 32768 & i ? 4294901760 | i : i
  30395. }
  30396. ,
  30397. u.prototype.readInt16BE = function(e, t) {
  30398. t || I(e, 2, this.length);
  30399. var i = this[e + 1] | this[e] << 8;
  30400. return 32768 & i ? 4294901760 | i : i
  30401. }
  30402. ,
  30403. u.prototype.readInt32LE = function(e, t) {
  30404. return t || I(e, 4, this.length),
  30405. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30406. }
  30407. ,
  30408. u.prototype.readInt32BE = function(e, t) {
  30409. return t || I(e, 4, this.length),
  30410. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30411. }
  30412. ,
  30413. u.prototype.readFloatLE = function(e, t) {
  30414. return t || I(e, 4, this.length),
  30415. O.read(this, e, !0, 23, 4)
  30416. }
  30417. ,
  30418. u.prototype.readFloatBE = function(e, t) {
  30419. return t || I(e, 4, this.length),
  30420. O.read(this, e, !1, 23, 4)
  30421. }
  30422. ,
  30423. u.prototype.readDoubleLE = function(e, t) {
  30424. return t || I(e, 8, this.length),
  30425. O.read(this, e, !0, 52, 8)
  30426. }
  30427. ,
  30428. u.prototype.readDoubleBE = function(e, t) {
  30429. return t || I(e, 8, this.length),
  30430. O.read(this, e, !1, 52, 8)
  30431. }
  30432. ,
  30433. u.prototype.writeUIntLE = function(e, t, i, n) {
  30434. e = +e,
  30435. t |= 0,
  30436. i |= 0,
  30437. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30438. var r = 1
  30439. , o = 0;
  30440. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30441. this[t + o] = e / r & 255;
  30442. return t + i
  30443. }
  30444. ,
  30445. u.prototype.writeUIntBE = function(e, t, i, n) {
  30446. e = +e,
  30447. t |= 0,
  30448. i |= 0,
  30449. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30450. var r = i - 1
  30451. , o = 1;
  30452. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30453. this[t + r] = e / o & 255;
  30454. return t + i
  30455. }
  30456. ,
  30457. u.prototype.writeUInt8 = function(e, t, i) {
  30458. return e = +e,
  30459. t |= 0,
  30460. i || E(this, e, t, 1, 255, 0),
  30461. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30462. this[t] = 255 & e,
  30463. t + 1
  30464. }
  30465. ,
  30466. u.prototype.writeUInt16LE = function(e, t, i) {
  30467. return e = +e,
  30468. t |= 0,
  30469. i || E(this, e, t, 2, 65535, 0),
  30470. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30471. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30472. t + 2
  30473. }
  30474. ,
  30475. u.prototype.writeUInt16BE = function(e, t, i) {
  30476. return e = +e,
  30477. t |= 0,
  30478. i || E(this, e, t, 2, 65535, 0),
  30479. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30480. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30481. t + 2
  30482. }
  30483. ,
  30484. u.prototype.writeUInt32LE = function(e, t, i) {
  30485. return e = +e,
  30486. t |= 0,
  30487. i || E(this, e, t, 4, 4294967295, 0),
  30488. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30489. this[t + 2] = e >>> 16,
  30490. this[t + 1] = e >>> 8,
  30491. this[t] = 255 & e) : b(this, e, t, !0),
  30492. t + 4
  30493. }
  30494. ,
  30495. u.prototype.writeUInt32BE = function(e, t, i) {
  30496. return e = +e,
  30497. t |= 0,
  30498. i || E(this, e, t, 4, 4294967295, 0),
  30499. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30500. this[t + 1] = e >>> 16,
  30501. this[t + 2] = e >>> 8,
  30502. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30503. t + 4
  30504. }
  30505. ,
  30506. u.prototype.writeIntLE = function(e, t, i, n) {
  30507. if (e = +e,
  30508. t |= 0,
  30509. !n) {
  30510. var r = Math.pow(2, 8 * i - 1);
  30511. E(this, e, t, i, r - 1, -r)
  30512. }
  30513. var o = 0
  30514. , a = 1
  30515. , s = 0;
  30516. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30517. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30518. this[t + o] = (e / a >> 0) - s & 255;
  30519. return t + i
  30520. }
  30521. ,
  30522. u.prototype.writeIntBE = function(e, t, i, n) {
  30523. if (e = +e,
  30524. t |= 0,
  30525. !n) {
  30526. var r = Math.pow(2, 8 * i - 1);
  30527. E(this, e, t, i, r - 1, -r)
  30528. }
  30529. var o = i - 1
  30530. , a = 1
  30531. , s = 0;
  30532. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30533. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30534. this[t + o] = (e / a >> 0) - s & 255;
  30535. return t + i
  30536. }
  30537. ,
  30538. u.prototype.writeInt8 = function(e, t, i) {
  30539. return e = +e,
  30540. t |= 0,
  30541. i || E(this, e, t, 1, 127, -128),
  30542. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30543. e < 0 && (e = 255 + e + 1),
  30544. this[t] = 255 & e,
  30545. t + 1
  30546. }
  30547. ,
  30548. u.prototype.writeInt16LE = function(e, t, i) {
  30549. return e = +e,
  30550. t |= 0,
  30551. i || E(this, e, t, 2, 32767, -32768),
  30552. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30553. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30554. t + 2
  30555. }
  30556. ,
  30557. u.prototype.writeInt16BE = function(e, t, i) {
  30558. return e = +e,
  30559. t |= 0,
  30560. i || E(this, e, t, 2, 32767, -32768),
  30561. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30562. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30563. t + 2
  30564. }
  30565. ,
  30566. u.prototype.writeInt32LE = function(e, t, i) {
  30567. return e = +e,
  30568. t |= 0,
  30569. i || E(this, e, t, 4, 2147483647, -2147483648),
  30570. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30571. this[t + 1] = e >>> 8,
  30572. this[t + 2] = e >>> 16,
  30573. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30574. t + 4
  30575. }
  30576. ,
  30577. u.prototype.writeInt32BE = function(e, t, i) {
  30578. return e = +e,
  30579. t |= 0,
  30580. i || E(this, e, t, 4, 2147483647, -2147483648),
  30581. e < 0 && (e = 4294967295 + e + 1),
  30582. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30583. this[t + 1] = e >>> 16,
  30584. this[t + 2] = e >>> 8,
  30585. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30586. t + 4
  30587. }
  30588. ,
  30589. u.prototype.writeFloatLE = function(e, t, i) {
  30590. return T(this, e, t, !0, i)
  30591. }
  30592. ,
  30593. u.prototype.writeFloatBE = function(e, t, i) {
  30594. return T(this, e, t, !1, i)
  30595. }
  30596. ,
  30597. u.prototype.writeDoubleLE = function(e, t, i) {
  30598. return x(this, e, t, !0, i)
  30599. }
  30600. ,
  30601. u.prototype.writeDoubleBE = function(e, t, i) {
  30602. return x(this, e, t, !1, i)
  30603. }
  30604. ,
  30605. u.prototype.copy = function(e, t, i, n) {
  30606. if (i = i || 0,
  30607. n || 0 === n || (n = this.length),
  30608. t >= e.length && (t = e.length),
  30609. t = t || 0,
  30610. 0 < n && n < i && (n = i),
  30611. n === i)
  30612. return 0;
  30613. if (0 === e.length || 0 === this.length)
  30614. return 0;
  30615. if (t < 0)
  30616. throw new RangeError("targetStart out of bounds");
  30617. if (i < 0 || i >= this.length)
  30618. throw new RangeError("sourceStart out of bounds");
  30619. if (n < 0)
  30620. throw new RangeError("sourceEnd out of bounds");
  30621. n > this.length && (n = this.length),
  30622. e.length - t < n - i && (n = e.length - t + i);
  30623. var r, o = n - i;
  30624. if (this === e && i < t && t < n)
  30625. for (r = o - 1; 0 <= r; --r)
  30626. e[r + t] = this[r + i];
  30627. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30628. for (r = 0; r < o; ++r)
  30629. e[r + t] = this[r + i];
  30630. else
  30631. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30632. return o
  30633. }
  30634. ,
  30635. u.prototype.fill = function(e, t, i, n) {
  30636. if ("string" == typeof e) {
  30637. if ("string" == typeof t ? (n = t,
  30638. t = 0,
  30639. i = this.length) : "string" == typeof i && (n = i,
  30640. i = this.length),
  30641. 1 === e.length) {
  30642. var r = e.charCodeAt(0);
  30643. r < 256 && (e = r)
  30644. }
  30645. if (void 0 !== n && "string" != typeof n)
  30646. throw new TypeError("encoding must be a string");
  30647. if ("string" == typeof n && !u.isEncoding(n))
  30648. throw new TypeError("Unknown encoding: " + n)
  30649. } else
  30650. "number" == typeof e && (e &= 255);
  30651. if (t < 0 || this.length < t || this.length < i)
  30652. throw new RangeError("Out of range index");
  30653. if (i <= t)
  30654. return this;
  30655. var o;
  30656. if (t >>>= 0,
  30657. i = void 0 === i ? this.length : i >>> 0,
  30658. "number" == typeof (e = e || 0))
  30659. for (o = t; o < i; ++o)
  30660. this[o] = e;
  30661. else {
  30662. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30663. , s = a.length;
  30664. for (o = 0; o < i - t; ++o)
  30665. this[o + t] = a[o % s]
  30666. }
  30667. return this
  30668. }
  30669. ;
  30670. var t = /[^+\/0-9A-Za-z-_]/g
  30671. }
  30672. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30673. }
  30674. , {
  30675. "base64-js": 199,
  30676. ieee754: 200,
  30677. isarray: 201
  30678. }],
  30679. 199: [function(e, t, i) {
  30680. "use strict";
  30681. function l(e) {
  30682. var t = e.length;
  30683. if (0 < t % 4)
  30684. throw new Error("Invalid string. Length must be a multiple of 4");
  30685. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30686. }
  30687. function c(e, t, i) {
  30688. for (var n, r = [], o = t; o < i; o += 3)
  30689. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30690. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30691. var a;
  30692. return r.join("")
  30693. }
  30694. i.byteLength = function(e) {
  30695. return 3 * e.length / 4 - l(e)
  30696. }
  30697. ,
  30698. i.toByteArray = function(e) {
  30699. var t, i, n, r, o, a = e.length;
  30700. r = l(e),
  30701. o = new d(3 * a / 4 - r),
  30702. i = 0 < r ? a - 4 : a;
  30703. var s = 0;
  30704. for (t = 0; t < i; t += 4,
  30705. 3)
  30706. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30707. o[s++] = n >> 16 & 255,
  30708. o[s++] = n >> 8 & 255,
  30709. o[s++] = 255 & n;
  30710. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30711. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30712. o[s++] = n >> 8 & 255,
  30713. o[s++] = 255 & n),
  30714. o
  30715. }
  30716. ,
  30717. i.fromByteArray = function(e) {
  30718. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30719. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30720. return 1 == n ? (t = e[i - 1],
  30721. r += h[t >> 2],
  30722. r += h[t << 4 & 63],
  30723. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30724. r += h[t >> 10],
  30725. r += h[t >> 4 & 63],
  30726. r += h[t << 2 & 63],
  30727. r += "="),
  30728. o.push(r),
  30729. o.join("")
  30730. }
  30731. ;
  30732. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30733. h[r] = n[r],
  30734. u[n.charCodeAt(r)] = r;
  30735. u["-".charCodeAt(0)] = 62,
  30736. u["_".charCodeAt(0)] = 63
  30737. }
  30738. , {}],
  30739. 200: [function(e, t, i) {
  30740. i.read = function(e, t, i, n, r) {
  30741. 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];
  30742. for (u += d,
  30743. o = p & (1 << -h) - 1,
  30744. p >>= -h,
  30745. h += s; 0 < h; o = 256 * o + e[t + u],
  30746. u += d,
  30747. h -= 8)
  30748. ;
  30749. for (a = o & (1 << -h) - 1,
  30750. o >>= -h,
  30751. h += n; 0 < h; a = 256 * a + e[t + u],
  30752. u += d,
  30753. h -= 8)
  30754. ;
  30755. if (0 === o)
  30756. o = 1 - c;
  30757. else {
  30758. if (o === l)
  30759. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30760. a += Math.pow(2, n),
  30761. o -= c
  30762. }
  30763. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30764. }
  30765. ,
  30766. i.write = function(e, t, i, n, r, o) {
  30767. 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;
  30768. for (t = Math.abs(t),
  30769. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30770. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30771. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30772. l *= 2),
  30773. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30774. l /= 2),
  30775. h <= a + u ? (s = 0,
  30776. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30777. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30778. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30779. p += f,
  30780. s /= 256,
  30781. r -= 8)
  30782. ;
  30783. for (a = a << r | s,
  30784. c += r; 0 < c; e[i + p] = 255 & a,
  30785. p += f,
  30786. a /= 256,
  30787. c -= 8)
  30788. ;
  30789. e[i + p - f] |= 128 * g
  30790. }
  30791. }
  30792. , {}],
  30793. 201: [function(e, t, i) {
  30794. var n = {}.toString;
  30795. t.exports = Array.isArray || function(e) {
  30796. return "[object Array]" == n.call(e)
  30797. }
  30798. }
  30799. , {}],
  30800. 202: [function(e, t, i) {
  30801. function n() {
  30802. this._events = this._events || {},
  30803. this._maxListeners = this._maxListeners || void 0
  30804. }
  30805. function l(e) {
  30806. return "function" == typeof e
  30807. }
  30808. function c(e) {
  30809. return "object" == typeof e && null !== e
  30810. }
  30811. function h(e) {
  30812. return void 0 === e
  30813. }
  30814. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30815. n.prototype._maxListeners = void 0,
  30816. n.defaultMaxListeners = 10,
  30817. n.prototype.setMaxListeners = function(e) {
  30818. if (!function(e) {
  30819. return "number" == typeof e
  30820. }(e) || e < 0 || isNaN(e))
  30821. throw TypeError("n must be a positive number");
  30822. return this._maxListeners = e,
  30823. this
  30824. }
  30825. ,
  30826. n.prototype.emit = function(e) {
  30827. var t, i, n, r, o, a;
  30828. if (this._events || (this._events = {}),
  30829. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30830. if ((t = arguments[1])instanceof Error)
  30831. throw t;
  30832. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30833. throw s.context = t,
  30834. s
  30835. }
  30836. if (h(i = this._events[e]))
  30837. return !1;
  30838. if (l(i))
  30839. switch (arguments.length) {
  30840. case 1:
  30841. i.call(this);
  30842. break;
  30843. case 2:
  30844. i.call(this, arguments[1]);
  30845. break;
  30846. case 3:
  30847. i.call(this, arguments[1], arguments[2]);
  30848. break;
  30849. default:
  30850. r = Array.prototype.slice.call(arguments, 1),
  30851. i.apply(this, r)
  30852. }
  30853. else if (c(i))
  30854. for (r = Array.prototype.slice.call(arguments, 1),
  30855. n = (a = i.slice()).length,
  30856. o = 0; o < n; o++)
  30857. a[o].apply(this, r);
  30858. return !0
  30859. }
  30860. ,
  30861. n.prototype.on = n.prototype.addListener = function(e, t) {
  30862. var i;
  30863. if (!l(t))
  30864. throw TypeError("listener must be a function");
  30865. return this._events || (this._events = {}),
  30866. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30867. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30868. 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,
  30869. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30870. "function" == typeof console.trace && console.trace())),
  30871. this
  30872. }
  30873. ,
  30874. n.prototype.once = function(e, t) {
  30875. function i() {
  30876. this.removeListener(e, i),
  30877. n || (n = !0,
  30878. t.apply(this, arguments))
  30879. }
  30880. if (!l(t))
  30881. throw TypeError("listener must be a function");
  30882. var n = !1;
  30883. return i.listener = t,
  30884. this.on(e, i),
  30885. this
  30886. }
  30887. ,
  30888. n.prototype.removeListener = function(e, t) {
  30889. var i, n, r, o;
  30890. if (!l(t))
  30891. throw TypeError("listener must be a function");
  30892. if (!this._events || !this._events[e])
  30893. return this;
  30894. if (r = (i = this._events[e]).length,
  30895. n = -1,
  30896. i === t || l(i.listener) && i.listener === t)
  30897. delete this._events[e],
  30898. this._events.removeListener && this.emit("removeListener", e, t);
  30899. else if (c(i)) {
  30900. for (o = r; 0 < o--; )
  30901. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30902. n = o;
  30903. break
  30904. }
  30905. if (n < 0)
  30906. return this;
  30907. 1 === i.length ? (i.length = 0,
  30908. delete this._events[e]) : i.splice(n, 1),
  30909. this._events.removeListener && this.emit("removeListener", e, t)
  30910. }
  30911. return this
  30912. }
  30913. ,
  30914. n.prototype.removeAllListeners = function(e) {
  30915. var t, i;
  30916. if (!this._events)
  30917. return this;
  30918. if (!this._events.removeListener)
  30919. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30920. this;
  30921. if (0 === arguments.length) {
  30922. for (t in this._events)
  30923. "removeListener" !== t && this.removeAllListeners(t);
  30924. return this.removeAllListeners("removeListener"),
  30925. this._events = {},
  30926. this
  30927. }
  30928. if (l(i = this._events[e]))
  30929. this.removeListener(e, i);
  30930. else if (i)
  30931. for (; i.length; )
  30932. this.removeListener(e, i[i.length - 1]);
  30933. return delete this._events[e],
  30934. this
  30935. }
  30936. ,
  30937. n.prototype.listeners = function(e) {
  30938. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30939. }
  30940. ,
  30941. n.prototype.listenerCount = function(e) {
  30942. if (this._events) {
  30943. var t = this._events[e];
  30944. if (l(t))
  30945. return 1;
  30946. if (t)
  30947. return t.length
  30948. }
  30949. return 0
  30950. }
  30951. ,
  30952. n.listenerCount = function(e, t) {
  30953. return e.listenerCount(t)
  30954. }
  30955. }
  30956. , {}],
  30957. 203: [function(e, t, i) {
  30958. function n() {
  30959. throw new Error("setTimeout has not been defined")
  30960. }
  30961. function r() {
  30962. throw new Error("clearTimeout has not been defined")
  30963. }
  30964. function o(t) {
  30965. if (h === setTimeout)
  30966. return setTimeout(t, 0);
  30967. if ((h === n || !h) && setTimeout)
  30968. return h = setTimeout,
  30969. setTimeout(t, 0);
  30970. try {
  30971. return h(t, 0)
  30972. } catch (e) {
  30973. try {
  30974. return h.call(null, t, 0)
  30975. } catch (e) {
  30976. return h.call(this, t, 0)
  30977. }
  30978. }
  30979. }
  30980. function a() {
  30981. g && p && (g = !1,
  30982. p.length ? f = p.concat(f) : m = -1,
  30983. f.length && s())
  30984. }
  30985. function s() {
  30986. if (!g) {
  30987. var e = o(a);
  30988. g = !0;
  30989. for (var t = f.length; t; ) {
  30990. for (p = f,
  30991. f = []; ++m < t; )
  30992. p && p[m].run();
  30993. m = -1,
  30994. t = f.length
  30995. }
  30996. p = null,
  30997. g = !1,
  30998. function(t) {
  30999. if (u === clearTimeout)
  31000. return clearTimeout(t);
  31001. if ((u === r || !u) && clearTimeout)
  31002. return u = clearTimeout,
  31003. clearTimeout(t);
  31004. try {
  31005. u(t)
  31006. } catch (e) {
  31007. try {
  31008. return u.call(null, t)
  31009. } catch (e) {
  31010. return u.call(this, t)
  31011. }
  31012. }
  31013. }(e)
  31014. }
  31015. }
  31016. function l(e, t) {
  31017. this.fun = e,
  31018. this.array = t
  31019. }
  31020. function c() {}
  31021. var h, u, d = t.exports = {};
  31022. !function() {
  31023. try {
  31024. h = "function" == typeof setTimeout ? setTimeout : n
  31025. } catch (e) {
  31026. h = n
  31027. }
  31028. try {
  31029. u = "function" == typeof clearTimeout ? clearTimeout : r
  31030. } catch (e) {
  31031. u = r
  31032. }
  31033. }();
  31034. var p, f = [], g = !1, m = -1;
  31035. d.nextTick = function(e) {
  31036. var t = new Array(arguments.length - 1);
  31037. if (1 < arguments.length)
  31038. for (var i = 1; i < arguments.length; i++)
  31039. t[i - 1] = arguments[i];
  31040. f.push(new l(e,t)),
  31041. 1 !== f.length || g || o(s)
  31042. }
  31043. ,
  31044. l.prototype.run = function() {
  31045. this.fun.apply(null, this.array)
  31046. }
  31047. ,
  31048. d.title = "browser",
  31049. d.browser = !0,
  31050. d.env = {},
  31051. d.argv = [],
  31052. d.version = "",
  31053. d.versions = {},
  31054. d.on = c,
  31055. d.addListener = c,
  31056. d.once = c,
  31057. d.off = c,
  31058. d.removeListener = c,
  31059. d.removeAllListeners = c,
  31060. d.emit = c,
  31061. d.binding = function(e) {
  31062. throw new Error("process.binding is not supported")
  31063. }
  31064. ,
  31065. d.cwd = function() {
  31066. return "/"
  31067. }
  31068. ,
  31069. d.chdir = function(e) {
  31070. throw new Error("process.chdir is not supported")
  31071. }
  31072. ,
  31073. d.umask = function() {
  31074. return 0
  31075. }
  31076. }
  31077. , {}],
  31078. 204: [function(e, O, L) {
  31079. (function(P) {
  31080. !function(e) {
  31081. function v(e) {
  31082. throw new RangeError(g[e])
  31083. }
  31084. function r(e, t) {
  31085. for (var i = e.length, n = []; i--; )
  31086. n[i] = t(e[i]);
  31087. return n
  31088. }
  31089. function t(e, t) {
  31090. var i = e.split("@")
  31091. , n = "";
  31092. return 1 < i.length && (n = i[0] + "@",
  31093. e = i[1]),
  31094. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31095. }
  31096. function y(e) {
  31097. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31098. 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),
  31099. r--) : n.push(t);
  31100. return n
  31101. }
  31102. function A(e) {
  31103. return r(e, function(e) {
  31104. var t = "";
  31105. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31106. e = 56320 | 1023 & e),
  31107. t + R(e)
  31108. }).join("")
  31109. }
  31110. function C(e, t) {
  31111. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31112. }
  31113. function I(e, t, i) {
  31114. var n = 0;
  31115. for (e = i ? M(e / u) : e >> 1,
  31116. e += M(e / t); m * w >> 1 < e; n += _)
  31117. e = M(e / m);
  31118. return M(n + (m + 1) * e / (e + h))
  31119. }
  31120. function i(e) {
  31121. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31122. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31123. n = 0; n < i; ++n)
  31124. 128 <= e.charCodeAt(n) && v("not-basic"),
  31125. d.push(e.charCodeAt(n));
  31126. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31127. for (o = f,
  31128. a = 1,
  31129. s = _; p <= r && v("invalid-input"),
  31130. u = e.charCodeAt(r++),
  31131. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31132. f += l * a,
  31133. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31134. a > M(E / (h = _ - c)) && v("overflow"),
  31135. a *= h;
  31136. m = I(f - o, t = d.length + 1, 0 == o),
  31137. M(f / t) > E - g && v("overflow"),
  31138. g += M(f / t),
  31139. f %= t,
  31140. d.splice(f++, 0, g)
  31141. }
  31142. return A(d)
  31143. }
  31144. function n(e) {
  31145. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31146. for (d = (e = y(e)).length,
  31147. t = x,
  31148. o = T,
  31149. a = i = 0; a < d; ++a)
  31150. (u = e[a]) < 128 && m.push(R(u));
  31151. for (n = r = m.length,
  31152. r && m.push(S); n < d; ) {
  31153. for (s = E,
  31154. a = 0; a < d; ++a)
  31155. t <= (u = e[a]) && u < s && (s = u);
  31156. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31157. i += (s - t) * p,
  31158. t = s,
  31159. a = 0; a < d; ++a)
  31160. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31161. u == t) {
  31162. for (l = i,
  31163. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31164. g = l - h,
  31165. f = _ - h,
  31166. m.push(R(C(h + g % f, 0))),
  31167. l = M(g / f);
  31168. m.push(R(C(l, 0))),
  31169. o = I(i, p, n == r),
  31170. i = 0,
  31171. ++n
  31172. }
  31173. ++i,
  31174. ++t
  31175. }
  31176. return m.join("")
  31177. }
  31178. var o = "object" == typeof L && L && !L.nodeType && L
  31179. , a = "object" == typeof O && O && !O.nodeType && O
  31180. , s = "object" == typeof P && P;
  31181. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31182. 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 = {
  31183. overflow: "Overflow: input needs wider integers to process",
  31184. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31185. "invalid-input": "Invalid input"
  31186. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31187. if (l = {
  31188. version: "1.4.1",
  31189. ucs2: {
  31190. decode: y,
  31191. encode: A
  31192. },
  31193. decode: i,
  31194. encode: n,
  31195. toASCII: function(e) {
  31196. return t(e, function(e) {
  31197. return p.test(e) ? "xn--" + n(e) : e
  31198. })
  31199. },
  31200. toUnicode: function(e) {
  31201. return t(e, function(e) {
  31202. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31203. })
  31204. }
  31205. },
  31206. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31207. define("punycode", function() {
  31208. return l
  31209. });
  31210. else if (o && a)
  31211. if (O.exports == o)
  31212. a.exports = l;
  31213. else
  31214. for (c in l)
  31215. l.hasOwnProperty(c) && (o[c] = l[c]);
  31216. else
  31217. e.punycode = l
  31218. }(this)
  31219. }
  31220. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31221. }
  31222. , {}],
  31223. 205: [function(e, t, i) {
  31224. "use strict";
  31225. t.exports = function(e, t, i, n) {
  31226. t = t || "&",
  31227. i = i || "=";
  31228. var r = {};
  31229. if ("string" != typeof e || 0 === e.length)
  31230. return r;
  31231. var o = /\+/g;
  31232. e = e.split(t);
  31233. var a = 1e3;
  31234. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31235. var s, l, c = e.length;
  31236. 0 < a && a < c && (c = a);
  31237. for (var h = 0; h < c; ++h) {
  31238. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31239. d = 0 <= m ? (u = g.substr(0, m),
  31240. g.substr(m + 1)) : (u = g,
  31241. ""),
  31242. p = decodeURIComponent(u),
  31243. f = decodeURIComponent(d),
  31244. s = r,
  31245. l = p,
  31246. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31247. }
  31248. return r
  31249. }
  31250. ;
  31251. var v = Array.isArray || function(e) {
  31252. return "[object Array]" === Object.prototype.toString.call(e)
  31253. }
  31254. }
  31255. , {}],
  31256. 206: [function(e, t, i) {
  31257. "use strict";
  31258. function o(e, t) {
  31259. if (e.map)
  31260. return e.map(t);
  31261. for (var i = [], n = 0; n < e.length; n++)
  31262. i.push(t(e[n], n));
  31263. return i
  31264. }
  31265. function a(e) {
  31266. switch (typeof e) {
  31267. case "string":
  31268. return e;
  31269. case "boolean":
  31270. return e ? "true" : "false";
  31271. case "number":
  31272. return isFinite(e) ? e : "";
  31273. default:
  31274. return ""
  31275. }
  31276. }
  31277. t.exports = function(i, n, r, e) {
  31278. return n = n || "&",
  31279. r = r || "=",
  31280. null === i && (i = void 0),
  31281. "object" == typeof i ? o(l(i), function(e) {
  31282. var t = encodeURIComponent(a(e)) + r;
  31283. return s(i[e]) ? o(i[e], function(e) {
  31284. return t + encodeURIComponent(a(e))
  31285. }).join(n) : t + encodeURIComponent(a(i[e]))
  31286. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31287. }
  31288. ;
  31289. var s = Array.isArray || function(e) {
  31290. return "[object Array]" === Object.prototype.toString.call(e)
  31291. }
  31292. , l = Object.keys || function(e) {
  31293. var t = [];
  31294. for (var i in e)
  31295. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31296. return t
  31297. }
  31298. }
  31299. , {}],
  31300. 207: [function(e, t, i) {
  31301. "use strict";
  31302. i.decode = i.parse = e("./decode"),
  31303. i.encode = i.stringify = e("./encode")
  31304. }
  31305. , {
  31306. "./decode": 205,
  31307. "./encode": 206
  31308. }],
  31309. 208: [function(e, t, i) {
  31310. "use strict";
  31311. function x() {
  31312. this.protocol = null,
  31313. this.slashes = null,
  31314. this.auth = null,
  31315. this.host = null,
  31316. this.port = null,
  31317. this.hostname = null,
  31318. this.hash = null,
  31319. this.search = null,
  31320. this.query = null,
  31321. this.pathname = null,
  31322. this.path = null,
  31323. this.href = null
  31324. }
  31325. function n(e, t, i) {
  31326. if (e && D.isObject(e) && e instanceof x)
  31327. return e;
  31328. var n = new x;
  31329. return n.parse(e, t, i),
  31330. n
  31331. }
  31332. var L = e("punycode")
  31333. , D = e("./util");
  31334. i.parse = n,
  31335. i.resolve = function(e, t) {
  31336. return n(e, !1, !0).resolve(t)
  31337. }
  31338. ,
  31339. i.resolveObject = function(e, t) {
  31340. return e ? n(e, !1, !0).resolveObject(t) : t
  31341. }
  31342. ,
  31343. i.format = function(e) {
  31344. return D.isString(e) && (e = n(e)),
  31345. e instanceof x ? e.format() : x.prototype.format.call(e)
  31346. }
  31347. ,
  31348. i.Url = x;
  31349. var N = /^([a-z0-9.+-]+:)/i
  31350. , r = /:[0-9]*$/
  31351. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31352. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31353. , B = ["'"].concat(o)
  31354. , V = ["%", "/", "?", ";", "#"].concat(B)
  31355. , k = ["/", "?", "#"]
  31356. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31357. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31358. , z = {
  31359. javascript: !0,
  31360. "javascript:": !0
  31361. }
  31362. , G = {
  31363. javascript: !0,
  31364. "javascript:": !0
  31365. }
  31366. , W = {
  31367. http: !0,
  31368. https: !0,
  31369. ftp: !0,
  31370. gopher: !0,
  31371. file: !0,
  31372. "http:": !0,
  31373. "https:": !0,
  31374. "ftp:": !0,
  31375. "gopher:": !0,
  31376. "file:": !0
  31377. }
  31378. , j = e("querystring");
  31379. x.prototype.parse = function(e, t, i) {
  31380. if (!D.isString(e))
  31381. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31382. var n = e.indexOf("?")
  31383. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31384. , o = e.split(r);
  31385. o[0] = o[0].replace(/\\/g, "/");
  31386. var a = e = o.join(r);
  31387. if (a = a.trim(),
  31388. !i && 1 === e.split("#").length) {
  31389. var s = F.exec(a);
  31390. if (s)
  31391. return this.path = a,
  31392. this.href = a,
  31393. this.pathname = s[1],
  31394. s[2] ? (this.search = s[2],
  31395. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31396. this.query = {}),
  31397. this
  31398. }
  31399. var l = N.exec(a);
  31400. if (l) {
  31401. var c = (l = l[0]).toLowerCase();
  31402. this.protocol = c,
  31403. a = a.substr(l.length)
  31404. }
  31405. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31406. var h = "//" === a.substr(0, 2);
  31407. !h || l && G[l] || (a = a.substr(2),
  31408. this.slashes = !0)
  31409. }
  31410. if (!G[l] && (h || l && !W[l])) {
  31411. for (var u = -1, d = 0; d < k.length; d++) {
  31412. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31413. }
  31414. var p, f;
  31415. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31416. a = a.slice(f + 1),
  31417. this.auth = decodeURIComponent(p)),
  31418. u = -1;
  31419. for (d = 0; d < V.length; d++) {
  31420. var g;
  31421. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31422. }
  31423. -1 === u && (u = a.length),
  31424. this.host = a.slice(0, u),
  31425. a = a.slice(u),
  31426. this.parseHost(),
  31427. this.hostname = this.hostname || "";
  31428. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31429. if (!m)
  31430. for (var v = this.hostname.split(/\./), y = (d = 0,
  31431. v.length); d < y; d++) {
  31432. var A = v[d];
  31433. if (A && !A.match(U)) {
  31434. for (var C = "", I = 0, E = A.length; I < E; I++)
  31435. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31436. if (!C.match(U)) {
  31437. var _ = v.slice(0, d)
  31438. , b = v.slice(d + 1)
  31439. , w = A.match(H);
  31440. w && (_.push(w[1]),
  31441. b.unshift(w[2])),
  31442. b.length && (a = "/" + b.join(".") + a),
  31443. this.hostname = _.join(".");
  31444. break
  31445. }
  31446. }
  31447. }
  31448. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31449. m || (this.hostname = L.toASCII(this.hostname));
  31450. var T = this.port ? ":" + this.port : ""
  31451. , x = this.hostname || "";
  31452. this.host = x + T,
  31453. this.href += this.host,
  31454. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31455. "/" !== a[0] && (a = "/" + a))
  31456. }
  31457. if (!z[c])
  31458. for (d = 0,
  31459. y = B.length; d < y; d++) {
  31460. var S = B[d];
  31461. if (-1 !== a.indexOf(S)) {
  31462. var M = encodeURIComponent(S);
  31463. M === S && (M = escape(S)),
  31464. a = a.split(S).join(M)
  31465. }
  31466. }
  31467. var R = a.indexOf("#");
  31468. -1 !== R && (this.hash = a.substr(R),
  31469. a = a.slice(0, R));
  31470. var P = a.indexOf("?");
  31471. if (-1 !== P ? (this.search = a.substr(P),
  31472. this.query = a.substr(P + 1),
  31473. t && (this.query = j.parse(this.query)),
  31474. a = a.slice(0, P)) : t && (this.search = "",
  31475. this.query = {}),
  31476. a && (this.pathname = a),
  31477. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31478. this.pathname || this.search) {
  31479. T = this.pathname || "";
  31480. var O = this.search || "";
  31481. this.path = T + O
  31482. }
  31483. return this.href = this.format(),
  31484. this
  31485. }
  31486. ,
  31487. x.prototype.format = function() {
  31488. var e = this.auth || "";
  31489. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31490. e += "@");
  31491. var t = this.protocol || ""
  31492. , i = this.pathname || ""
  31493. , n = this.hash || ""
  31494. , r = !1
  31495. , o = "";
  31496. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31497. this.port && (r += ":" + this.port)),
  31498. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31499. var a = this.search || o && "?" + o || "";
  31500. return t && ":" !== t.substr(-1) && (t += ":"),
  31501. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31502. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31503. n && "#" !== n.charAt(0) && (n = "#" + n),
  31504. a && "?" !== a.charAt(0) && (a = "?" + a),
  31505. t + r + (i = i.replace(/[?#]/g, function(e) {
  31506. return encodeURIComponent(e)
  31507. })) + (a = a.replace("#", "%23")) + n
  31508. }
  31509. ,
  31510. x.prototype.resolve = function(e) {
  31511. return this.resolveObject(n(e, !1, !0)).format()
  31512. }
  31513. ,
  31514. x.prototype.resolveObject = function(e) {
  31515. if (D.isString(e)) {
  31516. var t = new x;
  31517. t.parse(e, !1, !0),
  31518. e = t
  31519. }
  31520. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31521. var o = n[r];
  31522. i[o] = this[o]
  31523. }
  31524. if (i.hash = e.hash,
  31525. "" === e.href)
  31526. return i.href = i.format(),
  31527. i;
  31528. if (e.slashes && !e.protocol) {
  31529. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31530. var l = a[s];
  31531. "protocol" !== l && (i[l] = e[l])
  31532. }
  31533. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31534. i.href = i.format(),
  31535. i
  31536. }
  31537. if (e.protocol && e.protocol !== i.protocol) {
  31538. if (!W[e.protocol]) {
  31539. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31540. var u = c[h];
  31541. i[u] = e[u]
  31542. }
  31543. return i.href = i.format(),
  31544. i
  31545. }
  31546. if (i.protocol = e.protocol,
  31547. e.host || G[e.protocol])
  31548. i.pathname = e.pathname;
  31549. else {
  31550. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31551. ;
  31552. e.host || (e.host = ""),
  31553. e.hostname || (e.hostname = ""),
  31554. "" !== d[0] && d.unshift(""),
  31555. d.length < 2 && d.unshift(""),
  31556. i.pathname = d.join("/")
  31557. }
  31558. if (i.search = e.search,
  31559. i.query = e.query,
  31560. i.host = e.host || "",
  31561. i.auth = e.auth,
  31562. i.hostname = e.hostname || e.host,
  31563. i.port = e.port,
  31564. i.pathname || i.search) {
  31565. var p = i.pathname || ""
  31566. , f = i.search || "";
  31567. i.path = p + f
  31568. }
  31569. return i.slashes = i.slashes || e.slashes,
  31570. i.href = i.format(),
  31571. i
  31572. }
  31573. var g = i.pathname && "/" === i.pathname.charAt(0)
  31574. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31575. , v = m || g || i.host && e.pathname
  31576. , y = v
  31577. , A = i.pathname && i.pathname.split("/") || []
  31578. , C = (d = e.pathname && e.pathname.split("/") || [],
  31579. i.protocol && !W[i.protocol]);
  31580. if (C && (i.hostname = "",
  31581. i.port = null,
  31582. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31583. i.host = "",
  31584. e.protocol && (e.hostname = null,
  31585. e.port = null,
  31586. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31587. e.host = null),
  31588. v = v && ("" === d[0] || "" === A[0])),
  31589. m)
  31590. i.host = e.host || "" === e.host ? e.host : i.host,
  31591. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31592. i.search = e.search,
  31593. i.query = e.query,
  31594. A = d;
  31595. else if (d.length)
  31596. (A = A || []).pop(),
  31597. A = A.concat(d),
  31598. i.search = e.search,
  31599. i.query = e.query;
  31600. else if (!D.isNullOrUndefined(e.search)) {
  31601. if (C)
  31602. i.hostname = i.host = A.shift(),
  31603. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31604. i.host = i.hostname = w.shift());
  31605. return i.search = e.search,
  31606. i.query = e.query,
  31607. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31608. i.href = i.format(),
  31609. i
  31610. }
  31611. if (!A.length)
  31612. return i.pathname = null,
  31613. i.search ? i.path = "/" + i.search : i.path = null,
  31614. i.href = i.format(),
  31615. i;
  31616. 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--)
  31617. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31618. _++) : _ && (A.splice(b, 1),
  31619. _--);
  31620. if (!v && !y)
  31621. for (; _--; )
  31622. A.unshift("..");
  31623. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31624. E && "/" !== A.join("/").substr(-1) && A.push("");
  31625. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31626. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31627. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31628. i.host = i.hostname = w.shift()));
  31629. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31630. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31631. i.path = null),
  31632. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31633. i.auth = e.auth || i.auth,
  31634. i.slashes = i.slashes || e.slashes,
  31635. i.href = i.format(),
  31636. i
  31637. }
  31638. ,
  31639. x.prototype.parseHost = function() {
  31640. var e = this.host
  31641. , t = r.exec(e);
  31642. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31643. e = e.substr(0, e.length - t.length)),
  31644. e && (this.hostname = e)
  31645. }
  31646. }
  31647. , {
  31648. "./util": 209,
  31649. punycode: 204,
  31650. querystring: 207
  31651. }],
  31652. 209: [function(e, t, i) {
  31653. "use strict";
  31654. t.exports = {
  31655. isString: function(e) {
  31656. return "string" == typeof e
  31657. },
  31658. isObject: function(e) {
  31659. return "object" == typeof e && null !== e
  31660. },
  31661. isNull: function(e) {
  31662. return null === e
  31663. },
  31664. isNullOrUndefined: function(e) {
  31665. return null == e
  31666. }
  31667. }
  31668. }
  31669. , {}],
  31670. 210: [function(e, t, i) {
  31671. "use strict";
  31672. function r(e) {
  31673. return c + e
  31674. }
  31675. function s(e) {
  31676. if ("string" != typeof e)
  31677. throw new TypeError("key must be a string.")
  31678. }
  31679. var l = Object.prototype.hasOwnProperty
  31680. , c = "~";
  31681. t.exports = function(t) {
  31682. var o = Object.create(null)
  31683. , n = 0
  31684. , a = {};
  31685. return function(e, t) {
  31686. for (var i in t)
  31687. Object.defineProperty(e, i, {
  31688. value: t[i],
  31689. configurable: !0,
  31690. writable: !0
  31691. })
  31692. }(a, {
  31693. get: function(e, t) {
  31694. s(e);
  31695. var i = r(e);
  31696. return i in o ? o[i] : t
  31697. },
  31698. set: function(e, t) {
  31699. s(e);
  31700. var i = r(e);
  31701. return i in o || ++n,
  31702. o[i] = t
  31703. },
  31704. has: function(e) {
  31705. return s(e),
  31706. r(e)in o
  31707. },
  31708. delete: function(e) {
  31709. s(e);
  31710. var t = r(e);
  31711. return t in o && (--n,
  31712. delete o[t],
  31713. !0)
  31714. },
  31715. clear: function() {
  31716. o = Object.create(null),
  31717. n = 0
  31718. },
  31719. forEach: function(e, t) {
  31720. if ("function" != typeof e)
  31721. throw new TypeError("`callback` must be a function");
  31722. for (var i in o)
  31723. if (l.call(o, i)) {
  31724. var n = i.substring(c.length)
  31725. , r = o[i];
  31726. e.call(t, r, n, a)
  31727. }
  31728. }
  31729. }),
  31730. Object.defineProperty(a, "size", {
  31731. get: function() {
  31732. return n
  31733. },
  31734. configurable: !0
  31735. }),
  31736. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31737. a.set(e, t[e])
  31738. }),
  31739. a
  31740. }
  31741. }
  31742. , {}],
  31743. 211: [function(e, t, i) {
  31744. t.exports = e("./lib/heap")
  31745. }
  31746. , {
  31747. "./lib/heap": 212
  31748. }],
  31749. 212: [function(e, y, A) {
  31750. (function() {
  31751. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31752. function v(e) {
  31753. this.cmp = null != e ? e : d,
  31754. this.nodes = []
  31755. }
  31756. l = Math.floor,
  31757. m = Math.min,
  31758. d = function(e, t) {
  31759. return e < t ? -1 : t < e ? 1 : 0
  31760. }
  31761. ,
  31762. g = function(e, t, i, n, r) {
  31763. var o;
  31764. if (null == i && (i = 0),
  31765. null == r && (r = d),
  31766. i < 0)
  31767. throw new Error("lo must be non-negative");
  31768. for (null == n && (n = e.length); i < n; )
  31769. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31770. return [].splice.apply(e, [i, i - i].concat(t)),
  31771. t
  31772. }
  31773. ,
  31774. t = function(e, t, i) {
  31775. return null == i && (i = d),
  31776. e.push(t),
  31777. h(e, 0, e.length - 1, i)
  31778. }
  31779. ,
  31780. f = function(e, t) {
  31781. var i, n;
  31782. return null == t && (t = d),
  31783. i = e.pop(),
  31784. e.length ? (n = e[0],
  31785. e[0] = i,
  31786. u(e, 0, t)) : n = i,
  31787. n
  31788. }
  31789. ,
  31790. i = function(e, t, i) {
  31791. var n;
  31792. return null == i && (i = d),
  31793. n = e[0],
  31794. e[0] = t,
  31795. u(e, 0, i),
  31796. n
  31797. }
  31798. ,
  31799. c = function(e, t, i) {
  31800. var n;
  31801. return null == i && (i = d),
  31802. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31803. e[0] = n[1],
  31804. u(e, 0, i)),
  31805. t
  31806. }
  31807. ,
  31808. p = function(i, e) {
  31809. var t, n, r, o, a, s;
  31810. for (null == e && (e = d),
  31811. a = [],
  31812. n = 0,
  31813. r = (o = function() {
  31814. s = [];
  31815. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31816. s.push(e);
  31817. return s
  31818. }
  31819. .apply(this).reverse()).length; n < r; n++)
  31820. t = o[n],
  31821. a.push(u(i, t, e));
  31822. return a
  31823. }
  31824. ,
  31825. o = function(e, t, i) {
  31826. var n;
  31827. if (null == i && (i = d),
  31828. -1 !== (n = e.indexOf(t)))
  31829. return h(e, 0, n, i),
  31830. u(e, n, i)
  31831. }
  31832. ,
  31833. n = function(e, t, i) {
  31834. var n, r, o, a, s;
  31835. if (null == i && (i = d),
  31836. !(r = e.slice(0, t)).length)
  31837. return r;
  31838. for (p(r, i),
  31839. o = 0,
  31840. a = (s = e.slice(t)).length; o < a; o++)
  31841. n = s[o],
  31842. c(r, n, i);
  31843. return r.sort(i).reverse()
  31844. }
  31845. ,
  31846. r = function(e, t, i) {
  31847. var n, r, o, a, s, l, c, h, u;
  31848. if (null == i && (i = d),
  31849. 10 * t <= e.length) {
  31850. if (!(o = e.slice(0, t).sort(i)).length)
  31851. return o;
  31852. for (r = o[o.length - 1],
  31853. a = 0,
  31854. l = (c = e.slice(t)).length; a < l; a++)
  31855. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31856. o.pop(),
  31857. r = o[o.length - 1]);
  31858. return o
  31859. }
  31860. for (p(e, i),
  31861. u = [],
  31862. s = 0,
  31863. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31864. u.push(f(e, i));
  31865. return u
  31866. }
  31867. ,
  31868. h = function(e, t, i, n) {
  31869. var r, o, a;
  31870. for (null == n && (n = d),
  31871. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31872. e[i] = o,
  31873. i = a;
  31874. return e[i] = r
  31875. }
  31876. ,
  31877. u = function(e, t, i) {
  31878. var n, r, o, a, s;
  31879. for (null == i && (i = d),
  31880. r = e.length,
  31881. o = e[s = t],
  31882. n = 2 * t + 1; n < r; )
  31883. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31884. e[t] = e[n],
  31885. n = 2 * (t = n) + 1;
  31886. return e[t] = o,
  31887. h(e, s, t, i)
  31888. }
  31889. ,
  31890. v.push = t,
  31891. v.pop = f,
  31892. v.replace = i,
  31893. v.pushpop = c,
  31894. v.heapify = p,
  31895. v.updateItem = o,
  31896. v.nlargest = n,
  31897. v.nsmallest = r,
  31898. v.prototype.push = function(e) {
  31899. return t(this.nodes, e, this.cmp)
  31900. }
  31901. ,
  31902. v.prototype.pop = function() {
  31903. return f(this.nodes, this.cmp)
  31904. }
  31905. ,
  31906. v.prototype.peek = function() {
  31907. return this.nodes[0]
  31908. }
  31909. ,
  31910. v.prototype.contains = function(e) {
  31911. return -1 !== this.nodes.indexOf(e)
  31912. }
  31913. ,
  31914. v.prototype.replace = function(e) {
  31915. return i(this.nodes, e, this.cmp)
  31916. }
  31917. ,
  31918. v.prototype.pushpop = function(e) {
  31919. return c(this.nodes, e, this.cmp)
  31920. }
  31921. ,
  31922. v.prototype.heapify = function() {
  31923. return p(this.nodes, this.cmp)
  31924. }
  31925. ,
  31926. v.prototype.updateItem = function(e) {
  31927. return o(this.nodes, e, this.cmp)
  31928. }
  31929. ,
  31930. v.prototype.clear = function() {
  31931. return this.nodes = []
  31932. }
  31933. ,
  31934. v.prototype.empty = function() {
  31935. return 0 === this.nodes.length
  31936. }
  31937. ,
  31938. v.prototype.size = function() {
  31939. return this.nodes.length
  31940. }
  31941. ,
  31942. v.prototype.clone = function() {
  31943. var e;
  31944. return (e = new v).nodes = this.nodes.slice(0),
  31945. e
  31946. }
  31947. ,
  31948. v.prototype.toArray = function() {
  31949. return this.nodes.slice(0)
  31950. }
  31951. ,
  31952. v.prototype.insert = v.prototype.push,
  31953. v.prototype.top = v.prototype.peek,
  31954. v.prototype.front = v.prototype.peek,
  31955. v.prototype.has = v.prototype.contains,
  31956. v.prototype.copy = v.prototype.clone,
  31957. e = v,
  31958. a = this,
  31959. s = function() {
  31960. return e
  31961. }
  31962. ,
  31963. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31964. }
  31965. ).call(this)
  31966. }
  31967. , {}],
  31968. 213: [function(e, t, i) {
  31969. function n() {}
  31970. function o(e) {
  31971. if ("object" != typeof this)
  31972. throw new TypeError("Promises must be constructed via new");
  31973. if ("function" != typeof e)
  31974. throw new TypeError("not a function");
  31975. this._state = 0,
  31976. this._handled = !1,
  31977. this._value = void 0,
  31978. this._deferreds = [],
  31979. h(e, this)
  31980. }
  31981. function r(i, n) {
  31982. for (; 3 === i._state; )
  31983. i = i._value;
  31984. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31985. void o._immediateFn(function() {
  31986. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31987. if (null !== e) {
  31988. var t;
  31989. try {
  31990. t = e(i._value)
  31991. } catch (e) {
  31992. return void s(n.promise, e)
  31993. }
  31994. a(n.promise, t)
  31995. } else
  31996. (1 === i._state ? a : s)(n.promise, i._value)
  31997. }))
  31998. }
  31999. function a(e, t) {
  32000. try {
  32001. if (t === e)
  32002. throw new TypeError("A promise cannot be resolved with itself.");
  32003. if (t && ("object" == typeof t || "function" == typeof t)) {
  32004. var i = t.then;
  32005. if (t instanceof o)
  32006. return e._state = 3,
  32007. e._value = t,
  32008. void l(e);
  32009. if ("function" == typeof i)
  32010. return void h(function(e, t) {
  32011. return function() {
  32012. e.apply(t, arguments)
  32013. }
  32014. }(i, t), e)
  32015. }
  32016. e._state = 1,
  32017. e._value = t,
  32018. l(e)
  32019. } catch (t) {
  32020. s(e, t)
  32021. }
  32022. }
  32023. function s(e, t) {
  32024. e._state = 2,
  32025. e._value = t,
  32026. l(e)
  32027. }
  32028. function l(e) {
  32029. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32030. e._handled || o._unhandledRejectionFn(e._value)
  32031. });
  32032. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32033. r(e, e._deferreds[t]);
  32034. e._deferreds = null
  32035. }
  32036. function c(e, t, i) {
  32037. this.onFulfilled = "function" == typeof e ? e : null,
  32038. this.onRejected = "function" == typeof t ? t : null,
  32039. this.promise = i
  32040. }
  32041. function h(e, t) {
  32042. var i = !1;
  32043. try {
  32044. e(function(e) {
  32045. i || (i = !0,
  32046. a(t, e))
  32047. }, function(e) {
  32048. i || (i = !0,
  32049. s(t, e))
  32050. })
  32051. } catch (e) {
  32052. if (i)
  32053. return;
  32054. i = !0,
  32055. s(t, e)
  32056. }
  32057. }
  32058. var u, d;
  32059. u = this,
  32060. d = setTimeout,
  32061. o.prototype.catch = function(e) {
  32062. return this.then(null, e)
  32063. }
  32064. ,
  32065. o.prototype.then = function(e, t) {
  32066. var i = new this.constructor(n);
  32067. return r(this, new c(e,t,i)),
  32068. i
  32069. }
  32070. ,
  32071. o.all = function(e) {
  32072. var s = Array.prototype.slice.call(e);
  32073. return new o(function(n, r) {
  32074. function o(t, e) {
  32075. try {
  32076. if (e && ("object" == typeof e || "function" == typeof e)) {
  32077. var i = e.then;
  32078. if ("function" == typeof i)
  32079. return void i.call(e, function(e) {
  32080. o(t, e)
  32081. }, r)
  32082. }
  32083. s[t] = e,
  32084. 0 == --a && n(s)
  32085. } catch (e) {
  32086. r(e)
  32087. }
  32088. }
  32089. if (0 === s.length)
  32090. return n([]);
  32091. for (var a = s.length, e = 0; e < s.length; e++)
  32092. o(e, s[e])
  32093. }
  32094. )
  32095. }
  32096. ,
  32097. o.resolve = function(t) {
  32098. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32099. e(t)
  32100. }
  32101. )
  32102. }
  32103. ,
  32104. o.reject = function(i) {
  32105. return new o(function(e, t) {
  32106. t(i)
  32107. }
  32108. )
  32109. }
  32110. ,
  32111. o.race = function(r) {
  32112. return new o(function(e, t) {
  32113. for (var i = 0, n = r.length; i < n; i++)
  32114. r[i].then(e, t)
  32115. }
  32116. )
  32117. }
  32118. ,
  32119. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32120. setImmediate(e)
  32121. }
  32122. || function(e) {
  32123. d(e, 0)
  32124. }
  32125. ,
  32126. o._unhandledRejectionFn = function(e) {
  32127. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32128. }
  32129. ,
  32130. o._setImmediateFn = function(e) {
  32131. o._immediateFn = e
  32132. }
  32133. ,
  32134. o._setUnhandledRejectionFn = function(e) {
  32135. o._unhandledRejectionFn = e
  32136. }
  32137. ,
  32138. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32139. }
  32140. , {}],
  32141. 214: [function(p, i, e) {
  32142. (function(d) {
  32143. var e, t;
  32144. e = this,
  32145. t = function(I, e) {
  32146. "use strict";
  32147. var a, t, u, i, s, n, r, o = {};
  32148. return o.ByteBuffer = I,
  32149. o.Long = I.Long || null,
  32150. o.VERSION = "5.0.1",
  32151. o.WIRE_TYPES = {},
  32152. o.WIRE_TYPES.VARINT = 0,
  32153. o.WIRE_TYPES.BITS64 = 1,
  32154. o.WIRE_TYPES.LDELIM = 2,
  32155. o.WIRE_TYPES.STARTGROUP = 3,
  32156. o.WIRE_TYPES.ENDGROUP = 4,
  32157. o.WIRE_TYPES.BITS32 = 5,
  32158. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32159. o.TYPES = {
  32160. int32: {
  32161. name: "int32",
  32162. wireType: o.WIRE_TYPES.VARINT,
  32163. defaultValue: 0
  32164. },
  32165. uint32: {
  32166. name: "uint32",
  32167. wireType: o.WIRE_TYPES.VARINT,
  32168. defaultValue: 0
  32169. },
  32170. sint32: {
  32171. name: "sint32",
  32172. wireType: o.WIRE_TYPES.VARINT,
  32173. defaultValue: 0
  32174. },
  32175. int64: {
  32176. name: "int64",
  32177. wireType: o.WIRE_TYPES.VARINT,
  32178. defaultValue: o.Long ? o.Long.ZERO : void 0
  32179. },
  32180. uint64: {
  32181. name: "uint64",
  32182. wireType: o.WIRE_TYPES.VARINT,
  32183. defaultValue: o.Long ? o.Long.UZERO : void 0
  32184. },
  32185. sint64: {
  32186. name: "sint64",
  32187. wireType: o.WIRE_TYPES.VARINT,
  32188. defaultValue: o.Long ? o.Long.ZERO : void 0
  32189. },
  32190. bool: {
  32191. name: "bool",
  32192. wireType: o.WIRE_TYPES.VARINT,
  32193. defaultValue: !1
  32194. },
  32195. double: {
  32196. name: "double",
  32197. wireType: o.WIRE_TYPES.BITS64,
  32198. defaultValue: 0
  32199. },
  32200. string: {
  32201. name: "string",
  32202. wireType: o.WIRE_TYPES.LDELIM,
  32203. defaultValue: ""
  32204. },
  32205. bytes: {
  32206. name: "bytes",
  32207. wireType: o.WIRE_TYPES.LDELIM,
  32208. defaultValue: null
  32209. },
  32210. fixed32: {
  32211. name: "fixed32",
  32212. wireType: o.WIRE_TYPES.BITS32,
  32213. defaultValue: 0
  32214. },
  32215. sfixed32: {
  32216. name: "sfixed32",
  32217. wireType: o.WIRE_TYPES.BITS32,
  32218. defaultValue: 0
  32219. },
  32220. fixed64: {
  32221. name: "fixed64",
  32222. wireType: o.WIRE_TYPES.BITS64,
  32223. defaultValue: o.Long ? o.Long.UZERO : void 0
  32224. },
  32225. sfixed64: {
  32226. name: "sfixed64",
  32227. wireType: o.WIRE_TYPES.BITS64,
  32228. defaultValue: o.Long ? o.Long.ZERO : void 0
  32229. },
  32230. float: {
  32231. name: "float",
  32232. wireType: o.WIRE_TYPES.BITS32,
  32233. defaultValue: 0
  32234. },
  32235. enum: {
  32236. name: "enum",
  32237. wireType: o.WIRE_TYPES.VARINT,
  32238. defaultValue: 0
  32239. },
  32240. message: {
  32241. name: "message",
  32242. wireType: o.WIRE_TYPES.LDELIM,
  32243. defaultValue: null
  32244. },
  32245. group: {
  32246. name: "group",
  32247. wireType: o.WIRE_TYPES.STARTGROUP,
  32248. defaultValue: null
  32249. }
  32250. },
  32251. 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],
  32252. o.ID_MIN = 1,
  32253. o.ID_MAX = 536870911,
  32254. o.convertFieldsToCamelCase = !1,
  32255. o.populateAccessors = !0,
  32256. o.populateDefaults = !0,
  32257. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32258. r.XHR = function() {
  32259. for (var e = [function() {
  32260. return new XMLHttpRequest
  32261. }
  32262. , function() {
  32263. return new ActiveXObject("Msxml2.XMLHTTP")
  32264. }
  32265. , function() {
  32266. return new ActiveXObject("Msxml3.XMLHTTP")
  32267. }
  32268. , function() {
  32269. return new ActiveXObject("Microsoft.XMLHTTP")
  32270. }
  32271. ], t = null, i = 0; i < e.length; i++) {
  32272. try {
  32273. t = e[i]()
  32274. } catch (e) {
  32275. continue
  32276. }
  32277. break
  32278. }
  32279. if (!t)
  32280. throw Error("XMLHttpRequest is not supported");
  32281. return t
  32282. }
  32283. ,
  32284. r.fetch = function(e, i) {
  32285. if (i && "function" != typeof i && (i = null),
  32286. r.IS_NODE) {
  32287. var t = p("fs");
  32288. if (i)
  32289. t.readFile(e, function(e, t) {
  32290. i(e ? null : "" + t)
  32291. });
  32292. else
  32293. try {
  32294. return t.readFileSync(e)
  32295. } catch (e) {
  32296. return null
  32297. }
  32298. } else {
  32299. var n = r.XHR();
  32300. if (n.open("GET", e, !!i),
  32301. n.setRequestHeader("Accept", "text/plain"),
  32302. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32303. !i)
  32304. return n.send(null),
  32305. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32306. if (n.onreadystatechange = function() {
  32307. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32308. }
  32309. ,
  32310. 4 == n.readyState)
  32311. return;
  32312. n.send(null)
  32313. }
  32314. }
  32315. ,
  32316. r.toCamelCase = function(e) {
  32317. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32318. return t.toUpperCase()
  32319. })
  32320. }
  32321. ,
  32322. r),
  32323. o.Lang = {
  32324. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32325. RULE: /^(?:required|optional|repeated|map)$/,
  32326. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32327. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32328. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32329. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32330. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32331. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32332. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32333. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32334. NUMBER_OCT: /^0[0-7]+$/,
  32335. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32336. BOOL: /^(?:true|false)$/i,
  32337. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32338. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32339. WHITESPACE: /\s/,
  32340. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32341. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32342. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32343. },
  32344. o.DotProto = function(r, a) {
  32345. function s(e, t) {
  32346. var i = -1
  32347. , n = 1;
  32348. if ("-" == e.charAt(0) && (n = -1,
  32349. e = e.substring(1)),
  32350. a.NUMBER_DEC.test(e))
  32351. i = parseInt(e);
  32352. else if (a.NUMBER_HEX.test(e))
  32353. i = parseInt(e.substring(2), 16);
  32354. else {
  32355. if (!a.NUMBER_OCT.test(e))
  32356. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32357. i = parseInt(e.substring(1), 8)
  32358. }
  32359. if (i = n * i | 0,
  32360. !t && i < 0)
  32361. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32362. return i
  32363. }
  32364. function o(e) {
  32365. var t = 1;
  32366. if ("-" == e.charAt(0) && (t = -1,
  32367. e = e.substring(1)),
  32368. a.NUMBER_DEC.test(e))
  32369. return t * parseInt(e, 10);
  32370. if (a.NUMBER_HEX.test(e))
  32371. return t * parseInt(e.substring(2), 16);
  32372. if (a.NUMBER_OCT.test(e))
  32373. return t * parseInt(e.substring(1), 8);
  32374. if ("inf" === e)
  32375. return t * (1 / 0);
  32376. if ("nan" === e)
  32377. return NaN;
  32378. if (a.NUMBER_FLT.test(e))
  32379. return t * parseFloat(e);
  32380. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32381. }
  32382. function n(e, t, i) {
  32383. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32384. e[t].push(i))
  32385. }
  32386. function t(e) {
  32387. this.source = e + "",
  32388. this.index = 0,
  32389. this.line = 1,
  32390. this.stack = [],
  32391. this._stringOpen = null
  32392. }
  32393. var e = {}
  32394. , i = t.prototype;
  32395. i._readString = function() {
  32396. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32397. e.lastIndex = this.index - 1;
  32398. var t = e.exec(this.source);
  32399. if (!t)
  32400. throw Error("unterminated string");
  32401. return this.index = e.lastIndex,
  32402. this.stack.push(this._stringOpen),
  32403. this._stringOpen = null,
  32404. t[1]
  32405. }
  32406. ,
  32407. i.next = function() {
  32408. if (0 < this.stack.length)
  32409. return this.stack.shift();
  32410. if (this.index >= this.source.length)
  32411. return null;
  32412. if (null !== this._stringOpen)
  32413. return this._readString();
  32414. var e, t, i;
  32415. do {
  32416. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32417. if ("\n" === i && ++this.line,
  32418. ++this.index === this.source.length)
  32419. return null;
  32420. if ("/" === this.source.charAt(this.index))
  32421. if (++this.index,
  32422. "/" === this.source.charAt(this.index)) {
  32423. for (; "\n" !== this.source.charAt(++this.index); )
  32424. if (this.index == this.source.length)
  32425. return null;
  32426. ++this.index,
  32427. ++this.line,
  32428. e = !0
  32429. } else {
  32430. if ("*" !== (i = this.source.charAt(this.index)))
  32431. return "/";
  32432. do {
  32433. if ("\n" === i && ++this.line,
  32434. ++this.index === this.source.length)
  32435. return null;
  32436. t = i,
  32437. i = this.source.charAt(this.index)
  32438. } while ("*" !== t || "/" !== i);++this.index,
  32439. e = !0
  32440. }
  32441. } while (e);if (this.index === this.source.length)
  32442. return null;
  32443. var n = this.index;
  32444. if (a.DELIM.lastIndex = 0,
  32445. !a.DELIM.test(this.source.charAt(n++)))
  32446. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32447. ++n;
  32448. var r = this.source.substring(this.index, this.index = n);
  32449. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32450. r
  32451. }
  32452. ,
  32453. i.peek = function() {
  32454. if (0 === this.stack.length) {
  32455. var e = this.next();
  32456. if (null === e)
  32457. return null;
  32458. this.stack.push(e)
  32459. }
  32460. return this.stack[0]
  32461. }
  32462. ,
  32463. i.skip = function(e) {
  32464. var t = this.next();
  32465. if (t !== e)
  32466. throw Error("illegal '" + t + "', '" + e + "' expected")
  32467. }
  32468. ,
  32469. i.omit = function(e) {
  32470. return this.peek() === e && (this.next(),
  32471. !0)
  32472. }
  32473. ,
  32474. i.toString = function() {
  32475. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32476. }
  32477. ,
  32478. e.Tokenizer = t;
  32479. function l(e) {
  32480. this.tn = new t(e),
  32481. this.proto3 = !1
  32482. }
  32483. var c = l.prototype;
  32484. return c.parse = function() {
  32485. var e, t, i = {
  32486. name: "[ROOT]",
  32487. package: null,
  32488. messages: [],
  32489. enums: [],
  32490. imports: [],
  32491. options: {},
  32492. services: []
  32493. }, n = !0;
  32494. try {
  32495. for (; e = this.tn.next(); )
  32496. switch (e) {
  32497. case "package":
  32498. if (!n || null !== i.package)
  32499. throw Error("unexpected 'package'");
  32500. if (e = this.tn.next(),
  32501. !a.TYPEREF.test(e))
  32502. throw Error("illegal package name: " + e);
  32503. this.tn.skip(";"),
  32504. i.package = e;
  32505. break;
  32506. case "import":
  32507. if (!n)
  32508. throw Error("unexpected 'import'");
  32509. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32510. e = this._readString(),
  32511. this.tn.skip(";"),
  32512. t || i.imports.push(e);
  32513. break;
  32514. case "syntax":
  32515. if (!n)
  32516. throw Error("unexpected 'syntax'");
  32517. this.tn.skip("="),
  32518. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32519. this.tn.skip(";");
  32520. break;
  32521. case "message":
  32522. this._parseMessage(i, null),
  32523. n = !1;
  32524. break;
  32525. case "enum":
  32526. this._parseEnum(i),
  32527. n = !1;
  32528. break;
  32529. case "option":
  32530. this._parseOption(i);
  32531. break;
  32532. case "service":
  32533. this._parseService(i);
  32534. break;
  32535. case "extend":
  32536. this._parseExtend(i);
  32537. break;
  32538. default:
  32539. throw Error("unexpected '" + e + "'")
  32540. }
  32541. } catch (e) {
  32542. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32543. e
  32544. }
  32545. return delete i.name,
  32546. i
  32547. }
  32548. ,
  32549. l.parse = function(e) {
  32550. return new l(e).parse()
  32551. }
  32552. ,
  32553. c._readString = function() {
  32554. var e, t, i = "";
  32555. do {
  32556. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32557. throw Error("illegal string delimiter: " + t);
  32558. i += this.tn.next(),
  32559. this.tn.skip(t),
  32560. e = this.tn.peek()
  32561. } while ('"' === e || '"' === e);return i
  32562. }
  32563. ,
  32564. c._readValue = function(e) {
  32565. var t = this.tn.peek();
  32566. if ('"' === t || "'" === t)
  32567. return this._readString();
  32568. if (this.tn.next(),
  32569. a.NUMBER.test(t))
  32570. return o(t);
  32571. if (a.BOOL.test(t))
  32572. return "true" === t.toLowerCase();
  32573. if (e && a.TYPEREF.test(t))
  32574. return t;
  32575. throw Error("illegal value: " + t)
  32576. }
  32577. ,
  32578. c._parseOption = function(e, t) {
  32579. var i = this.tn.next()
  32580. , n = !1;
  32581. if ("(" === i && (n = !0,
  32582. i = this.tn.next()),
  32583. !a.TYPEREF.test(i))
  32584. throw Error("illegal option name: " + i);
  32585. var r = i;
  32586. n && (this.tn.skip(")"),
  32587. r = "(" + r + ")",
  32588. i = this.tn.peek(),
  32589. a.FQTYPEREF.test(i) && (r += i,
  32590. this.tn.next())),
  32591. this.tn.skip("="),
  32592. this._parseOptionValue(e, r),
  32593. t || this.tn.skip(";")
  32594. }
  32595. ,
  32596. c._parseOptionValue = function(e, t) {
  32597. var i = this.tn.peek();
  32598. if ("{" !== i)
  32599. n(e.options, t, this._readValue(!0));
  32600. else
  32601. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32602. if (!a.NAME.test(i))
  32603. throw Error("illegal option name: " + t + "." + i);
  32604. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32605. }
  32606. }
  32607. ,
  32608. c._parseService = function(e) {
  32609. var t = this.tn.next();
  32610. if (!a.NAME.test(t))
  32611. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32612. var i = {
  32613. name: t,
  32614. rpc: {},
  32615. options: {}
  32616. };
  32617. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32618. if ("option" === t)
  32619. this._parseOption(i);
  32620. else {
  32621. if ("rpc" !== t)
  32622. throw Error("illegal service token: " + t);
  32623. this._parseServiceRPC(i)
  32624. }
  32625. this.tn.omit(";"),
  32626. e.services.push(i)
  32627. }
  32628. ,
  32629. c._parseServiceRPC = function(e) {
  32630. var t = this.tn.next();
  32631. if (!a.NAME.test(t))
  32632. throw Error("illegal rpc service method name: " + t);
  32633. var i = t
  32634. , n = {
  32635. request: null,
  32636. response: null,
  32637. request_stream: !1,
  32638. response_stream: !1,
  32639. options: {}
  32640. };
  32641. if (this.tn.skip("("),
  32642. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32643. t = this.tn.next()),
  32644. !a.TYPEREF.test(t))
  32645. throw Error("illegal rpc service request type: " + t);
  32646. if (n.request = t,
  32647. this.tn.skip(")"),
  32648. "returns" !== (t = this.tn.next()).toLowerCase())
  32649. throw Error("illegal rpc service request type delimiter: " + t);
  32650. if (this.tn.skip("("),
  32651. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32652. t = this.tn.next()),
  32653. n.response = t,
  32654. this.tn.skip(")"),
  32655. "{" === (t = this.tn.peek())) {
  32656. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32657. if ("option" !== t)
  32658. throw Error("illegal rpc service token: " + t);
  32659. this._parseOption(n)
  32660. }
  32661. this.tn.omit(";")
  32662. } else
  32663. this.tn.skip(";");
  32664. void 0 === e.rpc && (e.rpc = {}),
  32665. e.rpc[i] = n
  32666. }
  32667. ,
  32668. c._parseMessage = function(e, t) {
  32669. var i = !!t
  32670. , n = this.tn.next()
  32671. , r = {
  32672. name: "",
  32673. fields: [],
  32674. enums: [],
  32675. messages: [],
  32676. options: {},
  32677. services: [],
  32678. oneofs: {}
  32679. };
  32680. if (!a.NAME.test(n))
  32681. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32682. for (r.name = n,
  32683. i && (this.tn.skip("="),
  32684. t.id = s(this.tn.next()),
  32685. r.isGroup = !0),
  32686. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32687. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32688. if (a.RULE.test(n))
  32689. this._parseMessageField(r, n);
  32690. else if ("oneof" === n)
  32691. this._parseMessageOneOf(r);
  32692. else if ("enum" === n)
  32693. this._parseEnum(r);
  32694. else if ("message" === n)
  32695. this._parseMessage(r);
  32696. else if ("option" === n)
  32697. this._parseOption(r);
  32698. else if ("service" === n)
  32699. this._parseService(r);
  32700. else if ("extensions" === n)
  32701. r.extensions = this._parseExtensionRanges();
  32702. else if ("reserved" === n)
  32703. this._parseIgnored();
  32704. else if ("extend" === n)
  32705. this._parseExtend(r);
  32706. else {
  32707. if (!a.TYPEREF.test(n))
  32708. throw Error("illegal message token: " + n);
  32709. if (!this.proto3)
  32710. throw Error("illegal field rule: " + n);
  32711. this._parseMessageField(r, "optional", n)
  32712. }
  32713. return this.tn.omit(";"),
  32714. e.messages.push(r),
  32715. r
  32716. }
  32717. ,
  32718. c._parseIgnored = function() {
  32719. for (; ";" !== this.tn.peek(); )
  32720. this.tn.next();
  32721. this.tn.skip(";")
  32722. }
  32723. ,
  32724. c._parseMessageField = function(e, t, i) {
  32725. if (!a.RULE.test(t))
  32726. throw Error("illegal message field rule: " + t);
  32727. var n, r = {
  32728. rule: t,
  32729. type: "",
  32730. name: "",
  32731. options: {},
  32732. id: 0
  32733. };
  32734. if ("map" === t) {
  32735. if (i)
  32736. throw Error("illegal type: " + i);
  32737. if (this.tn.skip("<"),
  32738. n = this.tn.next(),
  32739. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32740. throw Error("illegal message field type: " + n);
  32741. if (r.keytype = n,
  32742. this.tn.skip(","),
  32743. n = this.tn.next(),
  32744. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32745. throw Error("illegal message field: " + n);
  32746. if (r.type = n,
  32747. this.tn.skip(">"),
  32748. n = this.tn.next(),
  32749. !a.NAME.test(n))
  32750. throw Error("illegal message field name: " + n);
  32751. r.name = n,
  32752. this.tn.skip("="),
  32753. r.id = s(this.tn.next()),
  32754. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32755. this.tn.skip(";")
  32756. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32757. var o = this._parseMessage(e, r);
  32758. if (!/^[A-Z]/.test(o.name))
  32759. throw Error("illegal group name: " + o.name);
  32760. r.type = o.name,
  32761. r.name = o.name.toLowerCase(),
  32762. this.tn.omit(";")
  32763. } else {
  32764. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32765. throw Error("illegal message field type: " + i);
  32766. if (r.type = i,
  32767. n = this.tn.next(),
  32768. !a.NAME.test(n))
  32769. throw Error("illegal message field name: " + n);
  32770. r.name = n,
  32771. this.tn.skip("="),
  32772. r.id = s(this.tn.next()),
  32773. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32774. this.tn.skip(";")
  32775. }
  32776. return e.fields.push(r),
  32777. r
  32778. }
  32779. ,
  32780. c._parseMessageOneOf = function(e) {
  32781. var t = this.tn.next();
  32782. if (!a.NAME.test(t))
  32783. throw Error("illegal oneof name: " + t);
  32784. var i, n = t, r = [];
  32785. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32786. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32787. r.push(i.id);
  32788. this.tn.omit(";"),
  32789. e.oneofs[n] = r
  32790. }
  32791. ,
  32792. c._parseFieldOptions = function(e) {
  32793. this.tn.skip("[");
  32794. for (var t = !0; "]" !== this.tn.peek(); )
  32795. t || this.tn.skip(","),
  32796. this._parseOption(e, !0),
  32797. t = !1;
  32798. this.tn.next()
  32799. }
  32800. ,
  32801. c._parseEnum = function(e) {
  32802. var t = {
  32803. name: "",
  32804. values: [],
  32805. options: {}
  32806. }
  32807. , i = this.tn.next();
  32808. if (!a.NAME.test(i))
  32809. throw Error("illegal name: " + i);
  32810. for (t.name = i,
  32811. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32812. if ("option" === i)
  32813. this._parseOption(t);
  32814. else {
  32815. if (!a.NAME.test(i))
  32816. throw Error("illegal name: " + i);
  32817. this.tn.skip("=");
  32818. var n = {
  32819. name: i,
  32820. id: s(this.tn.next(), !0)
  32821. };
  32822. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32823. options: {}
  32824. }),
  32825. this.tn.skip(";"),
  32826. t.values.push(n)
  32827. }
  32828. this.tn.omit(";"),
  32829. e.enums.push(t)
  32830. }
  32831. ,
  32832. c._parseExtensionRanges = function() {
  32833. var e, t, i, n = [];
  32834. do {
  32835. for (t = []; ; ) {
  32836. switch (e = this.tn.next()) {
  32837. case "min":
  32838. i = r.ID_MIN;
  32839. break;
  32840. case "max":
  32841. i = r.ID_MAX;
  32842. break;
  32843. default:
  32844. i = o(e)
  32845. }
  32846. if (t.push(i),
  32847. 2 === t.length)
  32848. break;
  32849. if ("to" !== this.tn.peek()) {
  32850. t.push(i);
  32851. break
  32852. }
  32853. this.tn.next()
  32854. }
  32855. n.push(t)
  32856. } while (this.tn.omit(","));return this.tn.skip(";"),
  32857. n
  32858. }
  32859. ,
  32860. c._parseExtend = function(e) {
  32861. var t = this.tn.next();
  32862. if (!a.TYPEREF.test(t))
  32863. throw Error("illegal extend reference: " + t);
  32864. var i = {
  32865. ref: t,
  32866. fields: []
  32867. };
  32868. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32869. if (a.RULE.test(t))
  32870. this._parseMessageField(i, t);
  32871. else {
  32872. if (!a.TYPEREF.test(t))
  32873. throw Error("illegal extend token: " + t);
  32874. if (!this.proto3)
  32875. throw Error("illegal field rule: " + t);
  32876. this._parseMessageField(i, "optional", t)
  32877. }
  32878. return this.tn.omit(";"),
  32879. e.messages.push(i),
  32880. i
  32881. }
  32882. ,
  32883. c.toString = function() {
  32884. return "Parser at line " + this.tn.line
  32885. }
  32886. ,
  32887. e.Parser = l,
  32888. e
  32889. }(o, o.Lang),
  32890. o.Reflect = function(g) {
  32891. function a(e, t) {
  32892. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32893. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32894. if ("string" == typeof e)
  32895. return g.Long.fromString(e, t || !1, 10);
  32896. if ("number" == typeof e)
  32897. return g.Long.fromNumber(e, t || !1);
  32898. throw Error("not convertible to Long")
  32899. }
  32900. function m(e, t) {
  32901. var i = t.readVarint32()
  32902. , n = 7 & i
  32903. , r = i >>> 3;
  32904. switch (n) {
  32905. case g.WIRE_TYPES.VARINT:
  32906. for (; 128 == (128 & (i = t.readUint8())); )
  32907. ;
  32908. break;
  32909. case g.WIRE_TYPES.BITS64:
  32910. t.offset += 8;
  32911. break;
  32912. case g.WIRE_TYPES.LDELIM:
  32913. i = t.readVarint32(),
  32914. t.offset += i;
  32915. break;
  32916. case g.WIRE_TYPES.STARTGROUP:
  32917. m(r, t);
  32918. break;
  32919. case g.WIRE_TYPES.ENDGROUP:
  32920. if (r === e)
  32921. return !1;
  32922. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32923. case g.WIRE_TYPES.BITS32:
  32924. t.offset += 4;
  32925. break;
  32926. default:
  32927. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32928. }
  32929. return !0
  32930. }
  32931. function h(e, t, i) {
  32932. this.builder = e,
  32933. this.parent = t,
  32934. this.name = i,
  32935. this.className
  32936. }
  32937. var s = {}
  32938. , e = h.prototype;
  32939. e.fqn = function() {
  32940. for (var e = this.name, t = this; null != (t = t.parent); )
  32941. e = t.name + "." + e;
  32942. return e
  32943. }
  32944. ,
  32945. e.toString = function(e) {
  32946. return (e ? this.className + " " : "") + this.fqn()
  32947. }
  32948. ,
  32949. e.build = function() {
  32950. throw Error(this.toString(!0) + " cannot be built directly")
  32951. }
  32952. ,
  32953. s.T = h;
  32954. function l(e, t, i, n, r) {
  32955. h.call(this, e, t, i),
  32956. this.className = "Namespace",
  32957. this.children = [],
  32958. this.options = n || {},
  32959. this.syntax = r || "proto2"
  32960. }
  32961. var t = l.prototype = Object.create(h.prototype);
  32962. t.getChildren = function(e) {
  32963. if (null == (e = e || null))
  32964. return this.children.slice();
  32965. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32966. this.children[i]instanceof e && t.push(this.children[i]);
  32967. return t
  32968. }
  32969. ,
  32970. t.addChild = function(e) {
  32971. var t;
  32972. if (t = this.getChild(e.name))
  32973. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32974. t.name = t.originalName;
  32975. else {
  32976. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32977. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32978. e.name = e.originalName
  32979. }
  32980. this.children.push(e)
  32981. }
  32982. ,
  32983. t.getChild = function(e) {
  32984. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32985. if (this.children[i][t] === e)
  32986. return this.children[i];
  32987. return null
  32988. }
  32989. ,
  32990. t.resolve = function(e, t) {
  32991. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32992. if ("" === n[o]) {
  32993. for (; null !== r.parent; )
  32994. r = r.parent;
  32995. o++
  32996. }
  32997. do {
  32998. do {
  32999. if (!(r instanceof s.Namespace)) {
  33000. r = null;
  33001. break
  33002. }
  33003. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33004. r = null;
  33005. break
  33006. }
  33007. r = i,
  33008. o++
  33009. } while (o < n.length);if (null != r)
  33010. break;
  33011. if (null !== this.parent)
  33012. return this.parent.resolve(e, t)
  33013. } while (null != r);return r
  33014. }
  33015. ,
  33016. t.qn = function(e) {
  33017. for (var t = [], i = e; t.unshift(i.name),
  33018. null !== (i = i.parent); )
  33019. ;
  33020. for (var n = 1; n <= t.length; n++) {
  33021. var r = t.slice(t.length - n);
  33022. if (e === this.resolve(r, e instanceof s.Namespace))
  33023. return r.join(".")
  33024. }
  33025. return e.fqn()
  33026. }
  33027. ,
  33028. t.build = function() {
  33029. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33030. (e = i[n])instanceof l && (t[e.name] = e.build());
  33031. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33032. value: this.buildOpt()
  33033. }),
  33034. t
  33035. }
  33036. ,
  33037. t.buildOpt = function() {
  33038. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33039. var r = t[i]
  33040. , o = this.options[t[i]];
  33041. e[r] = o
  33042. }
  33043. return e
  33044. }
  33045. ,
  33046. t.getOption = function(e) {
  33047. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33048. }
  33049. ,
  33050. s.Namespace = l;
  33051. function u(e, t, i, n) {
  33052. if (this.type = e,
  33053. this.resolvedType = t,
  33054. this.isMapKey = i,
  33055. this.syntax = n,
  33056. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33057. throw Error("Invalid map key type: " + e.name)
  33058. }
  33059. var i = u.prototype;
  33060. u.defaultFieldValue = function(e) {
  33061. if ("string" == typeof e && (e = g.TYPES[e]),
  33062. void 0 === e.defaultValue)
  33063. throw Error("default value for type " + e.name + " is not supported");
  33064. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33065. }
  33066. ,
  33067. i.verifyValue = function(t) {
  33068. function i(e, t) {
  33069. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33070. }
  33071. var n = this;
  33072. switch (this.type) {
  33073. case g.TYPES.int32:
  33074. case g.TYPES.sint32:
  33075. case g.TYPES.sfixed32:
  33076. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33077. 4294967295 < t ? 0 | t : t;
  33078. case g.TYPES.uint32:
  33079. case g.TYPES.fixed32:
  33080. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33081. t < 0 ? t >>> 0 : t;
  33082. case g.TYPES.int64:
  33083. case g.TYPES.sint64:
  33084. case g.TYPES.sfixed64:
  33085. if (g.Long)
  33086. try {
  33087. return a(t, !1)
  33088. } catch (e) {
  33089. i(typeof t, e.message)
  33090. }
  33091. else
  33092. i(typeof t, "requires Long.js");
  33093. case g.TYPES.uint64:
  33094. case g.TYPES.fixed64:
  33095. if (g.Long)
  33096. try {
  33097. return a(t, !0)
  33098. } catch (e) {
  33099. i(typeof t, e.message)
  33100. }
  33101. else
  33102. i(typeof t, "requires Long.js");
  33103. case g.TYPES.bool:
  33104. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33105. t;
  33106. case g.TYPES.float:
  33107. case g.TYPES.double:
  33108. return "number" != typeof t && i(typeof t, "not a number"),
  33109. t;
  33110. case g.TYPES.string:
  33111. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33112. "" + t;
  33113. case g.TYPES.bytes:
  33114. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33115. case g.TYPES.enum:
  33116. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33117. for (o = 0; o < e.length; o++) {
  33118. if (e[o].name == t)
  33119. return e[o].id;
  33120. if (e[o].id == t)
  33121. return e[o].id
  33122. }
  33123. if ("proto3" === this.syntax)
  33124. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33125. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33126. t;
  33127. i(t, "not a valid enum value");
  33128. case g.TYPES.group:
  33129. case g.TYPES.message:
  33130. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33131. t instanceof this.resolvedType.clazz)
  33132. return t;
  33133. if (t instanceof g.Builder.Message) {
  33134. var r = {};
  33135. for (var o in t)
  33136. t.hasOwnProperty(o) && (r[o] = t[o]);
  33137. t = r
  33138. }
  33139. return new this.resolvedType.clazz(t)
  33140. }
  33141. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33142. }
  33143. ,
  33144. i.calculateLength = function(e, t) {
  33145. if (null === t)
  33146. return 0;
  33147. var i;
  33148. switch (this.type) {
  33149. case g.TYPES.int32:
  33150. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33151. case g.TYPES.uint32:
  33152. return I.calculateVarint32(t);
  33153. case g.TYPES.sint32:
  33154. return I.calculateVarint32(I.zigZagEncode32(t));
  33155. case g.TYPES.fixed32:
  33156. case g.TYPES.sfixed32:
  33157. case g.TYPES.float:
  33158. return 4;
  33159. case g.TYPES.int64:
  33160. case g.TYPES.uint64:
  33161. return I.calculateVarint64(t);
  33162. case g.TYPES.sint64:
  33163. return I.calculateVarint64(I.zigZagEncode64(t));
  33164. case g.TYPES.fixed64:
  33165. case g.TYPES.sfixed64:
  33166. return 8;
  33167. case g.TYPES.bool:
  33168. return 1;
  33169. case g.TYPES.enum:
  33170. return I.calculateVarint32(t);
  33171. case g.TYPES.double:
  33172. return 8;
  33173. case g.TYPES.string:
  33174. return i = I.calculateUTF8Bytes(t),
  33175. I.calculateVarint32(i) + i;
  33176. case g.TYPES.bytes:
  33177. if (t.remaining() < 0)
  33178. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33179. return I.calculateVarint32(t.remaining()) + t.remaining();
  33180. case g.TYPES.message:
  33181. return i = this.resolvedType.calculate(t),
  33182. I.calculateVarint32(i) + i;
  33183. case g.TYPES.group:
  33184. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33185. }
  33186. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33187. }
  33188. ,
  33189. i.encodeValue = function(e, t, i) {
  33190. if (null === t)
  33191. return i;
  33192. switch (this.type) {
  33193. case g.TYPES.int32:
  33194. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33195. break;
  33196. case g.TYPES.uint32:
  33197. i.writeVarint32(t);
  33198. break;
  33199. case g.TYPES.sint32:
  33200. i.writeVarint32ZigZag(t);
  33201. break;
  33202. case g.TYPES.fixed32:
  33203. i.writeUint32(t);
  33204. break;
  33205. case g.TYPES.sfixed32:
  33206. i.writeInt32(t);
  33207. break;
  33208. case g.TYPES.int64:
  33209. case g.TYPES.uint64:
  33210. i.writeVarint64(t);
  33211. break;
  33212. case g.TYPES.sint64:
  33213. i.writeVarint64ZigZag(t);
  33214. break;
  33215. case g.TYPES.fixed64:
  33216. i.writeUint64(t);
  33217. break;
  33218. case g.TYPES.sfixed64:
  33219. i.writeInt64(t);
  33220. break;
  33221. case g.TYPES.bool:
  33222. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33223. break;
  33224. case g.TYPES.enum:
  33225. i.writeVarint32(t);
  33226. break;
  33227. case g.TYPES.float:
  33228. i.writeFloat32(t);
  33229. break;
  33230. case g.TYPES.double:
  33231. i.writeFloat64(t);
  33232. break;
  33233. case g.TYPES.string:
  33234. i.writeVString(t);
  33235. break;
  33236. case g.TYPES.bytes:
  33237. if (t.remaining() < 0)
  33238. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33239. var n = t.offset;
  33240. i.writeVarint32(t.remaining()),
  33241. i.append(t),
  33242. t.offset = n;
  33243. break;
  33244. case g.TYPES.message:
  33245. var r = (new I).LE();
  33246. this.resolvedType.encode(t, r),
  33247. i.writeVarint32(r.offset),
  33248. i.append(r.flip());
  33249. break;
  33250. case g.TYPES.group:
  33251. this.resolvedType.encode(t, i),
  33252. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33253. break;
  33254. default:
  33255. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33256. }
  33257. return i
  33258. }
  33259. ,
  33260. i.decode = function(e, t, i) {
  33261. if (t != this.type.wireType)
  33262. throw Error("Unexpected wire type for element");
  33263. var n, r;
  33264. switch (this.type) {
  33265. case g.TYPES.int32:
  33266. return 0 | e.readVarint32();
  33267. case g.TYPES.uint32:
  33268. return e.readVarint32() >>> 0;
  33269. case g.TYPES.sint32:
  33270. return 0 | e.readVarint32ZigZag();
  33271. case g.TYPES.fixed32:
  33272. return e.readUint32() >>> 0;
  33273. case g.TYPES.sfixed32:
  33274. return 0 | e.readInt32();
  33275. case g.TYPES.int64:
  33276. return e.readVarint64();
  33277. case g.TYPES.uint64:
  33278. return e.readVarint64().toUnsigned();
  33279. case g.TYPES.sint64:
  33280. return e.readVarint64ZigZag();
  33281. case g.TYPES.fixed64:
  33282. return e.readUint64();
  33283. case g.TYPES.sfixed64:
  33284. return e.readInt64();
  33285. case g.TYPES.bool:
  33286. return !!e.readVarint32();
  33287. case g.TYPES.enum:
  33288. return e.readVarint32();
  33289. case g.TYPES.float:
  33290. return e.readFloat();
  33291. case g.TYPES.double:
  33292. return e.readDouble();
  33293. case g.TYPES.string:
  33294. return e.readVString();
  33295. case g.TYPES.bytes:
  33296. if (r = e.readVarint32(),
  33297. e.remaining() < r)
  33298. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33299. return (n = e.clone()).limit = n.offset + r,
  33300. e.offset += r,
  33301. n;
  33302. case g.TYPES.message:
  33303. return r = e.readVarint32(),
  33304. this.resolvedType.decode(e, r);
  33305. case g.TYPES.group:
  33306. return this.resolvedType.decode(e, -1, i)
  33307. }
  33308. throw Error("[INTERNAL] Illegal decode type")
  33309. }
  33310. ,
  33311. i.valueFromString = function(e) {
  33312. if (!this.isMapKey)
  33313. throw Error("valueFromString() called on non-map-key element");
  33314. switch (this.type) {
  33315. case g.TYPES.int32:
  33316. case g.TYPES.sint32:
  33317. case g.TYPES.sfixed32:
  33318. case g.TYPES.uint32:
  33319. case g.TYPES.fixed32:
  33320. return this.verifyValue(parseInt(e));
  33321. case g.TYPES.int64:
  33322. case g.TYPES.sint64:
  33323. case g.TYPES.sfixed64:
  33324. case g.TYPES.uint64:
  33325. case g.TYPES.fixed64:
  33326. return this.verifyValue(e);
  33327. case g.TYPES.bool:
  33328. return "true" === e;
  33329. case g.TYPES.string:
  33330. return this.verifyValue(e);
  33331. case g.TYPES.bytes:
  33332. return I.fromBinary(e)
  33333. }
  33334. }
  33335. ,
  33336. i.valueToString = function(e) {
  33337. if (!this.isMapKey)
  33338. throw Error("valueToString() called on non-map-key element");
  33339. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33340. }
  33341. ,
  33342. s.Element = u;
  33343. var d = function(e, t, i, n, r, o) {
  33344. l.call(this, e, t, i, n, o),
  33345. this.className = "Message",
  33346. this.extensions = void 0,
  33347. this.clazz = null,
  33348. this.isGroup = !!r,
  33349. this._fields = null,
  33350. this._fieldsById = null,
  33351. this._fieldsByName = null
  33352. }
  33353. , n = d.prototype = Object.create(l.prototype);
  33354. n.build = function(e) {
  33355. if (this.clazz && !e)
  33356. return this.clazz;
  33357. var t = function(u, a) {
  33358. function d(e, i, n, r) {
  33359. if (null === e || "object" != typeof e) {
  33360. if (r && r instanceof u.Reflect.Enum) {
  33361. var t = u.Reflect.Enum.getName(r.object, e);
  33362. if (null !== t)
  33363. return t
  33364. }
  33365. return e
  33366. }
  33367. if (I.isByteBuffer(e))
  33368. return i ? e.toBase64() : e.toBuffer();
  33369. if (u.Long.isLong(e))
  33370. return n ? e.toString() : u.Long.fromValue(e);
  33371. var o;
  33372. if (Array.isArray(e))
  33373. return o = [],
  33374. e.forEach(function(e, t) {
  33375. o[t] = d(e, i, n, r)
  33376. }),
  33377. o;
  33378. if (o = {},
  33379. e instanceof u.Map) {
  33380. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33381. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33382. return o
  33383. }
  33384. var l = e.$type
  33385. , c = void 0;
  33386. for (var h in e)
  33387. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33388. return o
  33389. }
  33390. var s = a.getChildren(u.Reflect.Message.Field)
  33391. , l = a.getChildren(u.Reflect.Message.OneOf)
  33392. , c = function(e, t) {
  33393. u.Builder.Message.call(this);
  33394. for (var i = 0, n = l.length; i < n; ++i)
  33395. this[l[i].name] = null;
  33396. for (i = 0,
  33397. n = s.length; i < n; ++i) {
  33398. var r = s[i];
  33399. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33400. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33401. }
  33402. var o;
  33403. if (0 < arguments.length)
  33404. 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)
  33405. for (i = 0,
  33406. n = arguments.length; i < n; ++i)
  33407. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33408. else
  33409. this.$set(e)
  33410. }
  33411. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33412. o.add = function(e, t, i) {
  33413. var n = a._fieldsByName[e];
  33414. if (!i) {
  33415. if (!n)
  33416. throw Error(this + "#" + e + " is undefined");
  33417. if (!(n instanceof u.Reflect.Message.Field))
  33418. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33419. if (!n.repeated)
  33420. throw Error(this + "#" + e + " is not a repeated field");
  33421. t = n.verifyValue(t, !0)
  33422. }
  33423. return null === this[e] && (this[e] = []),
  33424. this[e].push(t),
  33425. this
  33426. }
  33427. ,
  33428. o.$add = o.add,
  33429. o.set = function(e, t, i) {
  33430. if (e && "object" == typeof e) {
  33431. for (var n in i = t,
  33432. e)
  33433. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33434. return this
  33435. }
  33436. var r = a._fieldsByName[e];
  33437. if (i)
  33438. this[e] = t;
  33439. else {
  33440. if (!r)
  33441. throw Error(this + "#" + e + " is not a field: undefined");
  33442. if (!(r instanceof u.Reflect.Message.Field))
  33443. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33444. this[r.name] = t = r.verifyValue(t)
  33445. }
  33446. if (r && r.oneof) {
  33447. var o = this[r.oneof.name];
  33448. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33449. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33450. }
  33451. return this
  33452. }
  33453. ,
  33454. o.$set = o.set,
  33455. o.get = function(e, t) {
  33456. if (t)
  33457. return this[e];
  33458. var i = a._fieldsByName[e];
  33459. if (!(i && i instanceof u.Reflect.Message.Field))
  33460. throw Error(this + "#" + e + " is not a field: undefined");
  33461. if (!(i instanceof u.Reflect.Message.Field))
  33462. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33463. return this[i.name]
  33464. }
  33465. ,
  33466. o.$get = o.get;
  33467. for (var e = 0; e < s.length; e++) {
  33468. var t = s[e];
  33469. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33470. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33471. return e.toUpperCase().replace("_", "")
  33472. });
  33473. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33474. function t(e, t) {
  33475. return this[i.name] = t ? e : i.verifyValue(e),
  33476. this
  33477. }
  33478. function n() {
  33479. return this[i.name]
  33480. }
  33481. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33482. return "_" + e
  33483. });
  33484. null === a.getChild("set" + e) && (o["set" + e] = t),
  33485. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33486. null === a.getChild("get" + e) && (o["get" + e] = n),
  33487. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33488. }(t)
  33489. }
  33490. return o.encode = function(t, e) {
  33491. "boolean" == typeof t && (e = t,
  33492. t = void 0);
  33493. var i = !1;
  33494. t || (t = new I,
  33495. i = !0);
  33496. var n = t.littleEndian;
  33497. try {
  33498. return a.encode(this, t.LE(), e),
  33499. (i ? t.flip() : t).LE(n)
  33500. } catch (e) {
  33501. throw t.LE(n),
  33502. e
  33503. }
  33504. }
  33505. ,
  33506. c.encode = function(e, t, i) {
  33507. return new c(e).encode(t, i)
  33508. }
  33509. ,
  33510. o.calculate = function() {
  33511. return a.calculate(this)
  33512. }
  33513. ,
  33514. o.encodeDelimited = function(e, t) {
  33515. var i = !1;
  33516. e || (e = new I,
  33517. i = !0);
  33518. var n = (new I).LE();
  33519. return a.encode(this, n, t).flip(),
  33520. e.writeVarint32(n.remaining()),
  33521. e.append(n),
  33522. i ? e.flip() : e
  33523. }
  33524. ,
  33525. o.encodeAB = function() {
  33526. try {
  33527. return this.encode().toArrayBuffer()
  33528. } catch (e) {
  33529. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33530. e
  33531. }
  33532. }
  33533. ,
  33534. o.toArrayBuffer = o.encodeAB,
  33535. o.encodeNB = function() {
  33536. try {
  33537. return this.encode().toBuffer()
  33538. } catch (e) {
  33539. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33540. e
  33541. }
  33542. }
  33543. ,
  33544. o.toBuffer = o.encodeNB,
  33545. o.encode64 = function() {
  33546. try {
  33547. return this.encode().toBase64()
  33548. } catch (e) {
  33549. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33550. e
  33551. }
  33552. }
  33553. ,
  33554. o.toBase64 = o.encode64,
  33555. o.encodeHex = function() {
  33556. try {
  33557. return this.encode().toHex()
  33558. } catch (e) {
  33559. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33560. e
  33561. }
  33562. }
  33563. ,
  33564. o.toHex = o.encodeHex,
  33565. o.toRaw = function(e, t) {
  33566. return d(this, !!e, !!t, this.$type)
  33567. }
  33568. ,
  33569. o.encodeJSON = function() {
  33570. return JSON.stringify(d(this, !0, !0, this.$type))
  33571. }
  33572. ,
  33573. c.decode = function(t, e, i) {
  33574. "string" == typeof e && (i = e,
  33575. e = -1),
  33576. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33577. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33578. try {
  33579. var r = a.decode(t.LE());
  33580. return t.LE(n),
  33581. r
  33582. } catch (e) {
  33583. throw t.LE(n),
  33584. e
  33585. }
  33586. }
  33587. ,
  33588. c.decodeDelimited = function(t, e) {
  33589. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33590. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33591. return null;
  33592. var i = t.offset
  33593. , n = t.readVarint32();
  33594. if (t.remaining() < n)
  33595. return t.offset = i,
  33596. null;
  33597. try {
  33598. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33599. return t.offset += n,
  33600. r
  33601. } catch (e) {
  33602. throw t.offset += n,
  33603. e
  33604. }
  33605. }
  33606. ,
  33607. c.decode64 = function(e) {
  33608. return c.decode(e, "base64")
  33609. }
  33610. ,
  33611. c.decodeHex = function(e) {
  33612. return c.decode(e, "hex")
  33613. }
  33614. ,
  33615. c.decodeJSON = function(e) {
  33616. return new c(JSON.parse(e))
  33617. }
  33618. ,
  33619. o.toString = function() {
  33620. return a.toString()
  33621. }
  33622. ,
  33623. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33624. value: a.buildOpt()
  33625. }),
  33626. Object.defineProperty(o, "$options", {
  33627. value: c.$options
  33628. }),
  33629. Object.defineProperty(c, "$type", {
  33630. value: a
  33631. }),
  33632. Object.defineProperty(o, "$type", {
  33633. value: a
  33634. })),
  33635. c
  33636. }(g, this);
  33637. this._fields = [],
  33638. this._fieldsById = {},
  33639. this._fieldsByName = {};
  33640. for (var i, n = 0, r = this.children.length; n < r; n++)
  33641. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33642. if (t.hasOwnProperty(i.name))
  33643. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33644. t[i.name] = i.build()
  33645. } else if (i instanceof d.Field)
  33646. i.build(),
  33647. this._fields.push(i),
  33648. this._fieldsById[i.id] = i,
  33649. this._fieldsByName[i.name] = i;
  33650. else if (!(i instanceof d.OneOf || i instanceof v))
  33651. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33652. return this.clazz = t
  33653. }
  33654. ,
  33655. n.encode = function(e, t, i) {
  33656. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33657. r = e[(n = this._fields[a]).name],
  33658. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33659. if (null === o)
  33660. return t;
  33661. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33662. throw l.encoded = t,
  33663. l
  33664. }
  33665. ,
  33666. n.calculate = function(e) {
  33667. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33668. if (i = e[(t = this._fields[r]).name],
  33669. t.required && null === i)
  33670. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33671. n += t.calculate(i, e)
  33672. }
  33673. return n
  33674. }
  33675. ,
  33676. n.decode = function(e, t, i) {
  33677. t = "number" == typeof t ? t : -1;
  33678. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33679. if (o = (n = e.readVarint32()) >>> 3,
  33680. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33681. if (o !== i)
  33682. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33683. break
  33684. }
  33685. if (a = this._fieldsById[o]) {
  33686. if (a.repeated && !a.options.packed)
  33687. l[a.name].push(a.decode(r, e));
  33688. else if (a.map) {
  33689. var c = a.decode(r, e);
  33690. l[a.name].set(c[0], c[1])
  33691. } else if (l[a.name] = a.decode(r, e),
  33692. a.oneof) {
  33693. var h = l[a.oneof.name];
  33694. null !== h && h !== a.name && (l[h] = null),
  33695. l[a.oneof.name] = a.name
  33696. }
  33697. } else
  33698. switch (r) {
  33699. case g.WIRE_TYPES.VARINT:
  33700. e.readVarint32();
  33701. break;
  33702. case g.WIRE_TYPES.BITS32:
  33703. e.offset += 4;
  33704. break;
  33705. case g.WIRE_TYPES.BITS64:
  33706. e.offset += 8;
  33707. break;
  33708. case g.WIRE_TYPES.LDELIM:
  33709. var u = e.readVarint32();
  33710. e.offset += u;
  33711. break;
  33712. case g.WIRE_TYPES.STARTGROUP:
  33713. for (; m(o, e); )
  33714. ;
  33715. break;
  33716. default:
  33717. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33718. }
  33719. }
  33720. for (var d = 0, p = this._fields.length; d < p; ++d)
  33721. if (null === l[(a = this._fields[d]).name])
  33722. if ("proto3" === this.syntax)
  33723. l[a.name] = a.defaultValue;
  33724. else {
  33725. if (a.required) {
  33726. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33727. throw f.decoded = l,
  33728. f
  33729. }
  33730. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33731. }
  33732. return l
  33733. }
  33734. ,
  33735. s.Message = d;
  33736. function c(e, t, i, n, r, o, a, s, l, c) {
  33737. h.call(this, e, t, o),
  33738. this.className = "Message.Field",
  33739. this.required = "required" === i,
  33740. this.repeated = "repeated" === i,
  33741. this.map = "map" === i,
  33742. this.keyType = n || null,
  33743. this.type = r,
  33744. this.resolvedType = null,
  33745. this.id = a,
  33746. this.options = s || {},
  33747. this.defaultValue = null,
  33748. this.oneof = l || null,
  33749. this.syntax = c || "proto2",
  33750. this.originalName = this.name,
  33751. this.element = null,
  33752. this.keyElement = null,
  33753. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33754. }
  33755. var r = c.prototype = Object.create(h.prototype);
  33756. r.build = function() {
  33757. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33758. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33759. "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)
  33760. }
  33761. ,
  33762. r.verifyValue = function(e, t) {
  33763. function i(e, t) {
  33764. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33765. }
  33766. t = t || !1;
  33767. var n, r = this;
  33768. if (null === e)
  33769. return this.required && i(typeof e, "required"),
  33770. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33771. null;
  33772. if (!this.repeated || t)
  33773. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33774. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33775. this.element.verifyValue(e));
  33776. Array.isArray(e) || (e = [e]);
  33777. var o = [];
  33778. for (n = 0; n < e.length; n++)
  33779. o.push(this.element.verifyValue(e[n]));
  33780. return o
  33781. }
  33782. ,
  33783. r.hasWirePresence = function(e, t) {
  33784. if ("proto3" !== this.syntax)
  33785. return null !== e;
  33786. if (this.oneof && t[this.oneof.name] === this.name)
  33787. return !0;
  33788. switch (this.type) {
  33789. case g.TYPES.int32:
  33790. case g.TYPES.sint32:
  33791. case g.TYPES.sfixed32:
  33792. case g.TYPES.uint32:
  33793. case g.TYPES.fixed32:
  33794. return 0 !== e;
  33795. case g.TYPES.int64:
  33796. case g.TYPES.sint64:
  33797. case g.TYPES.sfixed64:
  33798. case g.TYPES.uint64:
  33799. case g.TYPES.fixed64:
  33800. return 0 !== e.low || 0 !== e.high;
  33801. case g.TYPES.bool:
  33802. return e;
  33803. case g.TYPES.float:
  33804. case g.TYPES.double:
  33805. return 0 !== e;
  33806. case g.TYPES.string:
  33807. return 0 < e.length;
  33808. case g.TYPES.bytes:
  33809. return 0 < e.remaining();
  33810. case g.TYPES.enum:
  33811. return 0 !== e;
  33812. case g.TYPES.message:
  33813. return null !== e;
  33814. default:
  33815. return !0
  33816. }
  33817. }
  33818. ,
  33819. r.encode = function(t, r, e) {
  33820. if (null === this.type || "object" != typeof this.type)
  33821. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33822. if (null === t || this.repeated && 0 == t.length)
  33823. return r;
  33824. try {
  33825. var i;
  33826. if (this.repeated)
  33827. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33828. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33829. r.ensureCapacity(r.offset += 1);
  33830. var n = r.offset;
  33831. for (i = 0; i < t.length; i++)
  33832. this.element.encodeValue(this.id, t[i], r);
  33833. var o = r.offset - n
  33834. , a = I.calculateVarint32(o);
  33835. if (1 < a) {
  33836. var s = r.slice(n, r.offset);
  33837. n += a - 1,
  33838. r.offset = n,
  33839. r.append(s)
  33840. }
  33841. r.writeVarint32(o, n - a)
  33842. } else
  33843. for (i = 0; i < t.length; i++)
  33844. r.writeVarint32(this.id << 3 | this.type.wireType),
  33845. this.element.encodeValue(this.id, t[i], r);
  33846. else
  33847. this.map ? t.forEach(function(e, t, i) {
  33848. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33849. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33850. r.writeVarint32(n),
  33851. r.writeVarint32(8 | this.keyType.wireType),
  33852. this.keyElement.encodeValue(1, t, r),
  33853. r.writeVarint32(16 | this.type.wireType),
  33854. this.element.encodeValue(2, e, r)
  33855. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33856. this.element.encodeValue(this.id, t, r))
  33857. } catch (e) {
  33858. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33859. }
  33860. return r
  33861. }
  33862. ,
  33863. r.calculate = function(t, e) {
  33864. if (t = this.verifyValue(t),
  33865. null === this.type || "object" != typeof this.type)
  33866. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33867. if (null === t || this.repeated && 0 == t.length)
  33868. return 0;
  33869. var r = 0;
  33870. try {
  33871. var i, n;
  33872. if (this.repeated)
  33873. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33874. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33875. i = n = 0; i < t.length; i++)
  33876. n += this.element.calculateLength(this.id, t[i]);
  33877. r += I.calculateVarint32(n),
  33878. r += n
  33879. } else
  33880. for (i = 0; i < t.length; i++)
  33881. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33882. r += this.element.calculateLength(this.id, t[i]);
  33883. else
  33884. this.map ? t.forEach(function(e, t, i) {
  33885. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33886. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33887. r += I.calculateVarint32(n),
  33888. r += n
  33889. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33890. r += this.element.calculateLength(this.id, t))
  33891. } catch (e) {
  33892. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33893. }
  33894. return r
  33895. }
  33896. ,
  33897. r.decode = function(e, t, i) {
  33898. var n, r;
  33899. 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))
  33900. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33901. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33902. r = t.readVarint32(),
  33903. r = t.offset + r;
  33904. for (var o = []; t.offset < r; )
  33905. o.push(this.decode(this.type.wireType, t, !0));
  33906. return o
  33907. }
  33908. if (this.map) {
  33909. var a = u.defaultFieldValue(this.keyType);
  33910. if (n = u.defaultFieldValue(this.type),
  33911. r = t.readVarint32(),
  33912. t.remaining() < r)
  33913. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33914. var s = t.clone();
  33915. for (s.limit = s.offset + r,
  33916. t.offset += r; 0 < s.remaining(); ) {
  33917. var l = s.readVarint32();
  33918. e = 7 & l;
  33919. var c = l >>> 3;
  33920. if (1 == c)
  33921. a = this.keyElement.decode(s, e, c);
  33922. else {
  33923. if (2 != c)
  33924. throw Error("Unexpected tag in map field key/value submessage");
  33925. n = this.element.decode(s, e, c)
  33926. }
  33927. }
  33928. return [a, n]
  33929. }
  33930. return this.element.decode(t, e, this.id)
  33931. }
  33932. ,
  33933. s.Message.Field = c;
  33934. function o(e, t, i, n, r, o, a) {
  33935. c.call(this, e, t, i, null, n, r, o, a),
  33936. this.extension
  33937. }
  33938. o.prototype = Object.create(c.prototype),
  33939. s.Message.ExtensionField = o;
  33940. s.Message.OneOf = function(e, t, i) {
  33941. h.call(this, e, t, i),
  33942. this.fields = []
  33943. }
  33944. ;
  33945. var p = function(e, t, i, n, r) {
  33946. l.call(this, e, t, i, n, r),
  33947. this.className = "Enum",
  33948. this.object = null
  33949. };
  33950. p.getName = function(e, t) {
  33951. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33952. if (e[i = n[r]] === t)
  33953. return i;
  33954. return null
  33955. }
  33956. ,
  33957. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33958. if (this.object && !e)
  33959. return this.object;
  33960. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33961. t[i[n].name] = i[n].id;
  33962. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33963. value: this.buildOpt(),
  33964. enumerable: !1
  33965. }),
  33966. this.object = t
  33967. }
  33968. ,
  33969. s.Enum = p;
  33970. function f(e, t, i, n) {
  33971. h.call(this, e, t, i),
  33972. this.className = "Enum.Value",
  33973. this.id = n
  33974. }
  33975. f.prototype = Object.create(h.prototype),
  33976. s.Enum.Value = f;
  33977. var v = function(e, t, i, n) {
  33978. h.call(this, e, t, i),
  33979. this.field = n
  33980. };
  33981. v.prototype = Object.create(h.prototype),
  33982. s.Extension = v;
  33983. var y = function(e, t, i, n) {
  33984. l.call(this, e, t, i, n),
  33985. this.className = "Service",
  33986. this.clazz = null
  33987. };
  33988. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33989. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33990. for (var o = function(e) {
  33991. t.Builder.Service.call(this),
  33992. this.rpcImpl = e || function(e, t, i) {
  33993. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33994. }
  33995. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33996. !function(n) {
  33997. e[n.name] = function(e, i) {
  33998. try {
  33999. try {
  34000. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34001. } catch (e) {
  34002. if (!(e instanceof TypeError))
  34003. throw e
  34004. }
  34005. if (null === e || "object" != typeof e)
  34006. throw Error("Illegal arguments");
  34007. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34008. this.rpcImpl(n.fqn(), e, function(e, t) {
  34009. if (!e) {
  34010. null === t && (t = "");
  34011. try {
  34012. t = n.resolvedResponseType.clazz.decode(t)
  34013. } catch (e) {}
  34014. 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))
  34015. }
  34016. i(e)
  34017. })
  34018. } catch (e) {
  34019. setTimeout(i.bind(this, e), 0)
  34020. }
  34021. }
  34022. ,
  34023. o[n.name] = function(e, t, i) {
  34024. new o(e)[n.name](t, i)
  34025. }
  34026. ,
  34027. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34028. value: n.buildOpt()
  34029. }),
  34030. Object.defineProperty(e[n.name], "$options", {
  34031. value: o[n.name].$options
  34032. }))
  34033. }(i[n]);
  34034. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34035. value: r.buildOpt()
  34036. }),
  34037. Object.defineProperty(e, "$options", {
  34038. value: o.$options
  34039. }),
  34040. Object.defineProperty(o, "$type", {
  34041. value: r
  34042. }),
  34043. Object.defineProperty(e, "$type", {
  34044. value: r
  34045. })),
  34046. o
  34047. }(g, this)
  34048. }
  34049. ,
  34050. s.Service = y;
  34051. function A(e, t, i, n) {
  34052. h.call(this, e, t, i),
  34053. this.className = "Service.Method",
  34054. this.options = n || {}
  34055. }
  34056. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34057. s.Service.Method = A;
  34058. function C(e, t, i, n, r, o, a, s) {
  34059. A.call(this, e, t, i, s),
  34060. this.className = "Service.RPCMethod",
  34061. this.requestName = n,
  34062. this.responseName = r,
  34063. this.requestStream = o,
  34064. this.responseStream = a,
  34065. this.resolvedRequestType = null,
  34066. this.resolvedResponseType = null
  34067. }
  34068. return C.prototype = Object.create(A.prototype),
  34069. s.Service.RPCMethod = C,
  34070. s
  34071. }(o),
  34072. o.Builder = (i = (u = o).Lang,
  34073. s = o.Reflect,
  34074. n = h.prototype,
  34075. h.isMessage = function(e) {
  34076. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34077. }
  34078. ,
  34079. h.isMessageField = function(e) {
  34080. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34081. }
  34082. ,
  34083. h.isEnum = function(e) {
  34084. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34085. }
  34086. ,
  34087. h.isService = function(e) {
  34088. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34089. }
  34090. ,
  34091. h.isExtend = function(e) {
  34092. return "string" == typeof e.ref
  34093. }
  34094. ,
  34095. n.reset = function() {
  34096. return this.ptr = this.ns,
  34097. this
  34098. }
  34099. ,
  34100. n.define = function(e) {
  34101. if ("string" != typeof e || !i.TYPEREF.test(e))
  34102. throw Error("illegal namespace: " + e);
  34103. return e.split(".").forEach(function(e) {
  34104. var t = this.ptr.getChild(e);
  34105. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34106. this.ptr = t
  34107. }, this),
  34108. this
  34109. }
  34110. ,
  34111. n.create = function(e) {
  34112. if (!e)
  34113. return this;
  34114. if (Array.isArray(e)) {
  34115. if (0 === e.length)
  34116. return this;
  34117. e = e.slice()
  34118. } else
  34119. e = [e];
  34120. for (var t = [e]; 0 < t.length; ) {
  34121. if (e = t.pop(),
  34122. !Array.isArray(e))
  34123. throw Error("not a valid namespace: " + JSON.stringify(e));
  34124. for (; 0 < e.length; ) {
  34125. var i = e.shift();
  34126. if (h.isMessage(i)) {
  34127. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34128. , n = {};
  34129. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34130. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34131. }, this),
  34132. i.fields && i.fields.forEach(function(e) {
  34133. if (null !== o.getChild(0 | e.id))
  34134. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34135. if (e.options && "object" != typeof e.options)
  34136. throw Error("illegal field options in " + o.name + "#" + e.name);
  34137. var t = null;
  34138. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34139. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34140. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34141. t && t.fields.push(e),
  34142. o.addChild(e)
  34143. }, this);
  34144. var r = [];
  34145. if (i.enums && i.enums.forEach(function(e) {
  34146. r.push(e)
  34147. }),
  34148. i.messages && i.messages.forEach(function(e) {
  34149. r.push(e)
  34150. }),
  34151. i.services && i.services.forEach(function(e) {
  34152. r.push(e)
  34153. }),
  34154. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34155. this.ptr.addChild(o),
  34156. 0 < r.length) {
  34157. t.push(e),
  34158. e = r,
  34159. r = null,
  34160. this.ptr = o,
  34161. o = null;
  34162. continue
  34163. }
  34164. r = null
  34165. } else if (h.isEnum(i))
  34166. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34167. i.values.forEach(function(e) {
  34168. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34169. }, this),
  34170. this.ptr.addChild(o);
  34171. else if (h.isService(i))
  34172. o = new s.Service(this,this.ptr,i.name,i.options),
  34173. Object.keys(i.rpc).forEach(function(e) {
  34174. var t = i.rpc[e];
  34175. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34176. }, this),
  34177. this.ptr.addChild(o);
  34178. else {
  34179. if (!h.isExtend(i))
  34180. throw Error("not a valid definition: " + JSON.stringify(i));
  34181. if (o = this.ptr.resolve(i.ref, !0))
  34182. i.fields.forEach(function(t) {
  34183. if (null !== o.getChild(0 | t.id))
  34184. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34185. if (o.extensions) {
  34186. var i = !1;
  34187. if (o.extensions.forEach(function(e) {
  34188. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34189. }),
  34190. !i)
  34191. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34192. }
  34193. var e = t.name;
  34194. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34195. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34196. , r = new s.Extension(this,this.ptr,t.name,n);
  34197. n.extension = r,
  34198. this.ptr.addChild(r),
  34199. o.addChild(n)
  34200. }, this);
  34201. else if (!/\.?google\.protobuf\./.test(i.ref))
  34202. throw Error("extended message " + i.ref + " is not defined")
  34203. }
  34204. o = i = null
  34205. }
  34206. e = null,
  34207. this.ptr = this.ptr.parent
  34208. }
  34209. return this.resolved = !1,
  34210. this.result = null,
  34211. this
  34212. }
  34213. ,
  34214. n.import = function(t, e) {
  34215. var i = "/";
  34216. if ("string" == typeof e) {
  34217. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34218. !0 === this.files[e])
  34219. return this.reset();
  34220. this.files[e] = !0
  34221. } else if ("object" == typeof e) {
  34222. var n = e.root;
  34223. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34224. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34225. var r = n + i + e.file;
  34226. if (!0 === this.files[r])
  34227. return this.reset();
  34228. this.files[r] = !0
  34229. }
  34230. if (t.imports && 0 < t.imports.length) {
  34231. var o, a = !1;
  34232. "object" == typeof e ? (this.importRoot = e.root,
  34233. a = !0,
  34234. o = this.importRoot,
  34235. e = e.file,
  34236. (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(/\\[^\\]*$/, ""),
  34237. i = "\\") : o = "." : o = null;
  34238. for (var s = 0; s < t.imports.length; s++)
  34239. if ("string" == typeof t.imports[s]) {
  34240. if (!o)
  34241. throw Error("cannot determine import root");
  34242. var l = t.imports[s];
  34243. if ("google/protobuf/descriptor.proto" === l)
  34244. continue;
  34245. if (l = o + i + l,
  34246. !0 === this.files[l])
  34247. continue;
  34248. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34249. var c = u.Util.fetch(l);
  34250. if (null === c)
  34251. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34252. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34253. } else
  34254. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34255. return t + "_import" + s + "." + i
  34256. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34257. a && (this.importRoot = null)
  34258. }
  34259. t.package && this.define(t.package),
  34260. t.syntax && function t(i) {
  34261. i.messages && i.messages.forEach(function(e) {
  34262. e.syntax = i.syntax,
  34263. t(e)
  34264. }),
  34265. i.enums && i.enums.forEach(function(e) {
  34266. e.syntax = i.syntax
  34267. })
  34268. }(t);
  34269. var h = this.ptr;
  34270. return t.options && Object.keys(t.options).forEach(function(e) {
  34271. h.options[e] = t.options[e]
  34272. }),
  34273. t.messages && (this.create(t.messages),
  34274. this.ptr = h),
  34275. t.enums && (this.create(t.enums),
  34276. this.ptr = h),
  34277. t.services && (this.create(t.services),
  34278. this.ptr = h),
  34279. t.extends && this.create(t.extends),
  34280. this.reset()
  34281. }
  34282. ,
  34283. n.resolveAll = function() {
  34284. var e;
  34285. if (null == this.ptr || "object" == typeof this.ptr.type)
  34286. return this;
  34287. if (this.ptr instanceof s.Namespace)
  34288. this.ptr.children.forEach(function(e) {
  34289. this.ptr = e,
  34290. this.resolveAll()
  34291. }, this);
  34292. else if (this.ptr instanceof s.Message.Field) {
  34293. if (i.TYPE.test(this.ptr.type))
  34294. this.ptr.type = u.TYPES[this.ptr.type];
  34295. else {
  34296. if (!i.TYPEREF.test(this.ptr.type))
  34297. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34298. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34299. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34300. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34301. if (this.ptr.type = u.TYPES.enum,
  34302. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34303. throw Error("proto3 message cannot reference proto2 enum")
  34304. } else {
  34305. if (!(e instanceof s.Message))
  34306. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34307. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34308. }
  34309. }
  34310. if (this.ptr.map) {
  34311. if (!i.TYPE.test(this.ptr.keyType))
  34312. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34313. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34314. }
  34315. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34316. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34317. throw Error("illegal service type in " + this.ptr.toString(!0));
  34318. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34319. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34320. if (this.ptr.resolvedRequestType = e,
  34321. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34322. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34323. this.ptr.resolvedResponseType = e
  34324. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34325. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34326. return this.reset()
  34327. }
  34328. ,
  34329. n.build = function(e) {
  34330. if (this.reset(),
  34331. this.resolved || (this.resolveAll(),
  34332. this.resolved = !0,
  34333. this.result = null),
  34334. null === this.result && (this.result = this.ns.build()),
  34335. !e)
  34336. return this.result;
  34337. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34338. if (!i[t[n]]) {
  34339. i = null;
  34340. break
  34341. }
  34342. i = i[t[n]]
  34343. }
  34344. return i
  34345. }
  34346. ,
  34347. n.lookup = function(e, t) {
  34348. return e ? this.ns.resolve(e, t) : this.ns
  34349. }
  34350. ,
  34351. n.toString = function() {
  34352. return "Builder"
  34353. }
  34354. ,
  34355. h.Message = function() {}
  34356. ,
  34357. h.Enum = function() {}
  34358. ,
  34359. h.Service = function() {}
  34360. ,
  34361. h),
  34362. o.Map = (a = o.Reflect,
  34363. (t = c.prototype).clear = function() {
  34364. this.map = {}
  34365. }
  34366. ,
  34367. t.delete = function(e) {
  34368. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34369. , i = t in this.map;
  34370. return delete this.map[t],
  34371. i
  34372. }
  34373. ,
  34374. t.entries = function() {
  34375. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34376. t.push([(e = this.map[i[n]]).key, e.value]);
  34377. return l(t)
  34378. }
  34379. ,
  34380. t.keys = function() {
  34381. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34382. e.push(this.map[t[i]].key);
  34383. return l(e)
  34384. }
  34385. ,
  34386. t.values = function() {
  34387. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34388. e.push(this.map[t[i]].value);
  34389. return l(e)
  34390. }
  34391. ,
  34392. t.forEach = function(e, t) {
  34393. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34394. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34395. }
  34396. ,
  34397. t.set = function(e, t) {
  34398. var i = this.keyElem.verifyValue(e)
  34399. , n = this.valueElem.verifyValue(t);
  34400. return this.map[this.keyElem.valueToString(i)] = {
  34401. key: i,
  34402. value: n
  34403. },
  34404. this
  34405. }
  34406. ,
  34407. t.get = function(e) {
  34408. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34409. if (t in this.map)
  34410. return this.map[t].value
  34411. }
  34412. ,
  34413. t.has = function(e) {
  34414. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34415. }
  34416. ,
  34417. c),
  34418. o.loadProto = function(e, t, i) {
  34419. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34420. t = void 0),
  34421. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34422. }
  34423. ,
  34424. o.protoFromString = o.loadProto,
  34425. o.loadProtoFile = function(t, i, n) {
  34426. if (i && "object" == typeof i ? (n = i,
  34427. i = null) : i && "function" == typeof i || (i = null),
  34428. i)
  34429. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34430. if (null !== e)
  34431. try {
  34432. i(null, o.loadProto(e, n, t))
  34433. } catch (e) {
  34434. i(e)
  34435. }
  34436. else
  34437. i(Error("Failed to fetch file"))
  34438. });
  34439. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34440. return null === e ? null : o.loadProto(e, n, t)
  34441. }
  34442. ,
  34443. o.protoFromFile = o.loadProtoFile,
  34444. o.newBuilder = function(e) {
  34445. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34446. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34447. new o.Builder(e)
  34448. }
  34449. ,
  34450. o.loadJson = function(e, t, i) {
  34451. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34452. t = null),
  34453. t && "object" == typeof t || (t = o.newBuilder()),
  34454. "string" == typeof e && (e = JSON.parse(e)),
  34455. t.import(e, i),
  34456. t.resolveAll(),
  34457. t
  34458. }
  34459. ,
  34460. o.loadJsonFile = function(t, i, n) {
  34461. if (i && "object" == typeof i ? (n = i,
  34462. i = null) : i && "function" == typeof i || (i = null),
  34463. i)
  34464. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34465. if (null !== e)
  34466. try {
  34467. i(null, o.loadJson(JSON.parse(e), n, t))
  34468. } catch (e) {
  34469. i(e)
  34470. }
  34471. else
  34472. i(Error("Failed to fetch file"))
  34473. });
  34474. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34475. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34476. }
  34477. ,
  34478. o;
  34479. function l(e) {
  34480. var t = 0;
  34481. return {
  34482. next: function() {
  34483. return t < e.length ? {
  34484. done: !1,
  34485. value: e[t++]
  34486. } : {
  34487. done: !0
  34488. }
  34489. }
  34490. }
  34491. }
  34492. function c(e, t) {
  34493. if (!e.map)
  34494. throw Error("field is not a map");
  34495. if (this.field = e,
  34496. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34497. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34498. this.map = {},
  34499. Object.defineProperty(this, "size", {
  34500. get: function() {
  34501. return Object.keys(this.map).length
  34502. }
  34503. }),
  34504. t)
  34505. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34506. var r = this.keyElem.valueFromString(i[n])
  34507. , o = this.valueElem.verifyValue(t[i[n]]);
  34508. this.map[this.keyElem.valueToString(r)] = {
  34509. key: r,
  34510. value: o
  34511. }
  34512. }
  34513. }
  34514. function h(e) {
  34515. this.ns = new s.Namespace(this,null,""),
  34516. this.ptr = this.ns,
  34517. this.resolved = !1,
  34518. this.result = null,
  34519. this.files = {},
  34520. this.importRoot = null,
  34521. this.options = e || {}
  34522. }
  34523. }
  34524. ,
  34525. "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)
  34526. }
  34527. ).call(this, p("_process"))
  34528. }
  34529. , {
  34530. _process: 203,
  34531. bytebuffer: 215,
  34532. fs: 197,
  34533. path: 197
  34534. }],
  34535. 215: [function(t, e, i) {
  34536. var n, r;
  34537. n = this,
  34538. r = function(l) {
  34539. "use strict";
  34540. function s(e) {
  34541. var t = 0;
  34542. return function() {
  34543. return t < e.length ? e.charCodeAt(t++) : null
  34544. }
  34545. }
  34546. function c() {
  34547. var e = []
  34548. , t = [];
  34549. return function() {
  34550. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34551. e.length = 0),
  34552. void Array.prototype.push.apply(e, arguments))
  34553. }
  34554. }
  34555. function n(e, t, i, n, r) {
  34556. 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];
  34557. for (u += d,
  34558. o = p & (1 << -h) - 1,
  34559. p >>= -h,
  34560. h += s; 0 < h; o = 256 * o + e[t + u],
  34561. u += d,
  34562. h -= 8)
  34563. ;
  34564. for (a = o & (1 << -h) - 1,
  34565. o >>= -h,
  34566. h += n; 0 < h; a = 256 * a + e[t + u],
  34567. u += d,
  34568. h -= 8)
  34569. ;
  34570. if (0 === o)
  34571. o = 1 - c;
  34572. else {
  34573. if (o === l)
  34574. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34575. a += Math.pow(2, n),
  34576. o -= c
  34577. }
  34578. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34579. }
  34580. function r(e, t, i, n, r, o) {
  34581. 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;
  34582. for (t = Math.abs(t),
  34583. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34584. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34585. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34586. l *= 2),
  34587. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34588. l /= 2),
  34589. h <= a + u ? (s = 0,
  34590. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34591. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34592. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34593. p += f,
  34594. s /= 256,
  34595. r -= 8)
  34596. ;
  34597. for (a = a << r | s,
  34598. c += r; 0 < c; e[i + p] = 255 & a,
  34599. p += f,
  34600. a /= 256,
  34601. c -= 8)
  34602. ;
  34603. e[i + p - f] |= 128 * g
  34604. }
  34605. var f = function(e, t, i) {
  34606. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34607. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34608. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34609. !i) {
  34610. if ((e |= 0) < 0)
  34611. throw RangeError("Illegal capacity");
  34612. t = !!t,
  34613. i = !!i
  34614. }
  34615. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34616. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34617. this.offset = 0,
  34618. this.markedOffset = -1,
  34619. this.limit = e,
  34620. this.littleEndian = t,
  34621. this.noAssert = i
  34622. };
  34623. f.VERSION = "5.0.1",
  34624. f.LITTLE_ENDIAN = !0,
  34625. f.BIG_ENDIAN = !1,
  34626. f.DEFAULT_CAPACITY = 16,
  34627. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34628. f.DEFAULT_NOASSERT = !1,
  34629. f.Long = l || null;
  34630. var a = f.prototype;
  34631. a.__isByteBuffer__,
  34632. Object.defineProperty(a, "__isByteBuffer__", {
  34633. value: !0,
  34634. enumerable: !1,
  34635. configurable: !1
  34636. });
  34637. var o = new ArrayBuffer(0)
  34638. , i = String.fromCharCode;
  34639. f.accessor = function() {
  34640. return Uint8Array
  34641. }
  34642. ,
  34643. f.allocate = function(e, t, i) {
  34644. return new f(e,t,i)
  34645. }
  34646. ,
  34647. f.concat = function(e, t, i, n) {
  34648. "boolean" != typeof t && "string" == typeof t || (n = i,
  34649. i = t,
  34650. t = void 0);
  34651. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34652. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34653. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34654. if (0 === o)
  34655. return new f(0,i,n);
  34656. var l, c = new f(o,i,n);
  34657. for (a = 0; a < s; )
  34658. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34659. c.offset += r);
  34660. return c.limit = c.offset,
  34661. c.offset = 0,
  34662. c
  34663. }
  34664. ,
  34665. f.isByteBuffer = function(e) {
  34666. return !0 === (e && e.__isByteBuffer__)
  34667. }
  34668. ,
  34669. f.type = function() {
  34670. return ArrayBuffer
  34671. }
  34672. ,
  34673. f.wrap = function(e, t, i, n) {
  34674. if ("string" != typeof t && (n = i,
  34675. i = t,
  34676. t = void 0),
  34677. "string" == typeof e)
  34678. switch (void 0 === t && (t = "utf8"),
  34679. t) {
  34680. case "base64":
  34681. return f.fromBase64(e, i);
  34682. case "hex":
  34683. return f.fromHex(e, i);
  34684. case "binary":
  34685. return f.fromBinary(e, i);
  34686. case "utf8":
  34687. return f.fromUTF8(e, i);
  34688. case "debug":
  34689. return f.fromDebug(e, i);
  34690. default:
  34691. throw Error("Unsupported encoding: " + t)
  34692. }
  34693. if (null === e || "object" != typeof e)
  34694. throw TypeError("Illegal buffer");
  34695. var r;
  34696. if (f.isByteBuffer(e))
  34697. return (r = a.clone.call(e)).markedOffset = -1,
  34698. r;
  34699. if (e instanceof Uint8Array)
  34700. r = new f(0,i,n),
  34701. 0 < e.length && (r.buffer = e.buffer,
  34702. r.offset = e.byteOffset,
  34703. r.limit = e.byteOffset + e.byteLength,
  34704. r.view = new Uint8Array(e.buffer));
  34705. else if (e instanceof ArrayBuffer)
  34706. r = new f(0,i,n),
  34707. 0 < e.byteLength && (r.buffer = e,
  34708. r.offset = 0,
  34709. r.limit = e.byteLength,
  34710. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34711. else {
  34712. if ("[object Array]" !== Object.prototype.toString.call(e))
  34713. throw TypeError("Illegal buffer");
  34714. (r = new f(e.length,i,n)).limit = e.length;
  34715. for (var o = 0; o < e.length; ++o)
  34716. r.view[o] = e[o]
  34717. }
  34718. return r
  34719. }
  34720. ,
  34721. a.writeBitSet = function(e, t) {
  34722. var i = void 0 === t;
  34723. if (i && (t = this.offset),
  34724. !this.noAssert) {
  34725. if (!(e instanceof Array))
  34726. throw TypeError("Illegal BitSet: Not an array");
  34727. if ("number" != typeof t || t % 1 != 0)
  34728. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34729. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34730. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34731. }
  34732. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34733. for (t += this.writeVarint32(o, t); a--; )
  34734. 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,
  34735. this.writeByte(n, t++);
  34736. if (s < o) {
  34737. var l = 0;
  34738. for (n = 0; s < o; )
  34739. n |= (1 & !!e[s++]) << l++;
  34740. this.writeByte(n, t++)
  34741. }
  34742. return i ? (this.offset = t,
  34743. this) : t - r
  34744. }
  34745. ,
  34746. a.readBitSet = function(e) {
  34747. var t = void 0 === e;
  34748. t && (e = this.offset);
  34749. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34750. for (e += n.length; o--; )
  34751. i = this.readByte(e++),
  34752. s[a++] = !!(1 & i),
  34753. s[a++] = !!(2 & i),
  34754. s[a++] = !!(4 & i),
  34755. s[a++] = !!(8 & i),
  34756. s[a++] = !!(16 & i),
  34757. s[a++] = !!(32 & i),
  34758. s[a++] = !!(64 & i),
  34759. s[a++] = !!(128 & i);
  34760. if (a < r) {
  34761. var l = 0;
  34762. for (i = this.readByte(e++); a < r; )
  34763. s[a++] = !!(i >> l++ & 1)
  34764. }
  34765. return t && (this.offset = e),
  34766. s
  34767. }
  34768. ,
  34769. a.readBytes = function(e, t) {
  34770. var i = void 0 === t;
  34771. if (i && (t = this.offset),
  34772. !this.noAssert) {
  34773. if ("number" != typeof t || t % 1 != 0)
  34774. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34775. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34776. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34777. }
  34778. var n = this.slice(t, t + e);
  34779. return i && (this.offset += e),
  34780. n
  34781. }
  34782. ,
  34783. a.writeBytes = a.append,
  34784. a.writeInt8 = function(e, t) {
  34785. var i = void 0 === t;
  34786. if (i && (t = this.offset),
  34787. !this.noAssert) {
  34788. if ("number" != typeof e || e % 1 != 0)
  34789. throw TypeError("Illegal value: " + e + " (not an integer)");
  34790. if (e |= 0,
  34791. "number" != typeof t || t % 1 != 0)
  34792. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34793. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34794. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34795. }
  34796. t += 1;
  34797. var n = this.buffer.byteLength;
  34798. return n < t && this.resize((n *= 2) > t ? n : t),
  34799. t -= 1,
  34800. this.view[t] = e,
  34801. i && (this.offset += 1),
  34802. this
  34803. }
  34804. ,
  34805. a.writeByte = a.writeInt8,
  34806. a.readInt8 = function(e) {
  34807. var t = void 0 === e;
  34808. if (t && (e = this.offset),
  34809. !this.noAssert) {
  34810. if ("number" != typeof e || e % 1 != 0)
  34811. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34812. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34813. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34814. }
  34815. var i = this.view[e];
  34816. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34817. t && (this.offset += 1),
  34818. i
  34819. }
  34820. ,
  34821. a.readByte = a.readInt8,
  34822. a.writeUint8 = function(e, t) {
  34823. var i = void 0 === t;
  34824. if (i && (t = this.offset),
  34825. !this.noAssert) {
  34826. if ("number" != typeof e || e % 1 != 0)
  34827. throw TypeError("Illegal value: " + e + " (not an integer)");
  34828. if (e >>>= 0,
  34829. "number" != typeof t || t % 1 != 0)
  34830. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34831. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34832. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34833. }
  34834. t += 1;
  34835. var n = this.buffer.byteLength;
  34836. return n < t && this.resize((n *= 2) > t ? n : t),
  34837. t -= 1,
  34838. this.view[t] = e,
  34839. i && (this.offset += 1),
  34840. this
  34841. }
  34842. ,
  34843. a.writeUInt8 = a.writeUint8,
  34844. a.readUint8 = function(e) {
  34845. var t = void 0 === e;
  34846. if (t && (e = this.offset),
  34847. !this.noAssert) {
  34848. if ("number" != typeof e || e % 1 != 0)
  34849. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34850. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34851. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34852. }
  34853. var i = this.view[e];
  34854. return t && (this.offset += 1),
  34855. i
  34856. }
  34857. ,
  34858. a.readUInt8 = a.readUint8,
  34859. a.writeInt16 = function(e, t) {
  34860. var i = void 0 === t;
  34861. if (i && (t = this.offset),
  34862. !this.noAssert) {
  34863. if ("number" != typeof e || e % 1 != 0)
  34864. throw TypeError("Illegal value: " + e + " (not an integer)");
  34865. if (e |= 0,
  34866. "number" != typeof t || t % 1 != 0)
  34867. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34868. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34869. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34870. }
  34871. t += 2;
  34872. var n = this.buffer.byteLength;
  34873. return n < t && this.resize((n *= 2) > t ? n : t),
  34874. t -= 2,
  34875. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34876. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34877. this.view[t + 1] = 255 & e),
  34878. i && (this.offset += 2),
  34879. this
  34880. }
  34881. ,
  34882. a.writeShort = a.writeInt16,
  34883. a.readInt16 = function(e) {
  34884. var t = void 0 === e;
  34885. if (t && (e = this.offset),
  34886. !this.noAssert) {
  34887. if ("number" != typeof e || e % 1 != 0)
  34888. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34889. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34890. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34891. }
  34892. var i = 0;
  34893. return this.littleEndian ? (i = this.view[e],
  34894. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34895. i |= this.view[e + 1]),
  34896. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34897. t && (this.offset += 2),
  34898. i
  34899. }
  34900. ,
  34901. a.readShort = a.readInt16,
  34902. a.writeUint16 = function(e, t) {
  34903. var i = void 0 === t;
  34904. if (i && (t = this.offset),
  34905. !this.noAssert) {
  34906. if ("number" != typeof e || e % 1 != 0)
  34907. throw TypeError("Illegal value: " + e + " (not an integer)");
  34908. if (e >>>= 0,
  34909. "number" != typeof t || t % 1 != 0)
  34910. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34911. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34912. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34913. }
  34914. t += 2;
  34915. var n = this.buffer.byteLength;
  34916. return n < t && this.resize((n *= 2) > t ? n : t),
  34917. t -= 2,
  34918. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34919. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34920. this.view[t + 1] = 255 & e),
  34921. i && (this.offset += 2),
  34922. this
  34923. }
  34924. ,
  34925. a.writeUInt16 = a.writeUint16,
  34926. a.readUint16 = function(e) {
  34927. var t = void 0 === e;
  34928. if (t && (e = this.offset),
  34929. !this.noAssert) {
  34930. if ("number" != typeof e || e % 1 != 0)
  34931. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34932. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34933. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34934. }
  34935. var i = 0;
  34936. return this.littleEndian ? (i = this.view[e],
  34937. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34938. i |= this.view[e + 1]),
  34939. t && (this.offset += 2),
  34940. i
  34941. }
  34942. ,
  34943. a.readUInt16 = a.readUint16,
  34944. a.writeInt32 = function(e, t) {
  34945. var i = void 0 === t;
  34946. if (i && (t = this.offset),
  34947. !this.noAssert) {
  34948. if ("number" != typeof e || e % 1 != 0)
  34949. throw TypeError("Illegal value: " + e + " (not an integer)");
  34950. if (e |= 0,
  34951. "number" != typeof t || t % 1 != 0)
  34952. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34953. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34954. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34955. }
  34956. t += 4;
  34957. var n = this.buffer.byteLength;
  34958. return n < t && this.resize((n *= 2) > t ? n : t),
  34959. t -= 4,
  34960. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34961. this.view[t + 2] = e >>> 16 & 255,
  34962. this.view[t + 1] = e >>> 8 & 255,
  34963. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34964. this.view[t + 1] = e >>> 16 & 255,
  34965. this.view[t + 2] = e >>> 8 & 255,
  34966. this.view[t + 3] = 255 & e),
  34967. i && (this.offset += 4),
  34968. this
  34969. }
  34970. ,
  34971. a.writeInt = a.writeInt32,
  34972. a.readInt32 = function(e) {
  34973. var t = void 0 === e;
  34974. if (t && (e = this.offset),
  34975. !this.noAssert) {
  34976. if ("number" != typeof e || e % 1 != 0)
  34977. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34978. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34979. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34980. }
  34981. var i = 0;
  34982. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34983. i |= this.view[e + 1] << 8,
  34984. i |= this.view[e],
  34985. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34986. i |= this.view[e + 2] << 8,
  34987. i |= this.view[e + 3],
  34988. i += this.view[e] << 24 >>> 0),
  34989. i |= 0,
  34990. t && (this.offset += 4),
  34991. i
  34992. }
  34993. ,
  34994. a.readInt = a.readInt32,
  34995. a.writeUint32 = function(e, t) {
  34996. var i = void 0 === t;
  34997. if (i && (t = this.offset),
  34998. !this.noAssert) {
  34999. if ("number" != typeof e || e % 1 != 0)
  35000. throw TypeError("Illegal value: " + e + " (not an integer)");
  35001. if (e >>>= 0,
  35002. "number" != typeof t || t % 1 != 0)
  35003. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35004. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35005. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35006. }
  35007. t += 4;
  35008. var n = this.buffer.byteLength;
  35009. return n < t && this.resize((n *= 2) > t ? n : t),
  35010. t -= 4,
  35011. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35012. this.view[t + 2] = e >>> 16 & 255,
  35013. this.view[t + 1] = e >>> 8 & 255,
  35014. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35015. this.view[t + 1] = e >>> 16 & 255,
  35016. this.view[t + 2] = e >>> 8 & 255,
  35017. this.view[t + 3] = 255 & e),
  35018. i && (this.offset += 4),
  35019. this
  35020. }
  35021. ,
  35022. a.writeUInt32 = a.writeUint32,
  35023. a.readUint32 = function(e) {
  35024. var t = void 0 === e;
  35025. if (t && (e = this.offset),
  35026. !this.noAssert) {
  35027. if ("number" != typeof e || e % 1 != 0)
  35028. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35029. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35030. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35031. }
  35032. var i = 0;
  35033. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35034. i |= this.view[e + 1] << 8,
  35035. i |= this.view[e],
  35036. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35037. i |= this.view[e + 2] << 8,
  35038. i |= this.view[e + 3],
  35039. i += this.view[e] << 24 >>> 0),
  35040. t && (this.offset += 4),
  35041. i
  35042. }
  35043. ,
  35044. a.readUInt32 = a.readUint32,
  35045. l && (a.writeInt64 = function(e, t) {
  35046. var i = void 0 === t;
  35047. if (i && (t = this.offset),
  35048. !this.noAssert) {
  35049. if ("number" == typeof e)
  35050. e = l.fromNumber(e);
  35051. else if ("string" == typeof e)
  35052. e = l.fromString(e);
  35053. else if (!(e && e instanceof l))
  35054. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35055. if ("number" != typeof t || t % 1 != 0)
  35056. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35057. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35058. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35059. }
  35060. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35061. t += 8;
  35062. var n = this.buffer.byteLength;
  35063. n < t && this.resize((n *= 2) > t ? n : t),
  35064. t -= 8;
  35065. var r = e.low
  35066. , o = e.high;
  35067. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35068. this.view[t + 2] = r >>> 16 & 255,
  35069. this.view[t + 1] = r >>> 8 & 255,
  35070. this.view[t] = 255 & r,
  35071. t += 4,
  35072. this.view[t + 3] = o >>> 24 & 255,
  35073. this.view[t + 2] = o >>> 16 & 255,
  35074. this.view[t + 1] = o >>> 8 & 255,
  35075. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35076. this.view[t + 1] = o >>> 16 & 255,
  35077. this.view[t + 2] = o >>> 8 & 255,
  35078. this.view[t + 3] = 255 & o,
  35079. t += 4,
  35080. this.view[t] = r >>> 24 & 255,
  35081. this.view[t + 1] = r >>> 16 & 255,
  35082. this.view[t + 2] = r >>> 8 & 255,
  35083. this.view[t + 3] = 255 & r),
  35084. i && (this.offset += 8),
  35085. this
  35086. }
  35087. ,
  35088. a.writeLong = a.writeInt64,
  35089. a.readInt64 = function(e) {
  35090. var t = void 0 === e;
  35091. if (t && (e = this.offset),
  35092. !this.noAssert) {
  35093. if ("number" != typeof e || e % 1 != 0)
  35094. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35095. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35096. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35097. }
  35098. var i = 0
  35099. , n = 0;
  35100. this.littleEndian ? (i = this.view[e + 2] << 16,
  35101. i |= this.view[e + 1] << 8,
  35102. i |= this.view[e],
  35103. i += this.view[e + 3] << 24 >>> 0,
  35104. e += 4,
  35105. n = this.view[e + 2] << 16,
  35106. n |= this.view[e + 1] << 8,
  35107. n |= this.view[e],
  35108. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35109. n |= this.view[e + 2] << 8,
  35110. n |= this.view[e + 3],
  35111. n += this.view[e] << 24 >>> 0,
  35112. e += 4,
  35113. i = this.view[e + 1] << 16,
  35114. i |= this.view[e + 2] << 8,
  35115. i |= this.view[e + 3],
  35116. i += this.view[e] << 24 >>> 0);
  35117. var r = new l(i,n,!1);
  35118. return t && (this.offset += 8),
  35119. r
  35120. }
  35121. ,
  35122. a.readLong = a.readInt64,
  35123. a.writeUint64 = function(e, t) {
  35124. var i = void 0 === t;
  35125. if (i && (t = this.offset),
  35126. !this.noAssert) {
  35127. if ("number" == typeof e)
  35128. e = l.fromNumber(e);
  35129. else if ("string" == typeof e)
  35130. e = l.fromString(e);
  35131. else if (!(e && e instanceof l))
  35132. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35133. if ("number" != typeof t || t % 1 != 0)
  35134. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35135. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35136. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35137. }
  35138. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35139. t += 8;
  35140. var n = this.buffer.byteLength;
  35141. n < t && this.resize((n *= 2) > t ? n : t),
  35142. t -= 8;
  35143. var r = e.low
  35144. , o = e.high;
  35145. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35146. this.view[t + 2] = r >>> 16 & 255,
  35147. this.view[t + 1] = r >>> 8 & 255,
  35148. this.view[t] = 255 & r,
  35149. t += 4,
  35150. this.view[t + 3] = o >>> 24 & 255,
  35151. this.view[t + 2] = o >>> 16 & 255,
  35152. this.view[t + 1] = o >>> 8 & 255,
  35153. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35154. this.view[t + 1] = o >>> 16 & 255,
  35155. this.view[t + 2] = o >>> 8 & 255,
  35156. this.view[t + 3] = 255 & o,
  35157. t += 4,
  35158. this.view[t] = r >>> 24 & 255,
  35159. this.view[t + 1] = r >>> 16 & 255,
  35160. this.view[t + 2] = r >>> 8 & 255,
  35161. this.view[t + 3] = 255 & r),
  35162. i && (this.offset += 8),
  35163. this
  35164. }
  35165. ,
  35166. a.writeUInt64 = a.writeUint64,
  35167. a.readUint64 = function(e) {
  35168. var t = void 0 === e;
  35169. if (t && (e = this.offset),
  35170. !this.noAssert) {
  35171. if ("number" != typeof e || e % 1 != 0)
  35172. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35173. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35174. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35175. }
  35176. var i = 0
  35177. , n = 0;
  35178. this.littleEndian ? (i = this.view[e + 2] << 16,
  35179. i |= this.view[e + 1] << 8,
  35180. i |= this.view[e],
  35181. i += this.view[e + 3] << 24 >>> 0,
  35182. e += 4,
  35183. n = this.view[e + 2] << 16,
  35184. n |= this.view[e + 1] << 8,
  35185. n |= this.view[e],
  35186. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35187. n |= this.view[e + 2] << 8,
  35188. n |= this.view[e + 3],
  35189. n += this.view[e] << 24 >>> 0,
  35190. e += 4,
  35191. i = this.view[e + 1] << 16,
  35192. i |= this.view[e + 2] << 8,
  35193. i |= this.view[e + 3],
  35194. i += this.view[e] << 24 >>> 0);
  35195. var r = new l(i,n,!0);
  35196. return t && (this.offset += 8),
  35197. r
  35198. }
  35199. ,
  35200. a.readUInt64 = a.readUint64),
  35201. a.writeFloat32 = function(e, t) {
  35202. var i = void 0 === t;
  35203. if (i && (t = this.offset),
  35204. !this.noAssert) {
  35205. if ("number" != typeof e)
  35206. throw TypeError("Illegal value: " + e + " (not a number)");
  35207. if ("number" != typeof t || t % 1 != 0)
  35208. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35209. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35210. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35211. }
  35212. t += 4;
  35213. var n = this.buffer.byteLength;
  35214. return n < t && this.resize((n *= 2) > t ? n : t),
  35215. t -= 4,
  35216. r(this.view, e, t, this.littleEndian, 23, 4),
  35217. i && (this.offset += 4),
  35218. this
  35219. }
  35220. ,
  35221. a.writeFloat = a.writeFloat32,
  35222. a.readFloat32 = function(e) {
  35223. var t = void 0 === e;
  35224. if (t && (e = this.offset),
  35225. !this.noAssert) {
  35226. if ("number" != typeof e || e % 1 != 0)
  35227. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35228. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35229. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35230. }
  35231. var i = n(this.view, e, this.littleEndian, 23, 4);
  35232. return t && (this.offset += 4),
  35233. i
  35234. }
  35235. ,
  35236. a.readFloat = a.readFloat32,
  35237. a.writeFloat64 = function(e, t) {
  35238. var i = void 0 === t;
  35239. if (i && (t = this.offset),
  35240. !this.noAssert) {
  35241. if ("number" != typeof e)
  35242. throw TypeError("Illegal value: " + e + " (not a number)");
  35243. if ("number" != typeof t || t % 1 != 0)
  35244. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35245. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35246. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35247. }
  35248. t += 8;
  35249. var n = this.buffer.byteLength;
  35250. return n < t && this.resize((n *= 2) > t ? n : t),
  35251. t -= 8,
  35252. r(this.view, e, t, this.littleEndian, 52, 8),
  35253. i && (this.offset += 8),
  35254. this
  35255. }
  35256. ,
  35257. a.writeDouble = a.writeFloat64,
  35258. a.readFloat64 = function(e) {
  35259. var t = void 0 === e;
  35260. if (t && (e = this.offset),
  35261. !this.noAssert) {
  35262. if ("number" != typeof e || e % 1 != 0)
  35263. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35264. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35265. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35266. }
  35267. var i = n(this.view, e, this.littleEndian, 52, 8);
  35268. return t && (this.offset += 8),
  35269. i
  35270. }
  35271. ,
  35272. a.readDouble = a.readFloat64,
  35273. f.MAX_VARINT32_BYTES = 5,
  35274. f.calculateVarint32 = function(e) {
  35275. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35276. }
  35277. ,
  35278. f.zigZagEncode32 = function(e) {
  35279. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35280. }
  35281. ,
  35282. f.zigZagDecode32 = function(e) {
  35283. return e >>> 1 ^ -(1 & e) | 0
  35284. }
  35285. ,
  35286. a.writeVarint32 = function(e, t) {
  35287. var i = void 0 === t;
  35288. if (i && (t = this.offset),
  35289. !this.noAssert) {
  35290. if ("number" != typeof e || e % 1 != 0)
  35291. throw TypeError("Illegal value: " + e + " (not an integer)");
  35292. if (e |= 0,
  35293. "number" != typeof t || t % 1 != 0)
  35294. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35295. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35296. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35297. }
  35298. var n, r = f.calculateVarint32(e);
  35299. t += r;
  35300. var o = this.buffer.byteLength;
  35301. for (o < t && this.resize((o *= 2) > t ? o : t),
  35302. t -= r,
  35303. e >>>= 0; 128 <= e; )
  35304. n = 127 & e | 128,
  35305. this.view[t++] = n,
  35306. e >>>= 7;
  35307. return this.view[t++] = e,
  35308. i ? (this.offset = t,
  35309. this) : r
  35310. }
  35311. ,
  35312. a.writeVarint32ZigZag = function(e, t) {
  35313. return this.writeVarint32(f.zigZagEncode32(e), t)
  35314. }
  35315. ,
  35316. a.readVarint32 = function(e) {
  35317. var t = void 0 === e;
  35318. if (t && (e = this.offset),
  35319. !this.noAssert) {
  35320. if ("number" != typeof e || e % 1 != 0)
  35321. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35322. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35323. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35324. }
  35325. var i, n = 0, r = 0;
  35326. do {
  35327. if (!this.noAssert && e > this.limit) {
  35328. var o = Error("Truncated");
  35329. throw o.truncated = !0,
  35330. o
  35331. }
  35332. i = this.view[e++],
  35333. n < 5 && (r |= (127 & i) << 7 * n),
  35334. ++n
  35335. } while (0 != (128 & i));return r |= 0,
  35336. t ? (this.offset = e,
  35337. r) : {
  35338. value: r,
  35339. length: n
  35340. }
  35341. }
  35342. ,
  35343. a.readVarint32ZigZag = function(e) {
  35344. var t = this.readVarint32(e);
  35345. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35346. t
  35347. }
  35348. ,
  35349. l && (f.MAX_VARINT64_BYTES = 10,
  35350. f.calculateVarint64 = function(e) {
  35351. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35352. var t = e.toInt() >>> 0
  35353. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35354. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35355. 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
  35356. }
  35357. ,
  35358. f.zigZagEncode64 = function(e) {
  35359. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35360. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35361. }
  35362. ,
  35363. f.zigZagDecode64 = function(e) {
  35364. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35365. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35366. }
  35367. ,
  35368. a.writeVarint64 = function(e, t) {
  35369. var i = void 0 === t;
  35370. if (i && (t = this.offset),
  35371. !this.noAssert) {
  35372. if ("number" == typeof e)
  35373. e = l.fromNumber(e);
  35374. else if ("string" == typeof e)
  35375. e = l.fromString(e);
  35376. else if (!(e && e instanceof l))
  35377. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35378. if ("number" != typeof t || t % 1 != 0)
  35379. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35380. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35381. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35382. }
  35383. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35384. var n = f.calculateVarint64(e)
  35385. , r = e.toInt() >>> 0
  35386. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35387. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35388. t += n;
  35389. var s = this.buffer.byteLength;
  35390. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35391. t -= n,
  35392. n) {
  35393. case 10:
  35394. this.view[t + 9] = a >>> 7 & 1;
  35395. case 9:
  35396. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35397. case 8:
  35398. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35399. case 7:
  35400. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35401. case 6:
  35402. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35403. case 5:
  35404. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35405. case 4:
  35406. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35407. case 3:
  35408. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35409. case 2:
  35410. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35411. case 1:
  35412. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35413. }
  35414. return i ? (this.offset += n,
  35415. this) : n
  35416. }
  35417. ,
  35418. a.writeVarint64ZigZag = function(e, t) {
  35419. return this.writeVarint64(f.zigZagEncode64(e), t)
  35420. }
  35421. ,
  35422. a.readVarint64 = 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 + 1 > this.buffer.byteLength)
  35429. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35430. }
  35431. var i = e
  35432. , n = 0
  35433. , r = 0
  35434. , o = 0
  35435. , a = 0;
  35436. if (n = 127 & (a = this.view[e++]),
  35437. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35438. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35439. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35440. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35441. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35442. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35443. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35444. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35445. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35446. 128 & a || this.noAssert && void 0 === a))))))))))
  35447. throw Error("Buffer overrun");
  35448. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35449. return t ? (this.offset = e,
  35450. s) : {
  35451. value: s,
  35452. length: e - i
  35453. }
  35454. }
  35455. ,
  35456. a.readVarint64ZigZag = function(e) {
  35457. var t = this.readVarint64(e);
  35458. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35459. t
  35460. }
  35461. ),
  35462. a.writeCString = function(e, t) {
  35463. var i = void 0 === t;
  35464. i && (t = this.offset);
  35465. var n, r = e.length;
  35466. if (!this.noAssert) {
  35467. if ("string" != typeof e)
  35468. throw TypeError("Illegal str: Not a string");
  35469. for (n = 0; n < r; ++n)
  35470. if (0 === e.charCodeAt(n))
  35471. throw RangeError("Illegal str: Contains NULL-characters");
  35472. if ("number" != typeof t || t % 1 != 0)
  35473. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35474. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35475. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35476. }
  35477. r = d.calculateUTF16asUTF8(s(e))[1],
  35478. t += r + 1;
  35479. var o = this.buffer.byteLength;
  35480. return o < t && this.resize((o *= 2) > t ? o : t),
  35481. t -= r + 1,
  35482. d.encodeUTF16toUTF8(s(e), function(e) {
  35483. this.view[t++] = e
  35484. }
  35485. .bind(this)),
  35486. this.view[t++] = 0,
  35487. i ? (this.offset = t,
  35488. this) : r
  35489. }
  35490. ,
  35491. a.readCString = function(e) {
  35492. var t = void 0 === e;
  35493. if (t && (e = this.offset),
  35494. !this.noAssert) {
  35495. if ("number" != typeof e || e % 1 != 0)
  35496. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35497. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35498. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35499. }
  35500. var i, n = e, r = -1;
  35501. return d.decodeUTF8toUTF16(function() {
  35502. if (0 === r)
  35503. return null;
  35504. if (e >= this.limit)
  35505. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35506. return 0 === (r = this.view[e++]) ? null : r
  35507. }
  35508. .bind(this), i = c(), !0),
  35509. t ? (this.offset = e,
  35510. i()) : {
  35511. string: i(),
  35512. length: e - n
  35513. }
  35514. }
  35515. ,
  35516. a.writeIString = function(e, t) {
  35517. var i = void 0 === t;
  35518. if (i && (t = this.offset),
  35519. !this.noAssert) {
  35520. if ("string" != typeof e)
  35521. throw TypeError("Illegal str: Not a string");
  35522. if ("number" != typeof t || t % 1 != 0)
  35523. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35524. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35525. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35526. }
  35527. var n, r = t;
  35528. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35529. t += 4 + n;
  35530. var o = this.buffer.byteLength;
  35531. if (o < t && this.resize((o *= 2) > t ? o : t),
  35532. t -= 4 + n,
  35533. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35534. this.view[t + 2] = n >>> 16 & 255,
  35535. this.view[t + 1] = n >>> 8 & 255,
  35536. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35537. this.view[t + 1] = n >>> 16 & 255,
  35538. this.view[t + 2] = n >>> 8 & 255,
  35539. this.view[t + 3] = 255 & n),
  35540. t += 4,
  35541. d.encodeUTF16toUTF8(s(e), function(e) {
  35542. this.view[t++] = e
  35543. }
  35544. .bind(this)),
  35545. t !== r + 4 + n)
  35546. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35547. return i ? (this.offset = t,
  35548. this) : t - r
  35549. }
  35550. ,
  35551. a.readIString = function(e) {
  35552. var t = void 0 === e;
  35553. if (t && (e = this.offset),
  35554. !this.noAssert) {
  35555. if ("number" != typeof e || e % 1 != 0)
  35556. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35557. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35558. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35559. }
  35560. var i = e
  35561. , n = this.readUint32(e)
  35562. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35563. return e += r.length,
  35564. t ? (this.offset = e,
  35565. r.string) : {
  35566. string: r.string,
  35567. length: e - i
  35568. }
  35569. }
  35570. ,
  35571. f.METRICS_CHARS = "c",
  35572. f.METRICS_BYTES = "b",
  35573. a.writeUTF8String = function(e, t) {
  35574. var i = void 0 === t;
  35575. if (i && (t = this.offset),
  35576. !this.noAssert) {
  35577. if ("number" != typeof t || t % 1 != 0)
  35578. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35579. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35580. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35581. }
  35582. var n, r = t;
  35583. n = d.calculateUTF16asUTF8(s(e))[1],
  35584. t += n;
  35585. var o = this.buffer.byteLength;
  35586. return o < t && this.resize((o *= 2) > t ? o : t),
  35587. t -= n,
  35588. d.encodeUTF16toUTF8(s(e), function(e) {
  35589. this.view[t++] = e
  35590. }
  35591. .bind(this)),
  35592. i ? (this.offset = t,
  35593. this) : t - r
  35594. }
  35595. ,
  35596. a.writeString = a.writeUTF8String,
  35597. f.calculateUTF8Chars = function(e) {
  35598. return d.calculateUTF16asUTF8(s(e))[0]
  35599. }
  35600. ,
  35601. f.calculateUTF8Bytes = function(e) {
  35602. return d.calculateUTF16asUTF8(s(e))[1]
  35603. }
  35604. ,
  35605. f.calculateString = f.calculateUTF8Bytes,
  35606. a.readUTF8String = function(e, t, i) {
  35607. "number" == typeof t && (i = t,
  35608. t = void 0);
  35609. var n = void 0 === i;
  35610. if (n && (i = this.offset),
  35611. void 0 === t && (t = f.METRICS_CHARS),
  35612. !this.noAssert) {
  35613. if ("number" != typeof e || e % 1 != 0)
  35614. throw TypeError("Illegal length: " + e + " (not an integer)");
  35615. if (e |= 0,
  35616. "number" != typeof i || i % 1 != 0)
  35617. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35618. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35619. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35620. }
  35621. var r, o = 0, a = i;
  35622. if (t === f.METRICS_CHARS) {
  35623. if (r = c(),
  35624. d.decodeUTF8(function() {
  35625. return o < e && i < this.limit ? this.view[i++] : null
  35626. }
  35627. .bind(this), function(e) {
  35628. ++o,
  35629. d.UTF8toUTF16(e, r)
  35630. }),
  35631. o !== e)
  35632. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35633. return n ? (this.offset = i,
  35634. r()) : {
  35635. string: r(),
  35636. length: i - a
  35637. }
  35638. }
  35639. if (t !== f.METRICS_BYTES)
  35640. throw TypeError("Unsupported metrics: " + t);
  35641. if (!this.noAssert) {
  35642. if ("number" != typeof i || i % 1 != 0)
  35643. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35644. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35645. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35646. }
  35647. var s = i + e;
  35648. if (d.decodeUTF8toUTF16(function() {
  35649. return i < s ? this.view[i++] : null
  35650. }
  35651. .bind(this), r = c(), this.noAssert),
  35652. i !== s)
  35653. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35654. return n ? (this.offset = i,
  35655. r()) : {
  35656. string: r(),
  35657. length: i - a
  35658. }
  35659. }
  35660. ,
  35661. a.readString = a.readUTF8String,
  35662. a.writeVString = function(e, t) {
  35663. var i = void 0 === t;
  35664. if (i && (t = this.offset),
  35665. !this.noAssert) {
  35666. if ("string" != typeof e)
  35667. throw TypeError("Illegal str: Not a string");
  35668. if ("number" != typeof t || t % 1 != 0)
  35669. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35670. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35671. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35672. }
  35673. var n, r, o = t;
  35674. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35675. r = f.calculateVarint32(n),
  35676. t += r + n;
  35677. var a = this.buffer.byteLength;
  35678. if (a < t && this.resize((a *= 2) > t ? a : t),
  35679. t -= r + n,
  35680. t += this.writeVarint32(n, t),
  35681. d.encodeUTF16toUTF8(s(e), function(e) {
  35682. this.view[t++] = e
  35683. }
  35684. .bind(this)),
  35685. t !== o + n + r)
  35686. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35687. return i ? (this.offset = t,
  35688. this) : t - o
  35689. }
  35690. ,
  35691. a.readVString = function(e) {
  35692. var t = void 0 === e;
  35693. if (t && (e = this.offset),
  35694. !this.noAssert) {
  35695. if ("number" != typeof e || e % 1 != 0)
  35696. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35697. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35698. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35699. }
  35700. var i = e
  35701. , n = this.readVarint32(e)
  35702. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35703. return e += r.length,
  35704. t ? (this.offset = e,
  35705. r.string) : {
  35706. string: r.string,
  35707. length: e - i
  35708. }
  35709. }
  35710. ,
  35711. a.append = function(e, t, i) {
  35712. "number" != typeof t && "string" == typeof t || (i = t,
  35713. t = void 0);
  35714. var n = void 0 === i;
  35715. if (n && (i = this.offset),
  35716. !this.noAssert) {
  35717. if ("number" != typeof i || i % 1 != 0)
  35718. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35719. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35720. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35721. }
  35722. e instanceof f || (e = f.wrap(e, t));
  35723. var r = e.limit - e.offset;
  35724. if (r <= 0)
  35725. return this;
  35726. i += r;
  35727. var o = this.buffer.byteLength;
  35728. return o < i && this.resize((o *= 2) > i ? o : i),
  35729. i -= r,
  35730. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35731. e.offset += r,
  35732. n && (this.offset += r),
  35733. this
  35734. }
  35735. ,
  35736. a.appendTo = function(e, t) {
  35737. return e.append(this, t),
  35738. this
  35739. }
  35740. ,
  35741. a.assert = function(e) {
  35742. return this.noAssert = !e,
  35743. this
  35744. }
  35745. ,
  35746. a.capacity = function() {
  35747. return this.buffer.byteLength
  35748. }
  35749. ,
  35750. a.clear = function() {
  35751. return this.offset = 0,
  35752. this.limit = this.buffer.byteLength,
  35753. this.markedOffset = -1,
  35754. this
  35755. }
  35756. ,
  35757. a.clone = function(e) {
  35758. var t = new f(0,this.littleEndian,this.noAssert);
  35759. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35760. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35761. t.view = this.view),
  35762. t.offset = this.offset,
  35763. t.markedOffset = this.markedOffset,
  35764. t.limit = this.limit,
  35765. t
  35766. }
  35767. ,
  35768. a.compact = function(e, t) {
  35769. if (void 0 === e && (e = this.offset),
  35770. void 0 === t && (t = this.limit),
  35771. !this.noAssert) {
  35772. if ("number" != typeof e || e % 1 != 0)
  35773. throw TypeError("Illegal begin: Not an integer");
  35774. if (e >>>= 0,
  35775. "number" != typeof t || t % 1 != 0)
  35776. throw TypeError("Illegal end: Not an integer");
  35777. if (t >>>= 0,
  35778. e < 0 || t < e || t > this.buffer.byteLength)
  35779. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35780. }
  35781. if (0 === e && t === this.buffer.byteLength)
  35782. return this;
  35783. var i = t - e;
  35784. if (0 == i)
  35785. return this.buffer = o,
  35786. this.view = null,
  35787. 0 <= this.markedOffset && (this.markedOffset -= e),
  35788. this.offset = 0,
  35789. this.limit = 0,
  35790. this;
  35791. var n = new ArrayBuffer(i)
  35792. , r = new Uint8Array(n);
  35793. return r.set(this.view.subarray(e, t)),
  35794. this.buffer = n,
  35795. this.view = r,
  35796. 0 <= this.markedOffset && (this.markedOffset -= e),
  35797. this.offset = 0,
  35798. this.limit = i,
  35799. this
  35800. }
  35801. ,
  35802. a.copy = function(e, t) {
  35803. if (void 0 === e && (e = this.offset),
  35804. void 0 === t && (t = this.limit),
  35805. !this.noAssert) {
  35806. if ("number" != typeof e || e % 1 != 0)
  35807. throw TypeError("Illegal begin: Not an integer");
  35808. if (e >>>= 0,
  35809. "number" != typeof t || t % 1 != 0)
  35810. throw TypeError("Illegal end: Not an integer");
  35811. if (t >>>= 0,
  35812. e < 0 || t < e || t > this.buffer.byteLength)
  35813. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35814. }
  35815. if (e === t)
  35816. return new f(0,this.littleEndian,this.noAssert);
  35817. var i = t - e
  35818. , n = new f(i,this.littleEndian,this.noAssert);
  35819. return n.offset = 0,
  35820. n.limit = i,
  35821. 0 <= n.markedOffset && (n.markedOffset -= e),
  35822. this.copyTo(n, 0, e, t),
  35823. n
  35824. }
  35825. ,
  35826. a.copyTo = function(e, t, i, n) {
  35827. var r, o;
  35828. if (!this.noAssert && !f.isByteBuffer(e))
  35829. throw TypeError("Illegal target: Not a ByteBuffer");
  35830. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35831. i = (r = void 0 === i) ? this.offset : 0 | i,
  35832. n = void 0 === n ? this.limit : 0 | n,
  35833. t < 0 || t > e.buffer.byteLength)
  35834. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35835. if (i < 0 || n > this.buffer.byteLength)
  35836. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35837. var a = n - i;
  35838. return 0 == a ? e : (e.ensureCapacity(t + a),
  35839. e.view.set(this.view.subarray(i, n), t),
  35840. r && (this.offset += a),
  35841. o && (e.offset += a),
  35842. this)
  35843. }
  35844. ,
  35845. a.ensureCapacity = function(e) {
  35846. var t = this.buffer.byteLength;
  35847. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35848. }
  35849. ,
  35850. a.fill = function(e, t, i) {
  35851. var n = void 0 === t;
  35852. if (n && (t = this.offset),
  35853. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35854. void 0 === t && (t = this.offset),
  35855. void 0 === i && (i = this.limit),
  35856. !this.noAssert) {
  35857. if ("number" != typeof e || e % 1 != 0)
  35858. throw TypeError("Illegal value: " + e + " (not an integer)");
  35859. if (e |= 0,
  35860. "number" != typeof t || t % 1 != 0)
  35861. throw TypeError("Illegal begin: Not an integer");
  35862. if (t >>>= 0,
  35863. "number" != typeof i || i % 1 != 0)
  35864. throw TypeError("Illegal end: Not an integer");
  35865. if (i >>>= 0,
  35866. t < 0 || i < t || i > this.buffer.byteLength)
  35867. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35868. }
  35869. if (i <= t)
  35870. return this;
  35871. for (; t < i; )
  35872. this.view[t++] = e;
  35873. return n && (this.offset = t),
  35874. this
  35875. }
  35876. ,
  35877. a.flip = function() {
  35878. return this.limit = this.offset,
  35879. this.offset = 0,
  35880. this
  35881. }
  35882. ,
  35883. a.mark = function(e) {
  35884. if (e = void 0 === e ? this.offset : e,
  35885. !this.noAssert) {
  35886. if ("number" != typeof e || e % 1 != 0)
  35887. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35888. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35889. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35890. }
  35891. return this.markedOffset = e,
  35892. this
  35893. }
  35894. ,
  35895. a.order = function(e) {
  35896. if (!this.noAssert && "boolean" != typeof e)
  35897. throw TypeError("Illegal littleEndian: Not a boolean");
  35898. return this.littleEndian = !!e,
  35899. this
  35900. }
  35901. ,
  35902. a.LE = function(e) {
  35903. return this.littleEndian = void 0 === e || !!e,
  35904. this
  35905. }
  35906. ,
  35907. a.BE = function(e) {
  35908. return this.littleEndian = void 0 !== e && !e,
  35909. this
  35910. }
  35911. ,
  35912. a.prepend = function(e, t, i) {
  35913. "number" != typeof t && "string" == typeof t || (i = t,
  35914. t = void 0);
  35915. var n = void 0 === i;
  35916. if (n && (i = this.offset),
  35917. !this.noAssert) {
  35918. if ("number" != typeof i || i % 1 != 0)
  35919. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35920. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35921. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35922. }
  35923. e instanceof f || (e = f.wrap(e, t));
  35924. var r = e.limit - e.offset;
  35925. if (r <= 0)
  35926. return this;
  35927. var o = r - i;
  35928. if (0 < o) {
  35929. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35930. , s = new Uint8Array(a);
  35931. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35932. this.buffer = a,
  35933. this.view = s,
  35934. this.offset += o,
  35935. 0 <= this.markedOffset && (this.markedOffset += o),
  35936. this.limit += o,
  35937. i += o
  35938. } else
  35939. new Uint8Array(this.buffer);
  35940. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35941. e.offset = e.limit,
  35942. n && (this.offset -= r),
  35943. this
  35944. }
  35945. ,
  35946. a.prependTo = function(e, t) {
  35947. return e.prepend(this, t),
  35948. this
  35949. }
  35950. ,
  35951. a.printDebug = function(e) {
  35952. "function" != typeof e && (e = console.log.bind(console)),
  35953. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35954. }
  35955. ,
  35956. a.remaining = function() {
  35957. return this.limit - this.offset
  35958. }
  35959. ,
  35960. a.reset = function() {
  35961. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35962. this.markedOffset = -1) : this.offset = 0,
  35963. this
  35964. }
  35965. ,
  35966. a.resize = function(e) {
  35967. if (!this.noAssert) {
  35968. if ("number" != typeof e || e % 1 != 0)
  35969. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35970. if ((e |= 0) < 0)
  35971. throw RangeError("Illegal capacity: 0 <= " + e)
  35972. }
  35973. if (this.buffer.byteLength < e) {
  35974. var t = new ArrayBuffer(e)
  35975. , i = new Uint8Array(t);
  35976. i.set(this.view),
  35977. this.buffer = t,
  35978. this.view = i
  35979. }
  35980. return this
  35981. }
  35982. ,
  35983. a.reverse = function(e, t) {
  35984. if (void 0 === e && (e = this.offset),
  35985. void 0 === t && (t = this.limit),
  35986. !this.noAssert) {
  35987. if ("number" != typeof e || e % 1 != 0)
  35988. throw TypeError("Illegal begin: Not an integer");
  35989. if (e >>>= 0,
  35990. "number" != typeof t || t % 1 != 0)
  35991. throw TypeError("Illegal end: Not an integer");
  35992. if (t >>>= 0,
  35993. e < 0 || t < e || t > this.buffer.byteLength)
  35994. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35995. }
  35996. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35997. this
  35998. }
  35999. ,
  36000. a.skip = function(e) {
  36001. if (!this.noAssert) {
  36002. if ("number" != typeof e || e % 1 != 0)
  36003. throw TypeError("Illegal length: " + e + " (not an integer)");
  36004. e |= 0
  36005. }
  36006. var t = this.offset + e;
  36007. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36008. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36009. return this.offset = t,
  36010. this
  36011. }
  36012. ,
  36013. a.slice = function(e, t) {
  36014. if (void 0 === e && (e = this.offset),
  36015. void 0 === t && (t = this.limit),
  36016. !this.noAssert) {
  36017. if ("number" != typeof e || e % 1 != 0)
  36018. throw TypeError("Illegal begin: Not an integer");
  36019. if (e >>>= 0,
  36020. "number" != typeof t || t % 1 != 0)
  36021. throw TypeError("Illegal end: Not an integer");
  36022. if (t >>>= 0,
  36023. e < 0 || t < e || t > this.buffer.byteLength)
  36024. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36025. }
  36026. var i = this.clone();
  36027. return i.offset = e,
  36028. i.limit = t,
  36029. i
  36030. }
  36031. ,
  36032. a.toBuffer = function(e) {
  36033. var t = this.offset
  36034. , i = this.limit;
  36035. if (!this.noAssert) {
  36036. if ("number" != typeof t || t % 1 != 0)
  36037. throw TypeError("Illegal offset: Not an integer");
  36038. if (t >>>= 0,
  36039. "number" != typeof i || i % 1 != 0)
  36040. throw TypeError("Illegal limit: Not an integer");
  36041. if (i >>>= 0,
  36042. t < 0 || i < t || i > this.buffer.byteLength)
  36043. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36044. }
  36045. if (!e && 0 === t && i === this.buffer.byteLength)
  36046. return this.buffer;
  36047. if (t === i)
  36048. return o;
  36049. var n = new ArrayBuffer(i - t);
  36050. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36051. n
  36052. }
  36053. ,
  36054. a.toArrayBuffer = a.toBuffer,
  36055. a.toString = function(e, t, i) {
  36056. if (void 0 === e)
  36057. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36058. switch ("number" == typeof e && (i = t = e = "utf8"),
  36059. e) {
  36060. case "utf8":
  36061. return this.toUTF8(t, i);
  36062. case "base64":
  36063. return this.toBase64(t, i);
  36064. case "hex":
  36065. return this.toHex(t, i);
  36066. case "binary":
  36067. return this.toBinary(t, i);
  36068. case "debug":
  36069. return this.toDebug();
  36070. case "columns":
  36071. return this.toColumns();
  36072. default:
  36073. throw Error("Unsupported encoding: " + e)
  36074. }
  36075. }
  36076. ;
  36077. var h = function() {
  36078. 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)
  36079. a[r[t]] = t;
  36080. return e.encode = function(e, t) {
  36081. for (var i, n; null !== (i = e()); )
  36082. t(r[i >> 2 & 63]),
  36083. n = (3 & i) << 4,
  36084. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36085. n = (15 & i) << 2,
  36086. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36087. t(r[63 & i])) : (t(r[63 & n]),
  36088. t(61))) : (t(r[63 & n]),
  36089. t(61),
  36090. t(61))
  36091. }
  36092. ,
  36093. e.decode = function(e, t) {
  36094. function i(e) {
  36095. throw Error("Illegal character code: " + e)
  36096. }
  36097. for (var n, r, o; null !== (n = e()); )
  36098. if (void 0 === (r = a[n]) && i(n),
  36099. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36100. t(r << 2 >>> 0 | (48 & o) >> 4),
  36101. null !== (n = e()))) {
  36102. if (void 0 === (r = a[n])) {
  36103. if (61 === n)
  36104. break;
  36105. i(n)
  36106. }
  36107. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36108. null !== (n = e())) {
  36109. if (void 0 === (o = a[n])) {
  36110. if (61 === n)
  36111. break;
  36112. i(n)
  36113. }
  36114. t((3 & r) << 6 >>> 0 | o)
  36115. }
  36116. }
  36117. }
  36118. ,
  36119. e.test = function(e) {
  36120. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36121. }
  36122. ,
  36123. e
  36124. }();
  36125. a.toBase64 = function(e, t) {
  36126. if (void 0 === e && (e = this.offset),
  36127. void 0 === t && (t = this.limit),
  36128. t |= 0,
  36129. (e |= 0) < 0 || t > this.capacity || t < e)
  36130. throw RangeError("begin, end");
  36131. var i;
  36132. return h.encode(function() {
  36133. return e < t ? this.view[e++] : null
  36134. }
  36135. .bind(this), i = c()),
  36136. i()
  36137. }
  36138. ,
  36139. f.fromBase64 = function(e, t) {
  36140. if ("string" != typeof e)
  36141. throw TypeError("str");
  36142. var i = new f(e.length / 4 * 3,t)
  36143. , n = 0;
  36144. return h.decode(s(e), function(e) {
  36145. i.view[n++] = e
  36146. }),
  36147. i.limit = n,
  36148. i
  36149. }
  36150. ,
  36151. f.btoa = function(e) {
  36152. return f.fromBinary(e).toBase64()
  36153. }
  36154. ,
  36155. f.atob = function(e) {
  36156. return f.fromBase64(e).toBinary()
  36157. }
  36158. ,
  36159. a.toBinary = function(e, t) {
  36160. if (void 0 === e && (e = this.offset),
  36161. void 0 === t && (t = this.limit),
  36162. t |= 0,
  36163. (e |= 0) < 0 || t > this.capacity() || t < e)
  36164. throw RangeError("begin, end");
  36165. if (e === t)
  36166. return "";
  36167. for (var i = [], n = []; e < t; )
  36168. i.push(this.view[e++]),
  36169. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36170. i = []);
  36171. return n.join("") + String.fromCharCode.apply(String, i)
  36172. }
  36173. ,
  36174. f.fromBinary = function(e, t) {
  36175. if ("string" != typeof e)
  36176. throw TypeError("str");
  36177. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36178. if (255 < (i = e.charCodeAt(n)))
  36179. throw RangeError("illegal char code: " + i);
  36180. o.view[n++] = i
  36181. }
  36182. return o.limit = r,
  36183. o
  36184. }
  36185. ,
  36186. a.toDebug = function(e) {
  36187. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36188. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36189. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36190. ++i,
  36191. e && 0 < i && i % 16 == 0 && i !== n) {
  36192. for (; r.length < 51; )
  36193. r += " ";
  36194. a += r + o + "\n",
  36195. r = o = ""
  36196. }
  36197. 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 ? " " : ""
  36198. }
  36199. if (e && " " !== r) {
  36200. for (; r.length < 51; )
  36201. r += " ";
  36202. a += r + o + "\n"
  36203. }
  36204. return e ? a : r
  36205. }
  36206. ,
  36207. f.fromDebug = function(e, t, i) {
  36208. 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; ) {
  36209. switch (n = e.charAt(s++)) {
  36210. case "!":
  36211. if (!i) {
  36212. if (h || u || d) {
  36213. p = !0;
  36214. break
  36215. }
  36216. h = u = d = !0
  36217. }
  36218. a.offset = a.markedOffset = a.limit = l,
  36219. c = !1;
  36220. break;
  36221. case "|":
  36222. if (!i) {
  36223. if (h || d) {
  36224. p = !0;
  36225. break
  36226. }
  36227. h = d = !0
  36228. }
  36229. a.offset = a.limit = l,
  36230. c = !1;
  36231. break;
  36232. case "[":
  36233. if (!i) {
  36234. if (h || u) {
  36235. p = !0;
  36236. break
  36237. }
  36238. h = u = !0
  36239. }
  36240. a.offset = a.markedOffset = l,
  36241. c = !1;
  36242. break;
  36243. case "<":
  36244. if (!i) {
  36245. if (h) {
  36246. p = !0;
  36247. break
  36248. }
  36249. h = !0
  36250. }
  36251. a.offset = l,
  36252. c = !1;
  36253. break;
  36254. case "]":
  36255. if (!i) {
  36256. if (d || u) {
  36257. p = !0;
  36258. break
  36259. }
  36260. d = u = !0
  36261. }
  36262. a.limit = a.markedOffset = l,
  36263. c = !1;
  36264. break;
  36265. case ">":
  36266. if (!i) {
  36267. if (d) {
  36268. p = !0;
  36269. break
  36270. }
  36271. d = !0
  36272. }
  36273. a.limit = l,
  36274. c = !1;
  36275. break;
  36276. case "'":
  36277. if (!i) {
  36278. if (u) {
  36279. p = !0;
  36280. break
  36281. }
  36282. u = !0
  36283. }
  36284. a.markedOffset = l,
  36285. c = !1;
  36286. break;
  36287. case " ":
  36288. c = !1;
  36289. break;
  36290. default:
  36291. if (!i && c) {
  36292. p = !0;
  36293. break
  36294. }
  36295. if (r = parseInt(n + e.charAt(s++), 16),
  36296. !i && (isNaN(r) || r < 0 || 255 < r))
  36297. throw TypeError("Illegal str: Not a debug encoded string");
  36298. a.view[l++] = r,
  36299. c = !0
  36300. }
  36301. if (p)
  36302. throw TypeError("Illegal str: Invalid symbol at " + s)
  36303. }
  36304. if (!i) {
  36305. if (!h || !d)
  36306. throw TypeError("Illegal str: Missing offset or limit");
  36307. if (l < a.buffer.byteLength)
  36308. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36309. }
  36310. return a
  36311. }
  36312. ,
  36313. a.toHex = function(e, t) {
  36314. if (e = void 0 === e ? this.offset : e,
  36315. t = void 0 === t ? this.limit : t,
  36316. !this.noAssert) {
  36317. if ("number" != typeof e || e % 1 != 0)
  36318. throw TypeError("Illegal begin: Not an integer");
  36319. if (e >>>= 0,
  36320. "number" != typeof t || t % 1 != 0)
  36321. throw TypeError("Illegal end: Not an integer");
  36322. if (t >>>= 0,
  36323. e < 0 || t < e || t > this.buffer.byteLength)
  36324. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36325. }
  36326. for (var i, n = new Array(t - e); e < t; )
  36327. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36328. return n.join("")
  36329. }
  36330. ,
  36331. f.fromHex = function(e, t, i) {
  36332. if (!i) {
  36333. if ("string" != typeof e)
  36334. throw TypeError("Illegal str: Not a string");
  36335. if (e.length % 2 != 0)
  36336. throw TypeError("Illegal str: Length not a multiple of 2")
  36337. }
  36338. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36339. if (n = parseInt(e.substring(a, a + 2), 16),
  36340. !i && (!isFinite(n) || n < 0 || 255 < n))
  36341. throw TypeError("Illegal str: Contains non-hex characters");
  36342. o.view[s++] = n
  36343. }
  36344. return o.limit = s,
  36345. o
  36346. }
  36347. ;
  36348. var u, d = u = {
  36349. MAX_CODEPOINT: 1114111,
  36350. encodeUTF8: function(e, t) {
  36351. var i = null;
  36352. for ("number" == typeof e && (i = e,
  36353. e = function() {
  36354. return null
  36355. }
  36356. ); null !== i || null !== (i = e()); )
  36357. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36358. t(i >> 12 & 63 | 128)),
  36359. t(i >> 6 & 63 | 128)),
  36360. t(63 & i | 128)),
  36361. i = null
  36362. },
  36363. decodeUTF8: function(e, t) {
  36364. for (var i, n, r, o, a = function(e) {
  36365. e = e.slice(0, e.indexOf(null));
  36366. var t = Error(e.toString());
  36367. throw t.name = "TruncatedError",
  36368. t.bytes = e,
  36369. t
  36370. }; null !== (i = e()); )
  36371. if (0 == (128 & i))
  36372. t(i);
  36373. else if (192 == (224 & i))
  36374. null === (n = e()) && a([i, n]),
  36375. t((31 & i) << 6 | 63 & n);
  36376. else if (224 == (240 & i))
  36377. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36378. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36379. else {
  36380. if (240 != (248 & i))
  36381. throw RangeError("Illegal starting byte: " + i);
  36382. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36383. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36384. }
  36385. },
  36386. UTF16toUTF8: function(e, t) {
  36387. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36388. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36389. n = null) : t(i);
  36390. null !== n && t(n)
  36391. },
  36392. UTF8toUTF16: function(e, t) {
  36393. var i = null;
  36394. for ("number" == typeof e && (i = e,
  36395. e = function() {
  36396. return null
  36397. }
  36398. ); null !== i || null !== (i = e()); )
  36399. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36400. t(i % 1024 + 56320)),
  36401. i = null
  36402. },
  36403. encodeUTF16toUTF8: function(e, t) {
  36404. u.UTF16toUTF8(e, function(e) {
  36405. u.encodeUTF8(e, t)
  36406. })
  36407. },
  36408. decodeUTF8toUTF16: function(e, t) {
  36409. u.decodeUTF8(e, function(e) {
  36410. u.UTF8toUTF16(e, t)
  36411. })
  36412. },
  36413. calculateCodePoint: function(e) {
  36414. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36415. },
  36416. calculateUTF8: function(e) {
  36417. for (var t, i = 0; null !== (t = e()); )
  36418. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36419. return i
  36420. },
  36421. calculateUTF16asUTF8: function(e) {
  36422. var t = 0
  36423. , i = 0;
  36424. return u.UTF16toUTF8(e, function(e) {
  36425. ++t,
  36426. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36427. }),
  36428. [t, i]
  36429. }
  36430. };
  36431. return a.toUTF8 = function(t, i) {
  36432. if (void 0 === t && (t = this.offset),
  36433. void 0 === i && (i = this.limit),
  36434. !this.noAssert) {
  36435. if ("number" != typeof t || t % 1 != 0)
  36436. throw TypeError("Illegal begin: Not an integer");
  36437. if (t >>>= 0,
  36438. "number" != typeof i || i % 1 != 0)
  36439. throw TypeError("Illegal end: Not an integer");
  36440. if (i >>>= 0,
  36441. t < 0 || i < t || i > this.buffer.byteLength)
  36442. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36443. }
  36444. var e;
  36445. try {
  36446. d.decodeUTF8toUTF16(function() {
  36447. return t < i ? this.view[t++] : null
  36448. }
  36449. .bind(this), e = c())
  36450. } catch (e) {
  36451. if (t !== i)
  36452. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36453. }
  36454. return e()
  36455. }
  36456. ,
  36457. f.fromUTF8 = function(e, t, i) {
  36458. if (!i && "string" != typeof e)
  36459. throw TypeError("Illegal str: Not a string");
  36460. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36461. , r = 0;
  36462. return d.encodeUTF16toUTF8(s(e), function(e) {
  36463. n.view[r++] = e
  36464. }),
  36465. n.limit = r,
  36466. n
  36467. }
  36468. ,
  36469. f
  36470. }
  36471. ,
  36472. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36473. var e;
  36474. try {
  36475. e = t("long")
  36476. } catch (e) {}
  36477. return r(e)
  36478. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36479. }
  36480. , {
  36481. long: 216
  36482. }],
  36483. 216: [function(e, t, i) {
  36484. var n, r;
  36485. n = this,
  36486. r = function() {
  36487. "use strict";
  36488. function n(e, t, i) {
  36489. this.low = 0 | e,
  36490. this.high = 0 | t,
  36491. this.unsigned = !!i
  36492. }
  36493. function p(e) {
  36494. return !0 === (e && e.__isLong__)
  36495. }
  36496. function e(e, t) {
  36497. var i, n, r;
  36498. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36499. r && (a[e] = i),
  36500. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36501. r && (o[e] = i),
  36502. i)
  36503. }
  36504. function f(e, t) {
  36505. if (isNaN(e) || !isFinite(e))
  36506. return t ? l : y;
  36507. if (t) {
  36508. if (e < 0)
  36509. return l;
  36510. if (r <= e)
  36511. return I
  36512. } else {
  36513. if (e <= -s)
  36514. return E;
  36515. if (s <= e + 1)
  36516. return C
  36517. }
  36518. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36519. }
  36520. function g(e, t, i) {
  36521. return new n(e,t,i)
  36522. }
  36523. function h(e, t, i) {
  36524. if (0 === e.length)
  36525. throw Error("empty string");
  36526. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36527. return y;
  36528. if (t = "number" == typeof t ? (i = t,
  36529. !1) : !!t,
  36530. (i = i || 10) < 2 || 36 < i)
  36531. throw RangeError("radix");
  36532. var n;
  36533. if (0 < (n = e.indexOf("-")))
  36534. throw Error("interior hyphen");
  36535. if (0 === n)
  36536. return h(e.substring(1), t, i).neg();
  36537. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36538. var s = Math.min(8, e.length - a)
  36539. , l = parseInt(e.substring(a, a + s), i);
  36540. if (s < 8) {
  36541. var c = f(u(i, s));
  36542. o = o.mul(c).add(f(l))
  36543. } else
  36544. o = (o = o.mul(r)).add(f(l))
  36545. }
  36546. return o.unsigned = t,
  36547. o
  36548. }
  36549. function m(e) {
  36550. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36551. }
  36552. Object.defineProperty(n.prototype, "__isLong__", {
  36553. value: !0,
  36554. enumerable: !1,
  36555. configurable: !1
  36556. }),
  36557. n.isLong = p;
  36558. var o = {}
  36559. , a = {};
  36560. n.fromInt = e,
  36561. n.fromNumber = f,
  36562. n.fromBits = g;
  36563. var u = Math.pow;
  36564. n.fromString = h,
  36565. n.fromValue = m;
  36566. var i = 4294967296
  36567. , r = 0x10000000000000000
  36568. , s = r / 2
  36569. , v = e(1 << 24)
  36570. , y = e(0);
  36571. n.ZERO = y;
  36572. var l = e(0, !0);
  36573. n.UZERO = l;
  36574. var c = e(1);
  36575. n.ONE = c;
  36576. var d = e(1, !0);
  36577. n.UONE = d;
  36578. var A = e(-1);
  36579. n.NEG_ONE = A;
  36580. var C = g(-1, 2147483647, !1);
  36581. n.MAX_VALUE = C;
  36582. var I = g(-1, -1, !0);
  36583. n.MAX_UNSIGNED_VALUE = I;
  36584. var E = g(0, -2147483648, !1);
  36585. n.MIN_VALUE = E;
  36586. var t = n.prototype;
  36587. return t.toInt = function() {
  36588. return this.unsigned ? this.low >>> 0 : this.low
  36589. }
  36590. ,
  36591. t.toNumber = function() {
  36592. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36593. }
  36594. ,
  36595. t.toString = function(e) {
  36596. if ((e = e || 10) < 2 || 36 < e)
  36597. throw RangeError("radix");
  36598. if (this.isZero())
  36599. return "0";
  36600. if (this.isNegative()) {
  36601. if (this.eq(E)) {
  36602. var t = f(e)
  36603. , i = this.div(t)
  36604. , n = i.mul(t).sub(this);
  36605. return i.toString(e) + n.toInt().toString(e)
  36606. }
  36607. return "-" + this.neg().toString(e)
  36608. }
  36609. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36610. var s = o.div(r)
  36611. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36612. if ((o = s).isZero())
  36613. return l + a;
  36614. for (; l.length < 6; )
  36615. l = "0" + l;
  36616. a = "" + l + a
  36617. }
  36618. }
  36619. ,
  36620. t.getHighBits = function() {
  36621. return this.high
  36622. }
  36623. ,
  36624. t.getHighBitsUnsigned = function() {
  36625. return this.high >>> 0
  36626. }
  36627. ,
  36628. t.getLowBits = function() {
  36629. return this.low
  36630. }
  36631. ,
  36632. t.getLowBitsUnsigned = function() {
  36633. return this.low >>> 0
  36634. }
  36635. ,
  36636. t.getNumBitsAbs = function() {
  36637. if (this.isNegative())
  36638. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36639. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36640. ;
  36641. return 0 != this.high ? t + 33 : t + 1
  36642. }
  36643. ,
  36644. t.isZero = function() {
  36645. return 0 === this.high && 0 === this.low
  36646. }
  36647. ,
  36648. t.isNegative = function() {
  36649. return !this.unsigned && this.high < 0
  36650. }
  36651. ,
  36652. t.isPositive = function() {
  36653. return this.unsigned || 0 <= this.high
  36654. }
  36655. ,
  36656. t.isOdd = function() {
  36657. return 1 == (1 & this.low)
  36658. }
  36659. ,
  36660. t.isEven = function() {
  36661. return 0 == (1 & this.low)
  36662. }
  36663. ,
  36664. t.equals = function(e) {
  36665. return p(e) || (e = m(e)),
  36666. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36667. }
  36668. ,
  36669. t.eq = t.equals,
  36670. t.notEquals = function(e) {
  36671. return !this.eq(e)
  36672. }
  36673. ,
  36674. t.neq = t.notEquals,
  36675. t.lessThan = function(e) {
  36676. return this.comp(e) < 0
  36677. }
  36678. ,
  36679. t.lt = t.lessThan,
  36680. t.lessThanOrEqual = function(e) {
  36681. return this.comp(e) <= 0
  36682. }
  36683. ,
  36684. t.lte = t.lessThanOrEqual,
  36685. t.greaterThan = function(e) {
  36686. return 0 < this.comp(e)
  36687. }
  36688. ,
  36689. t.gt = t.greaterThan,
  36690. t.greaterThanOrEqual = function(e) {
  36691. return 0 <= this.comp(e)
  36692. }
  36693. ,
  36694. t.gte = t.greaterThanOrEqual,
  36695. t.compare = function(e) {
  36696. if (p(e) || (e = m(e)),
  36697. this.eq(e))
  36698. return 0;
  36699. var t = this.isNegative()
  36700. , i = e.isNegative();
  36701. 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
  36702. }
  36703. ,
  36704. t.comp = t.compare,
  36705. t.negate = function() {
  36706. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36707. }
  36708. ,
  36709. t.neg = t.negate,
  36710. t.add = function(e) {
  36711. p(e) || (e = m(e));
  36712. var t = this.high >>> 16
  36713. , i = 65535 & this.high
  36714. , n = this.low >>> 16
  36715. , r = 65535 & this.low
  36716. , o = e.high >>> 16
  36717. , a = 65535 & e.high
  36718. , s = e.low >>> 16
  36719. , l = 0
  36720. , c = 0
  36721. , h = 0
  36722. , u = 0;
  36723. return h += (u += r + (65535 & e.low)) >>> 16,
  36724. c += (h += n + s) >>> 16,
  36725. l += (c += i + a) >>> 16,
  36726. l += t + o,
  36727. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36728. }
  36729. ,
  36730. t.subtract = function(e) {
  36731. return p(e) || (e = m(e)),
  36732. this.add(e.neg())
  36733. }
  36734. ,
  36735. t.sub = t.subtract,
  36736. t.multiply = function(e) {
  36737. if (this.isZero())
  36738. return y;
  36739. if (p(e) || (e = m(e)),
  36740. e.isZero())
  36741. return y;
  36742. if (this.eq(E))
  36743. return e.isOdd() ? E : y;
  36744. if (e.eq(E))
  36745. return this.isOdd() ? E : y;
  36746. if (this.isNegative())
  36747. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36748. if (e.isNegative())
  36749. return this.mul(e.neg()).neg();
  36750. if (this.lt(v) && e.lt(v))
  36751. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36752. var t = this.high >>> 16
  36753. , i = 65535 & this.high
  36754. , n = this.low >>> 16
  36755. , r = 65535 & this.low
  36756. , o = e.high >>> 16
  36757. , a = 65535 & e.high
  36758. , s = e.low >>> 16
  36759. , l = 65535 & e.low
  36760. , c = 0
  36761. , h = 0
  36762. , u = 0
  36763. , d = 0;
  36764. return u += (d += r * l) >>> 16,
  36765. h += (u += n * l) >>> 16,
  36766. u &= 65535,
  36767. h += (u += r * s) >>> 16,
  36768. c += (h += i * l) >>> 16,
  36769. h &= 65535,
  36770. c += (h += n * s) >>> 16,
  36771. h &= 65535,
  36772. c += (h += r * a) >>> 16,
  36773. c += t * l + i * s + n * a + r * o,
  36774. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36775. }
  36776. ,
  36777. t.mul = t.multiply,
  36778. t.divide = function(e) {
  36779. if (p(e) || (e = m(e)),
  36780. e.isZero())
  36781. throw Error("division by zero");
  36782. if (this.isZero())
  36783. return this.unsigned ? l : y;
  36784. var t, i, n;
  36785. if (this.unsigned) {
  36786. if (e.unsigned || (e = e.toUnsigned()),
  36787. e.gt(this))
  36788. return l;
  36789. if (e.gt(this.shru(1)))
  36790. return d;
  36791. n = l
  36792. } else {
  36793. if (this.eq(E))
  36794. 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)),
  36795. n = t.add(i.div(e)));
  36796. if (e.eq(E))
  36797. return this.unsigned ? l : y;
  36798. if (this.isNegative())
  36799. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36800. if (e.isNegative())
  36801. return this.div(e.neg()).neg();
  36802. n = y
  36803. }
  36804. for (i = this; i.gte(e); ) {
  36805. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36806. 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); )
  36807. s = (a = f(t -= o, this.unsigned)).mul(e);
  36808. a.isZero() && (a = c),
  36809. n = n.add(a),
  36810. i = i.sub(s)
  36811. }
  36812. return n
  36813. }
  36814. ,
  36815. t.div = t.divide,
  36816. t.modulo = function(e) {
  36817. return p(e) || (e = m(e)),
  36818. this.sub(this.div(e).mul(e))
  36819. }
  36820. ,
  36821. t.mod = t.modulo,
  36822. t.not = function() {
  36823. return g(~this.low, ~this.high, this.unsigned)
  36824. }
  36825. ,
  36826. t.and = function(e) {
  36827. return p(e) || (e = m(e)),
  36828. g(this.low & e.low, this.high & e.high, this.unsigned)
  36829. }
  36830. ,
  36831. t.or = function(e) {
  36832. return p(e) || (e = m(e)),
  36833. g(this.low | e.low, this.high | e.high, this.unsigned)
  36834. }
  36835. ,
  36836. t.xor = function(e) {
  36837. return p(e) || (e = m(e)),
  36838. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36839. }
  36840. ,
  36841. t.shiftLeft = function(e) {
  36842. return p(e) && (e = e.toInt()),
  36843. 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)
  36844. }
  36845. ,
  36846. t.shl = t.shiftLeft,
  36847. t.shiftRight = function(e) {
  36848. return p(e) && (e = e.toInt()),
  36849. 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)
  36850. }
  36851. ,
  36852. t.shr = t.shiftRight,
  36853. t.shiftRightUnsigned = function(e) {
  36854. if (p(e) && (e = e.toInt()),
  36855. 0 === (e &= 63))
  36856. return this;
  36857. var t = this.high;
  36858. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36859. }
  36860. ,
  36861. t.shru = t.shiftRightUnsigned,
  36862. t.toSigned = function() {
  36863. return this.unsigned ? g(this.low, this.high, !1) : this
  36864. }
  36865. ,
  36866. t.toUnsigned = function() {
  36867. return this.unsigned ? this : g(this.low, this.high, !0)
  36868. }
  36869. ,
  36870. t.toBytes = function(e) {
  36871. return e ? this.toBytesLE() : this.toBytesBE()
  36872. }
  36873. ,
  36874. t.toBytesLE = function() {
  36875. var e = this.high
  36876. , t = this.low;
  36877. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36878. }
  36879. ,
  36880. t.toBytesBE = function() {
  36881. var e = this.high
  36882. , t = this.low;
  36883. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36884. }
  36885. ,
  36886. n
  36887. }
  36888. ,
  36889. "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()
  36890. }
  36891. , {}],
  36892. 217: [function(e, t, i) {
  36893. 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 = {
  36894. REVISION: "75"
  36895. };
  36896. function Ii(e, t) {
  36897. return e.distance - t.distance
  36898. }
  36899. function Ei(e, t, i, n) {
  36900. if (!1 !== e.visible && (e.raycast(t, i),
  36901. !0 === n))
  36902. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36903. Ei(r[o], t, i, !0)
  36904. }
  36905. function _i(e, t, i) {
  36906. return i < 0 && (i += 1),
  36907. 1 < i && (i -= 1),
  36908. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36909. }
  36910. function bi(e, t, i, n, r, o, a) {
  36911. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36912. r.multiplyScalar(Vt.x),
  36913. o.multiplyScalar(Vt.y),
  36914. a.multiplyScalar(Vt.z),
  36915. r.add(o).add(a),
  36916. r.clone()
  36917. }
  36918. function wi(e, t, i, n, r, o, a) {
  36919. var s = e.material;
  36920. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36921. return null;
  36922. Ut.copy(a),
  36923. Ut.applyMatrix4(e.matrixWorld);
  36924. var l = t.ray.origin.distanceTo(Ut);
  36925. return l < t.near || l > t.far ? null : {
  36926. distance: l,
  36927. point: Ut.clone(),
  36928. object: e
  36929. }
  36930. }
  36931. function Ti(e, t, i, n, r, o, a, s) {
  36932. Mt.fromArray(n, 3 * o),
  36933. Rt.fromArray(n, 3 * a),
  36934. Pt.fromArray(n, 3 * s);
  36935. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36936. return l && (r && (Nt.fromArray(r, 2 * o),
  36937. Ft.fromArray(r, 2 * a),
  36938. Bt.fromArray(r, 2 * s),
  36939. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36940. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36941. l.faceIndex = o),
  36942. l
  36943. }
  36944. function xi() {}
  36945. function Si(e, t, i, n, r, o) {
  36946. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36947. if (s = e[o[t]].x,
  36948. l = e[o[t]].y,
  36949. c = e[o[i]].x,
  36950. h = e[o[i]].y,
  36951. u = e[o[n]].x,
  36952. d = e[o[n]].y,
  36953. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36954. return !1;
  36955. for (g = u - c,
  36956. m = d - h,
  36957. v = s - u,
  36958. y = l - d,
  36959. A = c - s,
  36960. C = h - l,
  36961. a = 0; a < r; a++)
  36962. if (p = e[o[a]].x,
  36963. f = e[o[a]].y,
  36964. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36965. E = v * (f - d) - y * (p - u),
  36966. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36967. return !1;
  36968. return !0
  36969. }
  36970. function Mi(e) {
  36971. switch (e) {
  36972. case Ci.LinearEncoding:
  36973. return ["Linear", "( value )"];
  36974. case Ci.sRGBEncoding:
  36975. return ["sRGB", "( value )"];
  36976. case Ci.RGBEEncoding:
  36977. return ["RGBE", "( value )"];
  36978. case Ci.RGBM7Encoding:
  36979. return ["RGBM", "( value, 7.0 )"];
  36980. case Ci.RGBM16Encoding:
  36981. return ["RGBM", "( value, 16.0 )"];
  36982. case Ci.RGBDEncoding:
  36983. return ["RGBD", "( value, 256.0 )"];
  36984. case Ci.GammaEncoding:
  36985. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36986. default:
  36987. throw new Error("unsupported encoding: " + e)
  36988. }
  36989. }
  36990. function Ri(e, t) {
  36991. var i = Mi(t);
  36992. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36993. }
  36994. function Pi(e) {
  36995. return "" !== e
  36996. }
  36997. function Oi(e, t) {
  36998. 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)
  36999. }
  37000. function Li(e) {
  37001. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37002. var i = Ci.ShaderChunk[t];
  37003. if (void 0 === i)
  37004. throw new Error("Can not resolve #include <" + t + ">");
  37005. return Li(i)
  37006. })
  37007. }
  37008. function Di(e) {
  37009. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37010. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37011. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37012. return r
  37013. })
  37014. }
  37015. function Ni(e, t, i, n) {
  37016. gi.set(t, i, n).unproject(mi);
  37017. var r = fi[e];
  37018. if (void 0 !== r)
  37019. for (var o = 0, a = r.length; o < a; o++)
  37020. pi.vertices[r[o]].copy(gi)
  37021. }
  37022. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37023. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37024. void 0 === Math.sign && (Math.sign = function(e) {
  37025. return e < 0 ? -1 : 0 < e ? 1 : +e
  37026. }
  37027. ),
  37028. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37029. get: function() {
  37030. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37031. }
  37032. }),
  37033. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37034. writable: !0,
  37035. configurable: !0,
  37036. value: function(e) {
  37037. "use strict";
  37038. if (null == e)
  37039. throw new TypeError("Cannot convert first argument to object");
  37040. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37041. var r = arguments[i];
  37042. if (null != r) {
  37043. r = Object(r);
  37044. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37045. var l = o[a]
  37046. , c = Object.getOwnPropertyDescriptor(r, l);
  37047. void 0 !== c && c.enumerable && (t[l] = r[l])
  37048. }
  37049. }
  37050. }
  37051. return t
  37052. }
  37053. }),
  37054. Ci.MOUSE = {
  37055. LEFT: 0,
  37056. MIDDLE: 1,
  37057. RIGHT: 2
  37058. },
  37059. Ci.CullFaceNone = 0,
  37060. Ci.CullFaceBack = 1,
  37061. Ci.CullFaceFront = 2,
  37062. Ci.CullFaceFrontBack = 3,
  37063. Ci.FrontFaceDirectionCW = 0,
  37064. Ci.FrontFaceDirectionCCW = 1,
  37065. Ci.BasicShadowMap = 0,
  37066. Ci.PCFShadowMap = 1,
  37067. Ci.PCFSoftShadowMap = 2,
  37068. Ci.FrontSide = 0,
  37069. Ci.BackSide = 1,
  37070. Ci.DoubleSide = 2,
  37071. Ci.FlatShading = 1,
  37072. Ci.SmoothShading = 2,
  37073. Ci.NoColors = 0,
  37074. Ci.FaceColors = 1,
  37075. Ci.VertexColors = 2,
  37076. Ci.NoBlending = 0,
  37077. Ci.NormalBlending = 1,
  37078. Ci.AdditiveBlending = 2,
  37079. Ci.SubtractiveBlending = 3,
  37080. Ci.MultiplyBlending = 4,
  37081. Ci.CustomBlending = 5,
  37082. Ci.AddEquation = 100,
  37083. Ci.SubtractEquation = 101,
  37084. Ci.ReverseSubtractEquation = 102,
  37085. Ci.MinEquation = 103,
  37086. Ci.MaxEquation = 104,
  37087. Ci.ZeroFactor = 200,
  37088. Ci.OneFactor = 201,
  37089. Ci.SrcColorFactor = 202,
  37090. Ci.OneMinusSrcColorFactor = 203,
  37091. Ci.SrcAlphaFactor = 204,
  37092. Ci.OneMinusSrcAlphaFactor = 205,
  37093. Ci.DstAlphaFactor = 206,
  37094. Ci.OneMinusDstAlphaFactor = 207,
  37095. Ci.DstColorFactor = 208,
  37096. Ci.OneMinusDstColorFactor = 209,
  37097. Ci.SrcAlphaSaturateFactor = 210,
  37098. Ci.NeverDepth = 0,
  37099. Ci.AlwaysDepth = 1,
  37100. Ci.LessDepth = 2,
  37101. Ci.LessEqualDepth = 3,
  37102. Ci.EqualDepth = 4,
  37103. Ci.GreaterEqualDepth = 5,
  37104. Ci.GreaterDepth = 6,
  37105. Ci.NotEqualDepth = 7,
  37106. Ci.MultiplyOperation = 0,
  37107. Ci.MixOperation = 1,
  37108. Ci.AddOperation = 2,
  37109. Ci.NoToneMapping = 0,
  37110. Ci.LinearToneMapping = 1,
  37111. Ci.ReinhardToneMapping = 2,
  37112. Ci.Uncharted2ToneMapping = 3,
  37113. Ci.CineonToneMapping = 4,
  37114. Ci.UVMapping = 300,
  37115. Ci.CubeReflectionMapping = 301,
  37116. Ci.CubeRefractionMapping = 302,
  37117. Ci.EquirectangularReflectionMapping = 303,
  37118. Ci.EquirectangularRefractionMapping = 304,
  37119. Ci.SphericalReflectionMapping = 305,
  37120. Ci.CubeUVReflectionMapping = 306,
  37121. Ci.CubeUVRefractionMapping = 307,
  37122. Ci.RepeatWrapping = 1e3,
  37123. Ci.ClampToEdgeWrapping = 1001,
  37124. Ci.MirroredRepeatWrapping = 1002,
  37125. Ci.NearestFilter = 1003,
  37126. Ci.NearestMipMapNearestFilter = 1004,
  37127. Ci.NearestMipMapLinearFilter = 1005,
  37128. Ci.LinearFilter = 1006,
  37129. Ci.LinearMipMapNearestFilter = 1007,
  37130. Ci.LinearMipMapLinearFilter = 1008,
  37131. Ci.UnsignedByteType = 1009,
  37132. Ci.ByteType = 1010,
  37133. Ci.ShortType = 1011,
  37134. Ci.UnsignedShortType = 1012,
  37135. Ci.IntType = 1013,
  37136. Ci.UnsignedIntType = 1014,
  37137. Ci.FloatType = 1015,
  37138. Ci.HalfFloatType = 1025,
  37139. Ci.UnsignedShort4444Type = 1016,
  37140. Ci.UnsignedShort5551Type = 1017,
  37141. Ci.UnsignedShort565Type = 1018,
  37142. Ci.AlphaFormat = 1019,
  37143. Ci.RGBFormat = 1020,
  37144. Ci.RGBAFormat = 1021,
  37145. Ci.LuminanceFormat = 1022,
  37146. Ci.LuminanceAlphaFormat = 1023,
  37147. Ci.RGBEFormat = Ci.RGBAFormat,
  37148. Ci.RGB_S3TC_DXT1_Format = 2001,
  37149. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37150. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37151. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37152. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37153. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37154. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37155. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37156. Ci.RGB_ETC1_Format = 2151,
  37157. Ci.LoopOnce = 2200,
  37158. Ci.LoopRepeat = 2201,
  37159. Ci.LoopPingPong = 2202,
  37160. Ci.InterpolateDiscrete = 2300,
  37161. Ci.InterpolateLinear = 2301,
  37162. Ci.InterpolateSmooth = 2302,
  37163. Ci.ZeroCurvatureEnding = 2400,
  37164. Ci.ZeroSlopeEnding = 2401,
  37165. Ci.WrapAroundEnding = 2402,
  37166. Ci.TrianglesDrawMode = 0,
  37167. Ci.TriangleStripDrawMode = 1,
  37168. Ci.TriangleFanDrawMode = 2,
  37169. Ci.LinearEncoding = 3e3,
  37170. Ci.sRGBEncoding = 3001,
  37171. Ci.GammaEncoding = 3007,
  37172. Ci.RGBEEncoding = 3002,
  37173. Ci.LogLuvEncoding = 3003,
  37174. Ci.RGBM7Encoding = 3004,
  37175. Ci.RGBM16Encoding = 3005,
  37176. Ci.RGBDEncoding = 3006,
  37177. Ci.Color = function(e) {
  37178. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37179. }
  37180. ,
  37181. Ci.Color.prototype = {
  37182. constructor: Ci.Color,
  37183. r: 1,
  37184. g: 1,
  37185. b: 1,
  37186. set: function(e) {
  37187. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37188. this
  37189. },
  37190. setScalar: function(e) {
  37191. this.r = e,
  37192. this.g = e,
  37193. this.b = e
  37194. },
  37195. setHex: function(e) {
  37196. return e = Math.floor(e),
  37197. this.r = (e >> 16 & 255) / 255,
  37198. this.g = (e >> 8 & 255) / 255,
  37199. this.b = (255 & e) / 255,
  37200. this
  37201. },
  37202. setRGB: function(e, t, i) {
  37203. return this.r = e,
  37204. this.g = t,
  37205. this.b = i,
  37206. this
  37207. },
  37208. setHSL: function(e, t, i) {
  37209. if (e = Ci.Math.euclideanModulo(e, 1),
  37210. t = Ci.Math.clamp(t, 0, 1),
  37211. i = Ci.Math.clamp(i, 0, 1),
  37212. 0 === t)
  37213. this.r = this.g = this.b = i;
  37214. else {
  37215. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37216. , r = 2 * i - n;
  37217. this.r = _i(r, n, e + 1 / 3),
  37218. this.g = _i(r, n, e),
  37219. this.b = _i(r, n, e - 1 / 3)
  37220. }
  37221. return this
  37222. },
  37223. setStyle: function(t) {
  37224. function e(e) {
  37225. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37226. }
  37227. var i;
  37228. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37229. var n, r = i[1], o = i[2];
  37230. switch (r) {
  37231. case "rgb":
  37232. case "rgba":
  37233. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37234. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37235. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37236. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37237. e(n[5]),
  37238. this;
  37239. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37240. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37241. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37242. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37243. e(n[5]),
  37244. this;
  37245. break;
  37246. case "hsl":
  37247. case "hsla":
  37248. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37249. var a = parseFloat(n[1]) / 360
  37250. , s = parseInt(n[2], 10) / 100
  37251. , l = parseInt(n[3], 10) / 100;
  37252. return e(n[5]),
  37253. this.setHSL(a, s, l)
  37254. }
  37255. }
  37256. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37257. var c, h = (c = i[1]).length;
  37258. if (3 === h)
  37259. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37260. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37261. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37262. this;
  37263. if (6 === h)
  37264. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37265. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37266. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37267. this
  37268. }
  37269. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37270. return this
  37271. },
  37272. clone: function() {
  37273. return new this.constructor(this.r,this.g,this.b)
  37274. },
  37275. copy: function(e) {
  37276. return this.r = e.r,
  37277. this.g = e.g,
  37278. this.b = e.b,
  37279. this
  37280. },
  37281. copyGammaToLinear: function(e, t) {
  37282. return void 0 === t && (t = 2),
  37283. this.r = Math.pow(e.r, t),
  37284. this.g = Math.pow(e.g, t),
  37285. this.b = Math.pow(e.b, t),
  37286. this
  37287. },
  37288. copyLinearToGamma: function(e, t) {
  37289. void 0 === t && (t = 2);
  37290. var i = 0 < t ? 1 / t : 1;
  37291. return this.r = Math.pow(e.r, i),
  37292. this.g = Math.pow(e.g, i),
  37293. this.b = Math.pow(e.b, i),
  37294. this
  37295. },
  37296. convertGammaToLinear: function() {
  37297. var e = this.r
  37298. , t = this.g
  37299. , i = this.b;
  37300. return this.r = e * e,
  37301. this.g = t * t,
  37302. this.b = i * i,
  37303. this
  37304. },
  37305. convertLinearToGamma: function() {
  37306. return this.r = Math.sqrt(this.r),
  37307. this.g = Math.sqrt(this.g),
  37308. this.b = Math.sqrt(this.b),
  37309. this
  37310. },
  37311. getHex: function() {
  37312. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37313. },
  37314. getHexString: function() {
  37315. return ("000000" + this.getHex().toString(16)).slice(-6)
  37316. },
  37317. getHSL: function(e) {
  37318. var t, i, n = e || {
  37319. h: 0,
  37320. s: 0,
  37321. l: 0
  37322. }, 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;
  37323. if (l === s)
  37324. i = t = 0;
  37325. else {
  37326. var h = s - l;
  37327. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37328. s) {
  37329. case r:
  37330. t = (o - a) / h + (o < a ? 6 : 0);
  37331. break;
  37332. case o:
  37333. t = (a - r) / h + 2;
  37334. break;
  37335. case a:
  37336. t = (r - o) / h + 4
  37337. }
  37338. t /= 6
  37339. }
  37340. return n.h = t,
  37341. n.s = i,
  37342. n.l = c,
  37343. n
  37344. },
  37345. getStyle: function() {
  37346. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37347. },
  37348. offsetHSL: function(e, t, i) {
  37349. var n = this.getHSL();
  37350. return n.h += e,
  37351. n.s += t,
  37352. n.l += i,
  37353. this.setHSL(n.h, n.s, n.l),
  37354. this
  37355. },
  37356. add: function(e) {
  37357. return this.r += e.r,
  37358. this.g += e.g,
  37359. this.b += e.b,
  37360. this
  37361. },
  37362. addColors: function(e, t) {
  37363. return this.r = e.r + t.r,
  37364. this.g = e.g + t.g,
  37365. this.b = e.b + t.b,
  37366. this
  37367. },
  37368. addScalar: function(e) {
  37369. return this.r += e,
  37370. this.g += e,
  37371. this.b += e,
  37372. this
  37373. },
  37374. multiply: function(e) {
  37375. return this.r *= e.r,
  37376. this.g *= e.g,
  37377. this.b *= e.b,
  37378. this
  37379. },
  37380. multiplyScalar: function(e) {
  37381. return this.r *= e,
  37382. this.g *= e,
  37383. this.b *= e,
  37384. this
  37385. },
  37386. lerp: function(e, t) {
  37387. return this.r += (e.r - this.r) * t,
  37388. this.g += (e.g - this.g) * t,
  37389. this.b += (e.b - this.b) * t,
  37390. this
  37391. },
  37392. equals: function(e) {
  37393. return e.r === this.r && e.g === this.g && e.b === this.b
  37394. },
  37395. fromArray: function(e, t) {
  37396. return void 0 === t && (t = 0),
  37397. this.r = e[t],
  37398. this.g = e[t + 1],
  37399. this.b = e[t + 2],
  37400. this
  37401. },
  37402. toArray: function(e, t) {
  37403. return void 0 === e && (e = []),
  37404. void 0 === t && (t = 0),
  37405. e[t] = this.r,
  37406. e[t + 1] = this.g,
  37407. e[t + 2] = this.b,
  37408. e
  37409. }
  37410. },
  37411. Ci.ColorKeywords = {
  37412. aliceblue: 15792383,
  37413. antiquewhite: 16444375,
  37414. aqua: 65535,
  37415. aquamarine: 8388564,
  37416. azure: 15794175,
  37417. beige: 16119260,
  37418. bisque: 16770244,
  37419. black: 0,
  37420. blanchedalmond: 16772045,
  37421. blue: 255,
  37422. blueviolet: 9055202,
  37423. brown: 10824234,
  37424. burlywood: 14596231,
  37425. cadetblue: 6266528,
  37426. chartreuse: 8388352,
  37427. chocolate: 13789470,
  37428. coral: 16744272,
  37429. cornflowerblue: 6591981,
  37430. cornsilk: 16775388,
  37431. crimson: 14423100,
  37432. cyan: 65535,
  37433. darkblue: 139,
  37434. darkcyan: 35723,
  37435. darkgoldenrod: 12092939,
  37436. darkgray: 11119017,
  37437. darkgreen: 25600,
  37438. darkgrey: 11119017,
  37439. darkkhaki: 12433259,
  37440. darkmagenta: 9109643,
  37441. darkolivegreen: 5597999,
  37442. darkorange: 16747520,
  37443. darkorchid: 10040012,
  37444. darkred: 9109504,
  37445. darksalmon: 15308410,
  37446. darkseagreen: 9419919,
  37447. darkslateblue: 4734347,
  37448. darkslategray: 3100495,
  37449. darkslategrey: 3100495,
  37450. darkturquoise: 52945,
  37451. darkviolet: 9699539,
  37452. deeppink: 16716947,
  37453. deepskyblue: 49151,
  37454. dimgray: 6908265,
  37455. dimgrey: 6908265,
  37456. dodgerblue: 2003199,
  37457. firebrick: 11674146,
  37458. floralwhite: 16775920,
  37459. forestgreen: 2263842,
  37460. fuchsia: 16711935,
  37461. gainsboro: 14474460,
  37462. ghostwhite: 16316671,
  37463. gold: 16766720,
  37464. goldenrod: 14329120,
  37465. gray: 8421504,
  37466. green: 32768,
  37467. greenyellow: 11403055,
  37468. grey: 8421504,
  37469. honeydew: 15794160,
  37470. hotpink: 16738740,
  37471. indianred: 13458524,
  37472. indigo: 4915330,
  37473. ivory: 16777200,
  37474. khaki: 15787660,
  37475. lavender: 15132410,
  37476. lavenderblush: 16773365,
  37477. lawngreen: 8190976,
  37478. lemonchiffon: 16775885,
  37479. lightblue: 11393254,
  37480. lightcoral: 15761536,
  37481. lightcyan: 14745599,
  37482. lightgoldenrodyellow: 16448210,
  37483. lightgray: 13882323,
  37484. lightgreen: 9498256,
  37485. lightgrey: 13882323,
  37486. lightpink: 16758465,
  37487. lightsalmon: 16752762,
  37488. lightseagreen: 2142890,
  37489. lightskyblue: 8900346,
  37490. lightslategray: 7833753,
  37491. lightslategrey: 7833753,
  37492. lightsteelblue: 11584734,
  37493. lightyellow: 16777184,
  37494. lime: 65280,
  37495. limegreen: 3329330,
  37496. linen: 16445670,
  37497. magenta: 16711935,
  37498. maroon: 8388608,
  37499. mediumaquamarine: 6737322,
  37500. mediumblue: 205,
  37501. mediumorchid: 12211667,
  37502. mediumpurple: 9662683,
  37503. mediumseagreen: 3978097,
  37504. mediumslateblue: 8087790,
  37505. mediumspringgreen: 64154,
  37506. mediumturquoise: 4772300,
  37507. mediumvioletred: 13047173,
  37508. midnightblue: 1644912,
  37509. mintcream: 16121850,
  37510. mistyrose: 16770273,
  37511. moccasin: 16770229,
  37512. navajowhite: 16768685,
  37513. navy: 128,
  37514. oldlace: 16643558,
  37515. olive: 8421376,
  37516. olivedrab: 7048739,
  37517. orange: 16753920,
  37518. orangered: 16729344,
  37519. orchid: 14315734,
  37520. palegoldenrod: 15657130,
  37521. palegreen: 10025880,
  37522. paleturquoise: 11529966,
  37523. palevioletred: 14381203,
  37524. papayawhip: 16773077,
  37525. peachpuff: 16767673,
  37526. peru: 13468991,
  37527. pink: 16761035,
  37528. plum: 14524637,
  37529. powderblue: 11591910,
  37530. purple: 8388736,
  37531. red: 16711680,
  37532. rosybrown: 12357519,
  37533. royalblue: 4286945,
  37534. saddlebrown: 9127187,
  37535. salmon: 16416882,
  37536. sandybrown: 16032864,
  37537. seagreen: 3050327,
  37538. seashell: 16774638,
  37539. sienna: 10506797,
  37540. silver: 12632256,
  37541. skyblue: 8900331,
  37542. slateblue: 6970061,
  37543. slategray: 7372944,
  37544. slategrey: 7372944,
  37545. snow: 16775930,
  37546. springgreen: 65407,
  37547. steelblue: 4620980,
  37548. tan: 13808780,
  37549. teal: 32896,
  37550. thistle: 14204888,
  37551. tomato: 16737095,
  37552. turquoise: 4251856,
  37553. violet: 15631086,
  37554. wheat: 16113331,
  37555. white: 16777215,
  37556. whitesmoke: 16119285,
  37557. yellow: 16776960,
  37558. yellowgreen: 10145074
  37559. },
  37560. Ci.Quaternion = function(e, t, i, n) {
  37561. this._x = e || 0,
  37562. this._y = t || 0,
  37563. this._z = i || 0,
  37564. this._w = void 0 !== n ? n : 1
  37565. }
  37566. ,
  37567. Ci.Quaternion.prototype = {
  37568. constructor: Ci.Quaternion,
  37569. get x() {
  37570. return this._x
  37571. },
  37572. set x(e) {
  37573. this._x = e,
  37574. this.onChangeCallback()
  37575. },
  37576. get y() {
  37577. return this._y
  37578. },
  37579. set y(e) {
  37580. this._y = e,
  37581. this.onChangeCallback()
  37582. },
  37583. get z() {
  37584. return this._z
  37585. },
  37586. set z(e) {
  37587. this._z = e,
  37588. this.onChangeCallback()
  37589. },
  37590. get w() {
  37591. return this._w
  37592. },
  37593. set w(e) {
  37594. this._w = e,
  37595. this.onChangeCallback()
  37596. },
  37597. set: function(e, t, i, n) {
  37598. return this._x = e,
  37599. this._y = t,
  37600. this._z = i,
  37601. this._w = n,
  37602. this.onChangeCallback(),
  37603. this
  37604. },
  37605. clone: function() {
  37606. return new this.constructor(this._x,this._y,this._z,this._w)
  37607. },
  37608. toObject:function(){//add
  37609. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37610. },
  37611. copy: function(e) {
  37612. return this._x = e.x,
  37613. this._y = e.y,
  37614. this._z = e.z,
  37615. this._w = e.w,
  37616. this.onChangeCallback(),
  37617. this
  37618. },
  37619. setFromEuler: function(e, t) {
  37620. if (e instanceof Ci.Euler == 0)
  37621. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37622. var i = Math.cos(e._x / 2)
  37623. , n = Math.cos(e._y / 2)
  37624. , r = Math.cos(e._z / 2)
  37625. , o = Math.sin(e._x / 2)
  37626. , a = Math.sin(e._y / 2)
  37627. , s = Math.sin(e._z / 2)
  37628. , l = e.order;
  37629. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37630. this._y = i * a * r - o * n * s,
  37631. this._z = i * n * s + o * a * r,
  37632. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37633. this._y = i * a * r - o * n * s,
  37634. this._z = i * n * s - o * a * r,
  37635. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37636. this._y = i * a * r + o * n * s,
  37637. this._z = i * n * s + o * a * r,
  37638. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37639. this._y = i * a * r + o * n * s,
  37640. this._z = i * n * s - o * a * r,
  37641. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37642. this._y = i * a * r + o * n * s,
  37643. this._z = i * n * s - o * a * r,
  37644. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37645. this._y = i * a * r - o * n * s,
  37646. this._z = i * n * s + o * a * r,
  37647. this._w = i * n * r + o * a * s),
  37648. !1 !== t && this.onChangeCallback(),
  37649. this
  37650. },
  37651. setFromAxisAngle: function(e, t) {
  37652. var i = t / 2
  37653. , n = Math.sin(i);
  37654. return this._x = e.x * n,
  37655. this._y = e.y * n,
  37656. this._z = e.z * n,
  37657. this._w = Math.cos(i),
  37658. this.onChangeCallback(),
  37659. this
  37660. },
  37661. setFromRotationMatrix: function(e) {
  37662. 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;
  37663. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37664. this._w = .25 / t,
  37665. this._x = (h - l) * t,
  37666. this._y = (o - c) * t,
  37667. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37668. this._w = (h - l) / t,
  37669. this._x = .25 * t,
  37670. this._y = (r + a) / t,
  37671. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37672. this._w = (o - c) / t,
  37673. this._x = (r + a) / t,
  37674. this._y = .25 * t,
  37675. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37676. this._w = (a - r) / t,
  37677. this._x = (o + c) / t,
  37678. this._y = (l + h) / t,
  37679. this._z = .25 * t),
  37680. this.onChangeCallback(),
  37681. this
  37682. },
  37683. setFromUnitVectors: function(e, t) {
  37684. return void 0 === Be && (Be = new Ci.Vector3),
  37685. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37686. 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),
  37687. this._x = Be.x,
  37688. this._y = Be.y,
  37689. this._z = Be.z,
  37690. this._w = Ve,
  37691. this.normalize(),
  37692. this
  37693. },
  37694. inverse: function() {
  37695. return this.conjugate().normalize(),
  37696. this
  37697. },
  37698. conjugate: function() {
  37699. return this._x *= -1,
  37700. this._y *= -1,
  37701. this._z *= -1,
  37702. this.onChangeCallback(),
  37703. this
  37704. },
  37705. dot: function(e) {
  37706. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37707. },
  37708. lengthSq: function() {
  37709. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37710. },
  37711. length: function() {
  37712. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37713. },
  37714. normalize: function() {
  37715. var e = this.length();
  37716. return 0 === e ? (this._x = 0,
  37717. this._y = 0,
  37718. this._z = 0,
  37719. this._w = 1) : (e = 1 / e,
  37720. this._x = this._x * e,
  37721. this._y = this._y * e,
  37722. this._z = this._z * e,
  37723. this._w = this._w * e),
  37724. this.onChangeCallback(),
  37725. this
  37726. },
  37727. multiply: function(e, t) {
  37728. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37729. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37730. },
  37731. multiplyQuaternions: function(e, t) {
  37732. var i = e._x
  37733. , n = e._y
  37734. , r = e._z
  37735. , o = e._w
  37736. , a = t._x
  37737. , s = t._y
  37738. , l = t._z
  37739. , c = t._w;
  37740. return this._x = i * c + o * a + n * l - r * s,
  37741. this._y = n * c + o * s + r * a - i * l,
  37742. this._z = r * c + o * l + i * s - n * a,
  37743. this._w = o * c - i * a - n * s - r * l,
  37744. this.onChangeCallback(),
  37745. this
  37746. },
  37747. slerp: function(e, t) {
  37748. if (0 === t)
  37749. return this;
  37750. if (1 === t)
  37751. return this.copy(e);
  37752. var i = this._x
  37753. , n = this._y
  37754. , r = this._z
  37755. , o = this._w
  37756. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37757. if (a < 0 ? (this._w = -e._w,
  37758. this._x = -e._x,
  37759. this._y = -e._y,
  37760. this._z = -e._z,
  37761. a = -a) : this.copy(e),
  37762. 1 <= a)
  37763. return this._w = o,
  37764. this._x = i,
  37765. this._y = n,
  37766. this._z = r,
  37767. this;
  37768. var s = Math.sqrt(1 - a * a);
  37769. if (Math.abs(s) < .001)
  37770. return this._w = .5 * (o + this._w),
  37771. this._x = .5 * (i + this._x),
  37772. this._y = .5 * (n + this._y),
  37773. this._z = .5 * (r + this._z),
  37774. this;
  37775. var l = Math.atan2(s, a)
  37776. , c = Math.sin((1 - t) * l) / s
  37777. , h = Math.sin(t * l) / s;
  37778. return this._w = o * c + this._w * h,
  37779. this._x = i * c + this._x * h,
  37780. this._y = n * c + this._y * h,
  37781. this._z = r * c + this._z * h,
  37782. this.onChangeCallback(),
  37783. this
  37784. },
  37785. equals: function(e) {
  37786. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37787. },
  37788. fromArray: function(e, t) {
  37789. return void 0 === t && (t = 0),
  37790. this._x = e[t],
  37791. this._y = e[t + 1],
  37792. this._z = e[t + 2],
  37793. this._w = e[t + 3],
  37794. this.onChangeCallback(),
  37795. this
  37796. },
  37797. toArray: function(e, t) {
  37798. return void 0 === e && (e = []),
  37799. void 0 === t && (t = 0),
  37800. e[t] = this._x,
  37801. e[t + 1] = this._y,
  37802. e[t + 2] = this._z,
  37803. e[t + 3] = this._w,
  37804. e
  37805. },
  37806. onChange: function(e) {
  37807. return this.onChangeCallback = e,
  37808. this
  37809. },
  37810. onChangeCallback: function() {}
  37811. },
  37812. Object.assign(Ci.Quaternion, {
  37813. slerp: function(e, t, i, n) {
  37814. return i.copy(e).slerp(t, n)
  37815. },
  37816. slerpFlat: function(e, t, i, n, r, o, a) {
  37817. var s = i[n + 0]
  37818. , l = i[n + 1]
  37819. , c = i[n + 2]
  37820. , h = i[n + 3]
  37821. , u = r[o + 0]
  37822. , d = r[o + 1]
  37823. , p = r[o + 2]
  37824. , f = r[o + 3];
  37825. if (h !== f || s !== u || l !== d || c !== p) {
  37826. var g = 1 - a
  37827. , m = s * u + l * d + c * p + h * f
  37828. , v = 0 <= m ? 1 : -1
  37829. , y = 1 - m * m;
  37830. if (y > Number.EPSILON) {
  37831. var A = Math.sqrt(y)
  37832. , C = Math.atan2(A, m * v);
  37833. g = Math.sin(g * C) / A,
  37834. a = Math.sin(a * C) / A
  37835. }
  37836. var I = a * v;
  37837. if (s = s * g + u * I,
  37838. l = l * g + d * I,
  37839. c = c * g + p * I,
  37840. h = h * g + f * I,
  37841. g === 1 - a) {
  37842. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37843. s *= E,
  37844. l *= E,
  37845. c *= E,
  37846. h *= E
  37847. }
  37848. }
  37849. e[t] = s,
  37850. e[t + 1] = l,
  37851. e[t + 2] = c,
  37852. e[t + 3] = h
  37853. }
  37854. }),
  37855. Ci.Vector2 = function(e, t) {
  37856. this.x = e || 0,
  37857. this.y = t || 0
  37858. }
  37859. ,
  37860. Ci.Vector2.prototype = {
  37861. constructor: Ci.Vector2,
  37862. get width() {
  37863. return this.x
  37864. },
  37865. set width(e) {
  37866. this.x = e
  37867. },
  37868. get height() {
  37869. return this.y
  37870. },
  37871. set height(e) {
  37872. this.y = e
  37873. },
  37874. set: function(e, t) {
  37875. return this.x = e,
  37876. this.y = t,
  37877. this
  37878. },
  37879. setScalar: function(e) {
  37880. return this.x = e,
  37881. this.y = e,
  37882. this
  37883. },
  37884. setX: function(e) {
  37885. return this.x = e,
  37886. this
  37887. },
  37888. setY: function(e) {
  37889. return this.y = e,
  37890. this
  37891. },
  37892. setComponent: function(e, t) {
  37893. switch (e) {
  37894. case 0:
  37895. this.x = t;
  37896. break;
  37897. case 1:
  37898. this.y = t;
  37899. break;
  37900. default:
  37901. throw new Error("index is out of range: " + e)
  37902. }
  37903. },
  37904. getComponent: function(e) {
  37905. switch (e) {
  37906. case 0:
  37907. return this.x;
  37908. case 1:
  37909. return this.y;
  37910. default:
  37911. throw new Error("index is out of range: " + e)
  37912. }
  37913. },
  37914. clone: function() {
  37915. return new this.constructor(this.x,this.y)
  37916. },
  37917. copy: function(e) {
  37918. return this.x = e.x,
  37919. this.y = e.y,
  37920. this
  37921. },
  37922. add: function(e, t) {
  37923. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37924. this.addVectors(e, t)) : (this.x += e.x,
  37925. this.y += e.y,
  37926. this)
  37927. },
  37928. addScalar: function(e) {
  37929. return this.x += e,
  37930. this.y += e,
  37931. this
  37932. },
  37933. addVectors: function(e, t) {
  37934. return this.x = e.x + t.x,
  37935. this.y = e.y + t.y,
  37936. this
  37937. },
  37938. addScaledVector: function(e, t) {
  37939. return this.x += e.x * t,
  37940. this.y += e.y * t,
  37941. this
  37942. },
  37943. sub: function(e, t) {
  37944. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37945. this.subVectors(e, t)) : (this.x -= e.x,
  37946. this.y -= e.y,
  37947. this)
  37948. },
  37949. subScalar: function(e) {
  37950. return this.x -= e,
  37951. this.y -= e,
  37952. this
  37953. },
  37954. subVectors: function(e, t) {
  37955. return this.x = e.x - t.x,
  37956. this.y = e.y - t.y,
  37957. this
  37958. },
  37959. multiply: function(e) {
  37960. return this.x *= e.x,
  37961. this.y *= e.y,
  37962. this
  37963. },
  37964. multiplyScalar: function(e) {
  37965. return isFinite(e) ? (this.x *= e,
  37966. this.y *= e) : (this.x = 0,
  37967. this.y = 0),
  37968. this
  37969. },
  37970. divide: function(e) {
  37971. return this.x /= e.x,
  37972. this.y /= e.y,
  37973. this
  37974. },
  37975. divideScalar: function(e) {
  37976. return this.multiplyScalar(1 / e)
  37977. },
  37978. min: function(e) {
  37979. return this.x = Math.min(this.x, e.x),
  37980. this.y = Math.min(this.y, e.y),
  37981. this
  37982. },
  37983. max: function(e) {
  37984. return this.x = Math.max(this.x, e.x),
  37985. this.y = Math.max(this.y, e.y),
  37986. this
  37987. },
  37988. clamp: function(e, t) {
  37989. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37990. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37991. this
  37992. },
  37993. clampScalar: function(e, t) {
  37994. return void 0 === Ne && (Ne = new Ci.Vector2,
  37995. Fe = new Ci.Vector2),
  37996. Ne.set(e, e),
  37997. Fe.set(t, t),
  37998. this.clamp(Ne, Fe)
  37999. },
  38000. clampLength: function(e, t) {
  38001. var i = this.length();
  38002. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38003. this
  38004. },
  38005. floor: function() {
  38006. return this.x = Math.floor(this.x),
  38007. this.y = Math.floor(this.y),
  38008. this
  38009. },
  38010. ceil: function() {
  38011. return this.x = Math.ceil(this.x),
  38012. this.y = Math.ceil(this.y),
  38013. this
  38014. },
  38015. round: function() {
  38016. return this.x = Math.round(this.x),
  38017. this.y = Math.round(this.y),
  38018. this
  38019. },
  38020. roundToZero: function() {
  38021. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38022. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38023. this
  38024. },
  38025. negate: function() {
  38026. return this.x = -this.x,
  38027. this.y = -this.y,
  38028. this
  38029. },
  38030. dot: function(e) {
  38031. return this.x * e.x + this.y * e.y
  38032. },
  38033. lengthSq: function() {
  38034. return this.x * this.x + this.y * this.y
  38035. },
  38036. length: function() {
  38037. return Math.sqrt(this.x * this.x + this.y * this.y)
  38038. },
  38039. lengthManhattan: function() {
  38040. return Math.abs(this.x) + Math.abs(this.y)
  38041. },
  38042. normalize: function() {
  38043. return this.divideScalar(this.length())
  38044. },
  38045. angle: function() {
  38046. var e = Math.atan2(this.y, this.x);
  38047. return e < 0 && (e += 2 * Math.PI),
  38048. e
  38049. },
  38050. distanceTo: function(e) {
  38051. return Math.sqrt(this.distanceToSquared(e))
  38052. },
  38053. distanceToSquared: function(e) {
  38054. var t = this.x - e.x
  38055. , i = this.y - e.y;
  38056. return t * t + i * i
  38057. },
  38058. setLength: function(e) {
  38059. return this.multiplyScalar(e / this.length())
  38060. },
  38061. lerp: function(e, t) {
  38062. return this.x += (e.x - this.x) * t,
  38063. this.y += (e.y - this.y) * t,
  38064. this
  38065. },
  38066. lerpVectors: function(e, t, i) {
  38067. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38068. this
  38069. },
  38070. equals: function(e) {
  38071. return e.x === this.x && e.y === this.y
  38072. },
  38073. fromArray: function(e, t) {
  38074. return void 0 === t && (t = 0),
  38075. this.x = e[t],
  38076. this.y = e[t + 1],
  38077. this
  38078. },
  38079. toArray: function(e, t) {
  38080. return void 0 === e && (e = []),
  38081. void 0 === t && (t = 0),
  38082. e[t] = this.x,
  38083. e[t + 1] = this.y,
  38084. e
  38085. },
  38086. fromAttribute: function(e, t, i) {
  38087. return void 0 === i && (i = 0),
  38088. t = t * e.itemSize + i,
  38089. this.x = e.array[t],
  38090. this.y = e.array[t + 1],
  38091. this
  38092. },
  38093. rotateAround: function(e, t) {
  38094. var i = Math.cos(t)
  38095. , n = Math.sin(t)
  38096. , r = this.x - e.x
  38097. , o = this.y - e.y;
  38098. return this.x = r * i - o * n + e.x,
  38099. this.y = r * n + o * i + e.y,
  38100. this
  38101. }
  38102. },
  38103. Ci.Vector3 = function(e, t, i) {
  38104. this.x = e || 0,
  38105. this.y = t || 0,
  38106. this.z = i || 0
  38107. }
  38108. ,
  38109. Ci.Vector3.prototype = {
  38110. constructor: Ci.Vector3,
  38111. set: function(e, t, i) {
  38112. return this.x = e,
  38113. this.y = t,
  38114. this.z = i,
  38115. this
  38116. },
  38117. setScalar: function(e) {
  38118. return this.x = e,
  38119. this.y = e,
  38120. this.z = e,
  38121. this
  38122. },
  38123. setX: function(e) {
  38124. return this.x = e,
  38125. this
  38126. },
  38127. setY: function(e) {
  38128. return this.y = e,
  38129. this
  38130. },
  38131. setZ: function(e) {
  38132. return this.z = e,
  38133. this
  38134. },
  38135. setComponent: function(e, t) {
  38136. switch (e) {
  38137. case 0:
  38138. this.x = t;
  38139. break;
  38140. case 1:
  38141. this.y = t;
  38142. break;
  38143. case 2:
  38144. this.z = t;
  38145. break;
  38146. default:
  38147. throw new Error("index is out of range: " + e)
  38148. }
  38149. },
  38150. getComponent: function(e) {
  38151. switch (e) {
  38152. case 0:
  38153. return this.x;
  38154. case 1:
  38155. return this.y;
  38156. case 2:
  38157. return this.z;
  38158. default:
  38159. throw new Error("index is out of range: " + e)
  38160. }
  38161. },
  38162. clone: function() {
  38163. return new this.constructor(this.x,this.y,this.z)
  38164. },
  38165. copy: function(e) {
  38166. return this.x = e.x,
  38167. this.y = e.y,
  38168. this.z = e.z,
  38169. this
  38170. },
  38171. add: function(e, t) {
  38172. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38173. this.addVectors(e, t)) : (this.x += e.x,
  38174. this.y += e.y,
  38175. this.z += e.z,
  38176. this)
  38177. },
  38178. addScalar: function(e) {
  38179. return this.x += e,
  38180. this.y += e,
  38181. this.z += e,
  38182. this
  38183. },
  38184. addVectors: function(e, t) {
  38185. return this.x = e.x + t.x,
  38186. this.y = e.y + t.y,
  38187. this.z = e.z + t.z,
  38188. this
  38189. },
  38190. addScaledVector: function(e, t) {
  38191. return this.x += e.x * t,
  38192. this.y += e.y * t,
  38193. this.z += e.z * t,
  38194. this
  38195. },
  38196. sub: function(e, t) {
  38197. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38198. this.subVectors(e, t)) : (this.x -= e.x,
  38199. this.y -= e.y,
  38200. this.z -= e.z,
  38201. this)
  38202. },
  38203. subScalar: function(e) {
  38204. return this.x -= e,
  38205. this.y -= e,
  38206. this.z -= 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.z = e.z - t.z,
  38213. this
  38214. },
  38215. multiply: function(e, t) {
  38216. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38217. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38218. this.y *= e.y,
  38219. this.z *= e.z,
  38220. this)
  38221. },
  38222. multiplyScalar: function(e) {
  38223. return isFinite(e) ? (this.x *= e,
  38224. this.y *= e,
  38225. this.z *= e) : (this.x = 0,
  38226. this.y = 0,
  38227. this.z = 0),
  38228. this
  38229. },
  38230. multiplyVectors: function(e, t) {
  38231. return this.x = e.x * t.x,
  38232. this.y = e.y * t.y,
  38233. this.z = e.z * t.z,
  38234. this
  38235. },
  38236. applyEuler: function(e) {
  38237. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38238. void 0 === De && (De = new Ci.Quaternion),
  38239. this.applyQuaternion(De.setFromEuler(e)),
  38240. this
  38241. },
  38242. applyAxisAngle: function(e, t) {
  38243. return void 0 === Le && (Le = new Ci.Quaternion),
  38244. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38245. this
  38246. },
  38247. applyMatrix3: function(e) {
  38248. var t = this.x
  38249. , i = this.y
  38250. , n = this.z
  38251. , r = e.elements;
  38252. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38253. this.y = r[1] * t + r[4] * i + r[7] * n,
  38254. this.z = r[2] * t + r[5] * i + r[8] * n,
  38255. this
  38256. },
  38257. applyMatrix4: function(e) {
  38258. var t = this.x
  38259. , i = this.y
  38260. , n = this.z
  38261. , r = e.elements;
  38262. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38263. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38264. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38265. this
  38266. },
  38267. applyProjection: function(e) {
  38268. var t = this.x
  38269. , i = this.y
  38270. , n = this.z
  38271. , r = e.elements
  38272. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38273. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38274. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38275. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38276. this
  38277. },
  38278. applyQuaternion: function(e) {
  38279. var t = this.x
  38280. , i = this.y
  38281. , n = this.z
  38282. , r = e.x
  38283. , o = e.y
  38284. , a = e.z
  38285. , s = e.w
  38286. , l = s * t + o * n - a * i
  38287. , c = s * i + a * t - r * n
  38288. , h = s * n + r * i - o * t
  38289. , u = -r * t - o * i - a * n;
  38290. return this.x = l * s + u * -r + c * -a - h * -o,
  38291. this.y = c * s + u * -o + h * -r - l * -a,
  38292. this.z = h * s + u * -a + l * -o - c * -r,
  38293. this
  38294. },
  38295. project: function(e) {
  38296. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38297. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38298. this.applyProjection(Oe)
  38299. },
  38300. unproject: function(e) {
  38301. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38302. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38303. this.applyProjection(Pe)
  38304. },
  38305. transformDirection: function(e) {
  38306. var t = this.x
  38307. , i = this.y
  38308. , n = this.z
  38309. , r = e.elements;
  38310. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38311. this.y = r[1] * t + r[5] * i + r[9] * n,
  38312. this.z = r[2] * t + r[6] * i + r[10] * n,
  38313. this.normalize(),
  38314. this
  38315. },
  38316. divide: function(e) {
  38317. return this.x /= e.x,
  38318. this.y /= e.y,
  38319. this.z /= e.z,
  38320. this
  38321. },
  38322. divideScalar: function(e) {
  38323. return this.multiplyScalar(1 / e)
  38324. },
  38325. min: function(e) {
  38326. return this.x = Math.min(this.x, e.x),
  38327. this.y = Math.min(this.y, e.y),
  38328. this.z = Math.min(this.z, e.z),
  38329. this
  38330. },
  38331. max: function(e) {
  38332. return this.x = Math.max(this.x, e.x),
  38333. this.y = Math.max(this.y, e.y),
  38334. this.z = Math.max(this.z, e.z),
  38335. this
  38336. },
  38337. clamp: function(e, t) {
  38338. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38339. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38340. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38341. this
  38342. },
  38343. clampScalar: function(e, t) {
  38344. return void 0 === Me && (Me = new Ci.Vector3,
  38345. Re = new Ci.Vector3),
  38346. Me.set(e, e, e),
  38347. Re.set(t, t, t),
  38348. this.clamp(Me, Re)
  38349. },
  38350. clampLength: function(e, t) {
  38351. var i = this.length();
  38352. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38353. this
  38354. },
  38355. floor: function() {
  38356. return this.x = Math.floor(this.x),
  38357. this.y = Math.floor(this.y),
  38358. this.z = Math.floor(this.z),
  38359. this
  38360. },
  38361. ceil: function() {
  38362. return this.x = Math.ceil(this.x),
  38363. this.y = Math.ceil(this.y),
  38364. this.z = Math.ceil(this.z),
  38365. this
  38366. },
  38367. round: function() {
  38368. return this.x = Math.round(this.x),
  38369. this.y = Math.round(this.y),
  38370. this.z = Math.round(this.z),
  38371. this
  38372. },
  38373. roundToZero: function() {
  38374. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38375. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38376. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38377. this
  38378. },
  38379. negate: function() {
  38380. return this.x = -this.x,
  38381. this.y = -this.y,
  38382. this.z = -this.z,
  38383. this
  38384. },
  38385. dot: function(e) {
  38386. return this.x * e.x + this.y * e.y + this.z * e.z
  38387. },
  38388. lengthSq: function() {
  38389. return this.x * this.x + this.y * this.y + this.z * this.z
  38390. },
  38391. length: function() {
  38392. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38393. },
  38394. lengthManhattan: function() {
  38395. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38396. },
  38397. normalize: function() {
  38398. return this.divideScalar(this.length())
  38399. },
  38400. setLength: function(e) {
  38401. return this.multiplyScalar(e / this.length())
  38402. },
  38403. lerp: function(e, t) {
  38404. return this.x += (e.x - this.x) * t,
  38405. this.y += (e.y - this.y) * t,
  38406. this.z += (e.z - this.z) * t,
  38407. this
  38408. },
  38409. lerpVectors: function(e, t, i) {
  38410. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38411. this
  38412. },
  38413. cross: function(e, t) {
  38414. if (void 0 !== t)
  38415. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38416. this.crossVectors(e, t);
  38417. var i = this.x
  38418. , n = this.y
  38419. , r = this.z;
  38420. return this.x = n * e.z - r * e.y,
  38421. this.y = r * e.x - i * e.z,
  38422. this.z = i * e.y - n * e.x,
  38423. this
  38424. },
  38425. crossVectors: function(e, t) {
  38426. var i = e.x
  38427. , n = e.y
  38428. , r = e.z
  38429. , o = t.x
  38430. , a = t.y
  38431. , s = t.z;
  38432. return this.x = n * s - r * a,
  38433. this.y = r * o - i * s,
  38434. this.z = i * a - n * o,
  38435. this
  38436. },
  38437. projectOnVector: function(e) {
  38438. return void 0 === xe && (xe = new Ci.Vector3),
  38439. xe.copy(e).normalize(),
  38440. Se = this.dot(xe),
  38441. this.copy(xe).multiplyScalar(Se)
  38442. },
  38443. projectOnPlane: function(e) {
  38444. return void 0 === Te && (Te = new Ci.Vector3),
  38445. Te.copy(this).projectOnVector(e),
  38446. this.sub(Te)
  38447. },
  38448. reflect: function(e) {
  38449. return void 0 === we && (we = new Ci.Vector3),
  38450. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38451. },
  38452. angleTo: function(e) {
  38453. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38454. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38455. },
  38456. distanceTo: function(e) {
  38457. return Math.sqrt(this.distanceToSquared(e))
  38458. },
  38459. distanceToSquared: function(e) {
  38460. var t = this.x - e.x
  38461. , i = this.y - e.y
  38462. , n = this.z - e.z;
  38463. return t * t + i * i + n * n
  38464. },
  38465. setFromSpherical: function(e) {
  38466. var t = Math.sin(e.phi) * e.radius;
  38467. return this.x = t * Math.sin(e.theta),
  38468. this.y = Math.cos(e.phi) * e.radius,
  38469. this.z = t * Math.cos(e.theta),
  38470. this
  38471. },
  38472. setFromMatrixPosition: function(e) {
  38473. return this.setFromMatrixColumn(e, 3)
  38474. },
  38475. setFromMatrixScale: function(e) {
  38476. var t = this.setFromMatrixColumn(e, 0).length()
  38477. , i = this.setFromMatrixColumn(e, 1).length()
  38478. , n = this.setFromMatrixColumn(e, 2).length();
  38479. return this.x = t,
  38480. this.y = i,
  38481. this.z = n,
  38482. this
  38483. },
  38484. setFromMatrixColumn: function(e, t) {
  38485. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38486. t = e = t),
  38487. this.fromArray(e.elements, 4 * t)
  38488. },
  38489. equals: function(e) {
  38490. return e.x === this.x && e.y === this.y && e.z === this.z
  38491. },
  38492. fromArray: function(e, t) {
  38493. return void 0 === t && (t = 0),
  38494. this.x = e[t],
  38495. this.y = e[t + 1],
  38496. this.z = e[t + 2],
  38497. this
  38498. },
  38499. toArray: function(e, t) {
  38500. return void 0 === e && (e = []),
  38501. void 0 === t && (t = 0),
  38502. e[t] = this.x,
  38503. e[t + 1] = this.y,
  38504. e[t + 2] = this.z,
  38505. e
  38506. },
  38507. fromAttribute: function(e, t, i) {
  38508. return void 0 === i && (i = 0),
  38509. t = t * e.itemSize + i,
  38510. this.x = e.array[t],
  38511. this.y = e.array[t + 1],
  38512. this.z = e.array[t + 2],
  38513. this
  38514. }
  38515. },
  38516. Ci.Vector4 = function(e, t, i, n) {
  38517. this.x = e || 0,
  38518. this.y = t || 0,
  38519. this.z = i || 0,
  38520. this.w = void 0 !== n ? n : 1
  38521. }
  38522. ,
  38523. Ci.Vector4.prototype = {
  38524. constructor: Ci.Vector4,
  38525. set: function(e, t, i, n) {
  38526. return this.x = e,
  38527. this.y = t,
  38528. this.z = i,
  38529. this.w = n,
  38530. this
  38531. },
  38532. setScalar: function(e) {
  38533. return this.x = e,
  38534. this.y = e,
  38535. this.z = e,
  38536. this.w = e,
  38537. this
  38538. },
  38539. setX: function(e) {
  38540. return this.x = e,
  38541. this
  38542. },
  38543. setY: function(e) {
  38544. return this.y = e,
  38545. this
  38546. },
  38547. setZ: function(e) {
  38548. return this.z = e,
  38549. this
  38550. },
  38551. setW: function(e) {
  38552. return this.w = e,
  38553. this
  38554. },
  38555. setComponent: function(e, t) {
  38556. switch (e) {
  38557. case 0:
  38558. this.x = t;
  38559. break;
  38560. case 1:
  38561. this.y = t;
  38562. break;
  38563. case 2:
  38564. this.z = t;
  38565. break;
  38566. case 3:
  38567. this.w = t;
  38568. break;
  38569. default:
  38570. throw new Error("index is out of range: " + e)
  38571. }
  38572. },
  38573. getComponent: function(e) {
  38574. switch (e) {
  38575. case 0:
  38576. return this.x;
  38577. case 1:
  38578. return this.y;
  38579. case 2:
  38580. return this.z;
  38581. case 3:
  38582. return this.w;
  38583. default:
  38584. throw new Error("index is out of range: " + e)
  38585. }
  38586. },
  38587. clone: function() {
  38588. return new this.constructor(this.x,this.y,this.z,this.w)
  38589. },
  38590. copy: function(e) {
  38591. return this.x = e.x,
  38592. this.y = e.y,
  38593. this.z = e.z,
  38594. this.w = void 0 !== e.w ? e.w : 1,
  38595. this
  38596. },
  38597. add: function(e, t) {
  38598. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38599. this.addVectors(e, t)) : (this.x += e.x,
  38600. this.y += e.y,
  38601. this.z += e.z,
  38602. this.w += e.w,
  38603. this)
  38604. },
  38605. addScalar: function(e) {
  38606. return this.x += e,
  38607. this.y += e,
  38608. this.z += e,
  38609. this.w += e,
  38610. this
  38611. },
  38612. addVectors: function(e, t) {
  38613. return this.x = e.x + t.x,
  38614. this.y = e.y + t.y,
  38615. this.z = e.z + t.z,
  38616. this.w = e.w + t.w,
  38617. this
  38618. },
  38619. addScaledVector: function(e, t) {
  38620. return this.x += e.x * t,
  38621. this.y += e.y * t,
  38622. this.z += e.z * t,
  38623. this.w += e.w * t,
  38624. this
  38625. },
  38626. sub: function(e, t) {
  38627. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38628. this.subVectors(e, t)) : (this.x -= e.x,
  38629. this.y -= e.y,
  38630. this.z -= e.z,
  38631. this.w -= e.w,
  38632. this)
  38633. },
  38634. subScalar: function(e) {
  38635. return this.x -= e,
  38636. this.y -= e,
  38637. this.z -= e,
  38638. this.w -= e,
  38639. this
  38640. },
  38641. subVectors: function(e, t) {
  38642. return this.x = e.x - t.x,
  38643. this.y = e.y - t.y,
  38644. this.z = e.z - t.z,
  38645. this.w = e.w - t.w,
  38646. this
  38647. },
  38648. multiplyScalar: function(e) {
  38649. return isFinite(e) ? (this.x *= e,
  38650. this.y *= e,
  38651. this.z *= e,
  38652. this.w *= e) : (this.x = 0,
  38653. this.y = 0,
  38654. this.z = 0,
  38655. this.w = 0),
  38656. this
  38657. },
  38658. applyMatrix4: function(e) {
  38659. var t = this.x
  38660. , i = this.y
  38661. , n = this.z
  38662. , r = this.w
  38663. , o = e.elements;
  38664. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38665. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38666. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38667. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38668. this
  38669. },
  38670. divideScalar: function(e) {
  38671. return this.multiplyScalar(1 / e)
  38672. },
  38673. setAxisAngleFromQuaternion: function(e) {
  38674. this.w = 2 * Math.acos(e.w);
  38675. var t = Math.sqrt(1 - e.w * e.w);
  38676. return t < 1e-4 ? (this.x = 1,
  38677. this.y = 0,
  38678. this.z = 0) : (this.x = e.x / t,
  38679. this.y = e.y / t,
  38680. this.z = e.z / t),
  38681. this
  38682. },
  38683. setAxisAngleFromRotationMatrix: function(e) {
  38684. 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];
  38685. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38686. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38687. return this.set(1, 0, 0, 0),
  38688. this;
  38689. t = Math.PI;
  38690. var g = (a + 1) / 2
  38691. , m = (h + 1) / 2
  38692. , v = (f + 1) / 2
  38693. , y = (s + c) / 4
  38694. , A = (l + d) / 4
  38695. , C = (u + p) / 4;
  38696. return m < g && v < g ? r = g < .01 ? (i = 0,
  38697. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38698. A / i) : v < m ? r = m < .01 ? (n = 0,
  38699. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38700. C / n) : v < .01 ? (n = i = .707106781,
  38701. r = 0) : (i = A / (r = Math.sqrt(v)),
  38702. n = C / r),
  38703. this.set(i, n, r, t),
  38704. this
  38705. }
  38706. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38707. return Math.abs(I) < .001 && (I = 1),
  38708. this.x = (p - u) / I,
  38709. this.y = (l - d) / I,
  38710. this.z = (c - s) / I,
  38711. this.w = Math.acos((a + h + f - 1) / 2),
  38712. this
  38713. },
  38714. min: function(e) {
  38715. return this.x = Math.min(this.x, e.x),
  38716. this.y = Math.min(this.y, e.y),
  38717. this.z = Math.min(this.z, e.z),
  38718. this.w = Math.min(this.w, e.w),
  38719. this
  38720. },
  38721. max: function(e) {
  38722. return this.x = Math.max(this.x, e.x),
  38723. this.y = Math.max(this.y, e.y),
  38724. this.z = Math.max(this.z, e.z),
  38725. this.w = Math.max(this.w, e.w),
  38726. this
  38727. },
  38728. clamp: function(e, t) {
  38729. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38730. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38731. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38732. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38733. this
  38734. },
  38735. clampScalar: function(e, t) {
  38736. return void 0 === _e && (_e = new Ci.Vector4,
  38737. be = new Ci.Vector4),
  38738. _e.set(e, e, e, e),
  38739. be.set(t, t, t, t),
  38740. this.clamp(_e, be)
  38741. },
  38742. floor: function() {
  38743. return this.x = Math.floor(this.x),
  38744. this.y = Math.floor(this.y),
  38745. this.z = Math.floor(this.z),
  38746. this.w = Math.floor(this.w),
  38747. this
  38748. },
  38749. ceil: function() {
  38750. return this.x = Math.ceil(this.x),
  38751. this.y = Math.ceil(this.y),
  38752. this.z = Math.ceil(this.z),
  38753. this.w = Math.ceil(this.w),
  38754. this
  38755. },
  38756. round: function() {
  38757. return this.x = Math.round(this.x),
  38758. this.y = Math.round(this.y),
  38759. this.z = Math.round(this.z),
  38760. this.w = Math.round(this.w),
  38761. this
  38762. },
  38763. roundToZero: function() {
  38764. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38765. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38766. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38767. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38768. this
  38769. },
  38770. negate: function() {
  38771. return this.x = -this.x,
  38772. this.y = -this.y,
  38773. this.z = -this.z,
  38774. this.w = -this.w,
  38775. this
  38776. },
  38777. dot: function(e) {
  38778. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38779. },
  38780. lengthSq: function() {
  38781. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38782. },
  38783. length: function() {
  38784. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38785. },
  38786. lengthManhattan: function() {
  38787. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38788. },
  38789. normalize: function() {
  38790. return this.divideScalar(this.length())
  38791. },
  38792. setLength: function(e) {
  38793. return this.multiplyScalar(e / this.length())
  38794. },
  38795. lerp: function(e, t) {
  38796. return this.x += (e.x - this.x) * t,
  38797. this.y += (e.y - this.y) * t,
  38798. this.z += (e.z - this.z) * t,
  38799. this.w += (e.w - this.w) * t,
  38800. this
  38801. },
  38802. lerpVectors: function(e, t, i) {
  38803. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38804. this
  38805. },
  38806. equals: function(e) {
  38807. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38808. },
  38809. fromArray: function(e, t) {
  38810. return void 0 === t && (t = 0),
  38811. this.x = e[t],
  38812. this.y = e[t + 1],
  38813. this.z = e[t + 2],
  38814. this.w = e[t + 3],
  38815. this
  38816. },
  38817. toArray: function(e, t) {
  38818. return void 0 === e && (e = []),
  38819. void 0 === t && (t = 0),
  38820. e[t] = this.x,
  38821. e[t + 1] = this.y,
  38822. e[t + 2] = this.z,
  38823. e[t + 3] = this.w,
  38824. e
  38825. },
  38826. fromAttribute: function(e, t, i) {
  38827. return void 0 === i && (i = 0),
  38828. t = t * e.itemSize + i,
  38829. this.x = e.array[t],
  38830. this.y = e.array[t + 1],
  38831. this.z = e.array[t + 2],
  38832. this.w = e.array[t + 3],
  38833. this
  38834. }
  38835. },
  38836. Ci.Euler = function(e, t, i, n) {
  38837. this._x = e || 0,
  38838. this._y = t || 0,
  38839. this._z = i || 0,
  38840. this._order = n || Ci.Euler.DefaultOrder
  38841. }
  38842. ,
  38843. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38844. Ci.Euler.DefaultOrder = "XYZ",
  38845. Ci.Euler.prototype = {
  38846. constructor: Ci.Euler,
  38847. get x() {
  38848. return this._x
  38849. },
  38850. set x(e) {
  38851. this._x = e,
  38852. this.onChangeCallback()
  38853. },
  38854. get y() {
  38855. return this._y
  38856. },
  38857. set y(e) {
  38858. this._y = e,
  38859. this.onChangeCallback()
  38860. },
  38861. get z() {
  38862. return this._z
  38863. },
  38864. set z(e) {
  38865. this._z = e,
  38866. this.onChangeCallback()
  38867. },
  38868. get order() {
  38869. return this._order
  38870. },
  38871. set order(e) {
  38872. this._order = e,
  38873. this.onChangeCallback()
  38874. },
  38875. set: function(e, t, i, n) {
  38876. return this._x = e,
  38877. this._y = t,
  38878. this._z = i,
  38879. this._order = n || this._order,
  38880. this.onChangeCallback(),
  38881. this
  38882. },
  38883. clone: function() {
  38884. return new this.constructor(this._x,this._y,this._z,this._order)
  38885. },
  38886. copy: function(e) {
  38887. return this._x = e._x,
  38888. this._y = e._y,
  38889. this._z = e._z,
  38890. this._order = e._order,
  38891. this.onChangeCallback(),
  38892. this
  38893. },
  38894. toObject: function() {//xzw
  38895. return {x:this.x,y:this.y,z:this.z}
  38896. },
  38897. setFromRotationMatrix: function(e, t, i) {
  38898. var n = Ci.Math.clamp
  38899. , r = e.elements
  38900. , o = r[0]
  38901. , a = r[4]
  38902. , s = r[8]
  38903. , l = r[1]
  38904. , c = r[5]
  38905. , h = r[9]
  38906. , u = r[2]
  38907. , d = r[6]
  38908. , p = r[10];
  38909. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38910. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38911. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38912. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38913. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38914. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38915. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38916. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38917. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38918. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38919. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38920. this._z = Math.atan2(l, o)) : (this._x = 0,
  38921. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38922. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38923. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38924. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38925. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38926. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38927. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38928. this._order = t,
  38929. !1 !== i && this.onChangeCallback(),
  38930. this
  38931. },
  38932. setFromQuaternion: function(e, t, i) {
  38933. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38934. Ee.makeRotationFromQuaternion(e),
  38935. this.setFromRotationMatrix(Ee, t, i),
  38936. this
  38937. },
  38938. setFromVector3: function(e, t) {
  38939. return this.set(e.x, e.y, e.z, t || this._order)
  38940. },
  38941. reorder: (Ie = new Ci.Quaternion,
  38942. function(e) {
  38943. Ie.setFromEuler(this),
  38944. this.setFromQuaternion(Ie, e)
  38945. }
  38946. ),
  38947. equals: function(e) {
  38948. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38949. },
  38950. fromArray: function(e) {
  38951. return this._x = e[0],
  38952. this._y = e[1],
  38953. this._z = e[2],
  38954. void 0 !== e[3] && (this._order = e[3]),
  38955. this.onChangeCallback(),
  38956. this
  38957. },
  38958. toArray: function(e, t) {
  38959. return void 0 === e && (e = []),
  38960. void 0 === t && (t = 0),
  38961. e[t] = this._x,
  38962. e[t + 1] = this._y,
  38963. e[t + 2] = this._z,
  38964. e[t + 3] = this._order,
  38965. e
  38966. },
  38967. toVector3: function(e) {
  38968. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38969. },
  38970. onChange: function(e) {
  38971. return this.onChangeCallback = e,
  38972. this
  38973. },
  38974. onChangeCallback: function() {}
  38975. },
  38976. Ci.Line3 = function(e, t) {
  38977. this.start = void 0 !== e ? e : new Ci.Vector3,
  38978. this.end = void 0 !== t ? t : new Ci.Vector3
  38979. }
  38980. ,
  38981. Ci.Line3.prototype = {
  38982. constructor: Ci.Line3,
  38983. set: function(e, t) {
  38984. return this.start.copy(e),
  38985. this.end.copy(t),
  38986. this
  38987. },
  38988. clone: function() {
  38989. return (new this.constructor).copy(this)
  38990. },
  38991. copy: function(e) {
  38992. return this.start.copy(e.start),
  38993. this.end.copy(e.end),
  38994. this
  38995. },
  38996. center: function(e) {
  38997. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38998. },
  38999. delta: function(e) {
  39000. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39001. },
  39002. distanceSq: function() {
  39003. return this.start.distanceToSquared(this.end)
  39004. },
  39005. distance: function() {
  39006. return this.start.distanceTo(this.end)
  39007. },
  39008. at: function(e, t) {
  39009. var i = t || new Ci.Vector3;
  39010. return this.delta(i).multiplyScalar(e).add(this.start)
  39011. },
  39012. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39013. Ce = new Ci.Vector3,
  39014. function(e, t) {
  39015. Ae.subVectors(e, this.start),
  39016. Ce.subVectors(this.end, this.start);
  39017. var i = Ce.dot(Ce)
  39018. , n = Ce.dot(Ae) / i;
  39019. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39020. n
  39021. }
  39022. ),
  39023. closestPointToPoint: function(e, t, i) {
  39024. var n = this.closestPointToPointParameter(e, t)
  39025. , r = i || new Ci.Vector3;
  39026. return this.delta(r).multiplyScalar(n).add(this.start)
  39027. },
  39028. applyMatrix4: function(e) {
  39029. return this.start.applyMatrix4(e),
  39030. this.end.applyMatrix4(e),
  39031. this
  39032. },
  39033. equals: function(e) {
  39034. return e.start.equals(this.start) && e.end.equals(this.end)
  39035. }
  39036. },
  39037. Ci.Box2 = function(e, t) {
  39038. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39039. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39040. }
  39041. ,
  39042. Ci.Box2.prototype = {
  39043. constructor: Ci.Box2,
  39044. set: function(e, t) {
  39045. return this.min.copy(e),
  39046. this.max.copy(t),
  39047. this
  39048. },
  39049. setFromPoints: function(e) {
  39050. this.makeEmpty();
  39051. for (var t = 0, i = e.length; t < i; t++)
  39052. this.expandByPoint(e[t]);
  39053. return this
  39054. },
  39055. setFromCenterAndSize: (ye = new Ci.Vector2,
  39056. function(e, t) {
  39057. var i = ye.copy(t).multiplyScalar(.5);
  39058. return this.min.copy(e).sub(i),
  39059. this.max.copy(e).add(i),
  39060. this
  39061. }
  39062. ),
  39063. clone: function() {
  39064. return (new this.constructor).copy(this)
  39065. },
  39066. copy: function(e) {
  39067. return this.min.copy(e.min),
  39068. this.max.copy(e.max),
  39069. this
  39070. },
  39071. makeEmpty: function() {
  39072. return this.min.x = this.min.y = 1 / 0,
  39073. this.max.x = this.max.y = -1 / 0,
  39074. this
  39075. },
  39076. isEmpty: function() {
  39077. return this.max.x < this.min.x || this.max.y < this.min.y
  39078. },
  39079. center: function(e) {
  39080. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39081. },
  39082. size: function(e) {
  39083. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39084. },
  39085. expandByPoint: function(e) {
  39086. return this.min.min(e),
  39087. this.max.max(e),
  39088. this
  39089. },
  39090. expandByVector: function(e) {
  39091. return this.min.sub(e),
  39092. this.max.add(e),
  39093. this
  39094. },
  39095. expandByScalar: function(e) {
  39096. return this.min.addScalar(-e),
  39097. this.max.addScalar(e),
  39098. this
  39099. },
  39100. containsPoint: function(e) {
  39101. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39102. },
  39103. containsBox: function(e) {
  39104. 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
  39105. },
  39106. getParameter: function(e, t) {
  39107. 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))
  39108. },
  39109. intersectsBox: function(e) {
  39110. 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)
  39111. },
  39112. clampPoint: function(e, t) {
  39113. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39114. },
  39115. distanceToPoint: (ve = new Ci.Vector2,
  39116. function(e) {
  39117. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39118. }
  39119. ),
  39120. intersect: function(e) {
  39121. return this.min.max(e.min),
  39122. this.max.min(e.max),
  39123. this
  39124. },
  39125. union: function(e) {
  39126. return this.min.min(e.min),
  39127. this.max.max(e.max),
  39128. this
  39129. },
  39130. translate: function(e) {
  39131. return this.min.add(e),
  39132. this.max.add(e),
  39133. this
  39134. },
  39135. equals: function(e) {
  39136. return e.min.equals(this.min) && e.max.equals(this.max)
  39137. }
  39138. },
  39139. Ci.Box3 = function(e, t) {
  39140. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39141. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39142. }
  39143. ,
  39144. Ci.Box3.prototype = {
  39145. constructor: Ci.Box3,
  39146. set: function(e, t) {
  39147. return this.min.copy(e),
  39148. this.max.copy(t),
  39149. this
  39150. },
  39151. setFromArray: function(e) {
  39152. this.makeEmpty();
  39153. 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) {
  39154. var c = e[s]
  39155. , h = e[s + 1]
  39156. , u = e[s + 2];
  39157. c < t && (t = c),
  39158. h < i && (i = h),
  39159. u < n && (n = u),
  39160. r < c && (r = c),
  39161. o < h && (o = h),
  39162. a < u && (a = u)
  39163. }
  39164. this.min.set(t, i, n),
  39165. this.max.set(r, o, a)
  39166. },
  39167. setFromPoints: function(e) {
  39168. this.makeEmpty();
  39169. for (var t = 0, i = e.length; t < i; t++)
  39170. this.expandByPoint(e[t]);
  39171. return this
  39172. },
  39173. setFromCenterAndSize: (me = new Ci.Vector3,
  39174. function(e, t) {
  39175. var i = me.copy(t).multiplyScalar(.5);
  39176. return this.min.copy(e).sub(i),
  39177. this.max.copy(e).add(i),
  39178. this
  39179. }
  39180. ),
  39181. setFromObject: function(e) {
  39182. void 0 === ge && (ge = new Ci.Box3);
  39183. var i = this;
  39184. return this.makeEmpty(),
  39185. e.updateMatrixWorld(!0),
  39186. e.traverse(function(e) {
  39187. var t = e.geometry;
  39188. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39189. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39190. ge.applyMatrix4(e.matrixWorld),
  39191. i.union(ge)))
  39192. }),
  39193. this
  39194. },
  39195. clone: function() {
  39196. return (new this.constructor).copy(this)
  39197. },
  39198. copy: function(e) {
  39199. return this.min.copy(e.min),
  39200. this.max.copy(e.max),
  39201. this
  39202. },
  39203. makeEmpty: function() {
  39204. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39205. this.max.x = this.max.y = this.max.z = -1 / 0,
  39206. this
  39207. },
  39208. isEmpty: function() {
  39209. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39210. },
  39211. center: function(e) {
  39212. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39213. },
  39214. size: function(e) {
  39215. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39216. },
  39217. expandByPoint: function(e) {
  39218. return this.min.min(e),
  39219. this.max.max(e),
  39220. this
  39221. },
  39222. expandByVector: function(e) {
  39223. return this.min.sub(e),
  39224. this.max.add(e),
  39225. this
  39226. },
  39227. expandByScalar: function(e) {
  39228. return this.min.addScalar(-e),
  39229. this.max.addScalar(e),
  39230. this
  39231. },
  39232. containsPoint: function(e) {
  39233. 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)
  39234. },
  39235. containsBox: function(e) {
  39236. 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
  39237. },
  39238. getParameter: function(e, t) {
  39239. 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))
  39240. },
  39241. intersectsBox: function(e) {
  39242. 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)
  39243. },
  39244. intersectsSphere: function(e) {
  39245. return void 0 === fe && (fe = new Ci.Vector3),
  39246. this.clampPoint(e.center, fe),
  39247. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39248. },
  39249. intersectsPlane: function(e) {
  39250. var t, i;
  39251. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39252. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39253. e.normal.x * this.min.x),
  39254. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39255. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39256. i += e.normal.y * this.min.y),
  39257. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39258. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39259. i += e.normal.z * this.min.z),
  39260. t <= e.constant && i >= e.constant
  39261. },
  39262. clampPoint: function(e, t) {
  39263. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39264. },
  39265. distanceToPoint: (pe = new Ci.Vector3,
  39266. function(e) {
  39267. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39268. }
  39269. ),
  39270. getBoundingSphere: (de = new Ci.Vector3,
  39271. function(e) {
  39272. var t = e || new Ci.Sphere;
  39273. return t.center = this.center(),
  39274. t.radius = .5 * this.size(de).length(),
  39275. t
  39276. }
  39277. ),
  39278. intersect: function(e) {
  39279. return this.min.max(e.min),
  39280. this.max.min(e.max),
  39281. this
  39282. },
  39283. union: function(e) {
  39284. return this.min.min(e.min),
  39285. this.max.max(e.max),
  39286. this
  39287. },
  39288. 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],
  39289. function(e) {
  39290. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39291. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39292. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39293. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39294. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39295. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39296. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39297. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39298. this.makeEmpty(),
  39299. this.setFromPoints(ue),
  39300. this
  39301. }
  39302. ),
  39303. translate: function(e) {
  39304. return this.min.add(e),
  39305. this.max.add(e),
  39306. this
  39307. },
  39308. equals: function(e) {
  39309. return e.min.equals(this.min) && e.max.equals(this.max)
  39310. }
  39311. },
  39312. Ci.Matrix3 = function() {
  39313. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39314. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39315. }
  39316. ,
  39317. Ci.Matrix3.prototype = {
  39318. constructor: Ci.Matrix3,
  39319. set: function(e, t, i, n, r, o, a, s, l) {
  39320. var c = this.elements;
  39321. return c[0] = e,
  39322. c[1] = n,
  39323. c[2] = a,
  39324. c[3] = t,
  39325. c[4] = r,
  39326. c[5] = s,
  39327. c[6] = i,
  39328. c[7] = o,
  39329. c[8] = l,
  39330. this
  39331. },
  39332. identity: function() {
  39333. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39334. this
  39335. },
  39336. clone: function() {
  39337. return (new this.constructor).fromArray(this.elements)
  39338. },
  39339. copy: function(e) {
  39340. var t = e.elements;
  39341. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39342. this
  39343. },
  39344. setFromMatrix4: function(e) {
  39345. var t = e.elements;
  39346. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39347. this
  39348. },
  39349. applyToVector3Array: function(e, t, i) {
  39350. void 0 === he && (he = new Ci.Vector3),
  39351. void 0 === t && (t = 0),
  39352. void 0 === i && (i = e.length);
  39353. for (var n = 0, r = t; n < i; n += 3,
  39354. r += 3)
  39355. he.fromArray(e, r),
  39356. he.applyMatrix3(this),
  39357. he.toArray(e, r);
  39358. return e
  39359. },
  39360. applyToBuffer: function(e, t, i) {
  39361. void 0 === ce && (ce = new Ci.Vector3),
  39362. void 0 === t && (t = 0),
  39363. void 0 === i && (i = e.length / e.itemSize);
  39364. for (var n = 0, r = t; n < i; n++,
  39365. r++)
  39366. ce.x = e.getX(r),
  39367. ce.y = e.getY(r),
  39368. ce.z = e.getZ(r),
  39369. ce.applyMatrix3(this),
  39370. e.setXYZ(ce.x, ce.y, ce.z);
  39371. return e
  39372. },
  39373. multiplyScalar: function(e) {
  39374. var t = this.elements;
  39375. return t[0] *= e,
  39376. t[3] *= e,
  39377. t[6] *= e,
  39378. t[1] *= e,
  39379. t[4] *= e,
  39380. t[7] *= e,
  39381. t[2] *= e,
  39382. t[5] *= e,
  39383. t[8] *= e,
  39384. this
  39385. },
  39386. determinant: function() {
  39387. var e = this.elements
  39388. , t = e[0]
  39389. , i = e[1]
  39390. , n = e[2]
  39391. , r = e[3]
  39392. , o = e[4]
  39393. , a = e[5]
  39394. , s = e[6]
  39395. , l = e[7]
  39396. , c = e[8];
  39397. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39398. },
  39399. getInverse: function(e, t) {
  39400. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39401. var i = e.elements
  39402. , n = this.elements
  39403. , r = i[0]
  39404. , o = i[1]
  39405. , a = i[2]
  39406. , s = i[3]
  39407. , l = i[4]
  39408. , c = i[5]
  39409. , h = i[6]
  39410. , u = i[7]
  39411. , d = i[8]
  39412. , p = d * l - c * u
  39413. , f = c * h - d * s
  39414. , g = u * s - l * h
  39415. , m = r * p + o * f + a * g;
  39416. if (0 != m)
  39417. return n[0] = p,
  39418. n[1] = a * u - d * o,
  39419. n[2] = c * o - a * l,
  39420. n[3] = f,
  39421. n[4] = d * r - a * h,
  39422. n[5] = a * s - c * r,
  39423. n[6] = g,
  39424. n[7] = o * h - u * r,
  39425. n[8] = l * r - o * s,
  39426. this.multiplyScalar(1 / m);
  39427. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39428. if (t)
  39429. throw new Error(v);
  39430. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39431. },
  39432. transpose: function() {
  39433. var e, t = this.elements;
  39434. return e = t[1],
  39435. t[1] = t[3],
  39436. t[3] = e,
  39437. e = t[2],
  39438. t[2] = t[6],
  39439. t[6] = e,
  39440. e = t[5],
  39441. t[5] = t[7],
  39442. t[7] = e,
  39443. this
  39444. },
  39445. flattenToArrayOffset: function(e, t) {
  39446. var i = this.elements;
  39447. return e[t] = i[0],
  39448. e[t + 1] = i[1],
  39449. e[t + 2] = i[2],
  39450. e[t + 3] = i[3],
  39451. e[t + 4] = i[4],
  39452. e[t + 5] = i[5],
  39453. e[t + 6] = i[6],
  39454. e[t + 7] = i[7],
  39455. e[t + 8] = i[8],
  39456. e
  39457. },
  39458. getNormalMatrix: function(e) {
  39459. return this.setFromMatrix4(e).getInverse(this).transpose()
  39460. },
  39461. transposeIntoArray: function(e) {
  39462. var t = this.elements;
  39463. return e[0] = t[0],
  39464. e[1] = t[3],
  39465. e[2] = t[6],
  39466. e[3] = t[1],
  39467. e[4] = t[4],
  39468. e[5] = t[7],
  39469. e[6] = t[2],
  39470. e[7] = t[5],
  39471. e[8] = t[8],
  39472. this
  39473. },
  39474. fromArray: function(e) {
  39475. return this.elements.set(e),
  39476. this
  39477. },
  39478. toArray: function() {
  39479. var e = this.elements;
  39480. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39481. }
  39482. },
  39483. Ci.Matrix4 = function() {
  39484. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39485. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39486. }
  39487. ,
  39488. Ci.Matrix4.prototype = {
  39489. constructor: Ci.Matrix4,
  39490. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39491. var m = this.elements;
  39492. return m[0] = e,
  39493. m[4] = t,
  39494. m[8] = i,
  39495. m[12] = n,
  39496. m[1] = r,
  39497. m[5] = o,
  39498. m[9] = a,
  39499. m[13] = s,
  39500. m[2] = l,
  39501. m[6] = c,
  39502. m[10] = h,
  39503. m[14] = u,
  39504. m[3] = d,
  39505. m[7] = p,
  39506. m[11] = f,
  39507. m[15] = g,
  39508. this
  39509. },
  39510. identity: function() {
  39511. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39512. this
  39513. },
  39514. clone: function() {
  39515. return (new Ci.Matrix4).fromArray(this.elements)
  39516. },
  39517. copy: function(e) {
  39518. return this.elements.set(e.elements),
  39519. this
  39520. },
  39521. copyPosition: function(e) {
  39522. var t = this.elements
  39523. , i = e.elements;
  39524. return t[12] = i[12],
  39525. t[13] = i[13],
  39526. t[14] = i[14],
  39527. this
  39528. },
  39529. extractBasis: function(e, t, i) {
  39530. return e.setFromMatrixColumn(this, 0),
  39531. t.setFromMatrixColumn(this, 1),
  39532. i.setFromMatrixColumn(this, 2),
  39533. this
  39534. },
  39535. makeBasis: function(e, t, i) {
  39536. 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),
  39537. this
  39538. },
  39539. extractRotation: function(e) {
  39540. void 0 === le && (le = new Ci.Vector3);
  39541. var t = this.elements
  39542. , i = e.elements
  39543. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39544. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39545. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39546. return t[0] = i[0] * n,
  39547. t[1] = i[1] * n,
  39548. t[2] = i[2] * n,
  39549. t[4] = i[4] * r,
  39550. t[5] = i[5] * r,
  39551. t[6] = i[6] * r,
  39552. t[8] = i[8] * o,
  39553. t[9] = i[9] * o,
  39554. t[10] = i[10] * o,
  39555. this
  39556. },
  39557. makeRotationFromEuler: function(e) {
  39558. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39559. var t = this.elements
  39560. , i = e.x
  39561. , n = e.y
  39562. , r = e.z
  39563. , o = Math.cos(i)
  39564. , a = Math.sin(i)
  39565. , s = Math.cos(n)
  39566. , l = Math.sin(n)
  39567. , c = Math.cos(r)
  39568. , h = Math.sin(r);
  39569. if ("XYZ" === e.order) {
  39570. var u = o * c
  39571. , d = o * h
  39572. , p = a * c
  39573. , f = a * h;
  39574. t[0] = s * c,
  39575. t[4] = -s * h,
  39576. t[8] = l,
  39577. t[1] = d + p * l,
  39578. t[5] = u - f * l,
  39579. t[9] = -a * s,
  39580. t[2] = f - u * l,
  39581. t[6] = p + d * l,
  39582. t[10] = o * s
  39583. } else if ("YXZ" === e.order) {
  39584. var g = s * c
  39585. , m = s * h
  39586. , v = l * c
  39587. , y = l * h;
  39588. t[0] = g + y * a,
  39589. t[4] = v * a - m,
  39590. t[8] = o * l,
  39591. t[1] = o * h,
  39592. t[5] = o * c,
  39593. t[9] = -a,
  39594. t[2] = m * a - v,
  39595. t[6] = y + g * a,
  39596. t[10] = o * s
  39597. } else if ("ZXY" === e.order) {
  39598. g = s * c,
  39599. m = s * h,
  39600. v = l * c,
  39601. y = l * h;
  39602. t[0] = g - y * a,
  39603. t[4] = -o * h,
  39604. t[8] = v + m * a,
  39605. t[1] = m + v * a,
  39606. t[5] = o * c,
  39607. t[9] = y - g * a,
  39608. t[2] = -o * l,
  39609. t[6] = a,
  39610. t[10] = o * s
  39611. } else if ("ZYX" === e.order) {
  39612. u = o * c,
  39613. d = o * h,
  39614. p = a * c,
  39615. f = a * h;
  39616. t[0] = s * c,
  39617. t[4] = p * l - d,
  39618. t[8] = u * l + f,
  39619. t[1] = s * h,
  39620. t[5] = f * l + u,
  39621. t[9] = d * l - p,
  39622. t[2] = -l,
  39623. t[6] = a * s,
  39624. t[10] = o * s
  39625. } else if ("YZX" === e.order) {
  39626. var A = o * s
  39627. , C = o * l
  39628. , I = a * s
  39629. , E = a * l;
  39630. t[0] = s * c,
  39631. t[4] = E - A * h,
  39632. t[8] = I * h + C,
  39633. t[1] = h,
  39634. t[5] = o * c,
  39635. t[9] = -a * c,
  39636. t[2] = -l * c,
  39637. t[6] = C * h + I,
  39638. t[10] = A - E * h
  39639. } else if ("XZY" === e.order) {
  39640. A = o * s,
  39641. C = o * l,
  39642. I = a * s,
  39643. E = a * l;
  39644. t[0] = s * c,
  39645. t[4] = -h,
  39646. t[8] = l * c,
  39647. t[1] = A * h + E,
  39648. t[5] = o * c,
  39649. t[9] = C * h - I,
  39650. t[2] = I * h - C,
  39651. t[6] = a * c,
  39652. t[10] = E * h + A
  39653. }
  39654. return t[3] = 0,
  39655. t[7] = 0,
  39656. t[11] = 0,
  39657. t[12] = 0,
  39658. t[13] = 0,
  39659. t[14] = 0,
  39660. t[15] = 1,
  39661. this
  39662. },
  39663. makeRotationFromQuaternion: function(e) {
  39664. var t = this.elements
  39665. , i = e.x
  39666. , n = e.y
  39667. , r = e.z
  39668. , o = e.w
  39669. , a = i + i
  39670. , s = n + n
  39671. , l = r + r
  39672. , c = i * a
  39673. , h = i * s
  39674. , u = i * l
  39675. , d = n * s
  39676. , p = n * l
  39677. , f = r * l
  39678. , g = o * a
  39679. , m = o * s
  39680. , v = o * l;
  39681. return t[0] = 1 - (d + f),
  39682. t[4] = h - v,
  39683. t[8] = u + m,
  39684. t[1] = h + v,
  39685. t[5] = 1 - (c + f),
  39686. t[9] = p - g,
  39687. t[2] = u - m,
  39688. t[6] = p + g,
  39689. t[10] = 1 - (c + d),
  39690. t[3] = 0,
  39691. t[7] = 0,
  39692. t[11] = 0,
  39693. t[12] = 0,
  39694. t[13] = 0,
  39695. t[14] = 0,
  39696. t[15] = 1,
  39697. this
  39698. },
  39699. lookAt: function(e, t, i) {
  39700. void 0 === oe && (oe = new Ci.Vector3),
  39701. void 0 === ae && (ae = new Ci.Vector3),
  39702. void 0 === se && (se = new Ci.Vector3);
  39703. var n = this.elements;
  39704. return se.subVectors(e, t).normalize(),
  39705. 0 === se.lengthSq() && (se.z = 1),
  39706. oe.crossVectors(i, se).normalize(),
  39707. 0 === oe.lengthSq() && (se.x += 1e-4,
  39708. oe.crossVectors(i, se).normalize()),
  39709. ae.crossVectors(se, oe),
  39710. n[0] = oe.x,
  39711. n[4] = ae.x,
  39712. n[8] = se.x,
  39713. n[1] = oe.y,
  39714. n[5] = ae.y,
  39715. n[9] = se.y,
  39716. n[2] = oe.z,
  39717. n[6] = ae.z,
  39718. n[10] = se.z,
  39719. this
  39720. },
  39721. multiply: function(e, t) {
  39722. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39723. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39724. },
  39725. multiplyMatrices: function(e, t) {
  39726. var i = e.elements
  39727. , n = t.elements
  39728. , r = this.elements
  39729. , o = i[0]
  39730. , a = i[4]
  39731. , s = i[8]
  39732. , l = i[12]
  39733. , c = i[1]
  39734. , h = i[5]
  39735. , u = i[9]
  39736. , d = i[13]
  39737. , p = i[2]
  39738. , f = i[6]
  39739. , g = i[10]
  39740. , m = i[14]
  39741. , v = i[3]
  39742. , y = i[7]
  39743. , A = i[11]
  39744. , C = i[15]
  39745. , I = n[0]
  39746. , E = n[4]
  39747. , _ = n[8]
  39748. , b = n[12]
  39749. , w = n[1]
  39750. , T = n[5]
  39751. , x = n[9]
  39752. , S = n[13]
  39753. , M = n[2]
  39754. , R = n[6]
  39755. , P = n[10]
  39756. , O = n[14]
  39757. , L = n[3]
  39758. , D = n[7]
  39759. , N = n[11]
  39760. , F = n[15];
  39761. return r[0] = o * I + a * w + s * M + l * L,
  39762. r[4] = o * E + a * T + s * R + l * D,
  39763. r[8] = o * _ + a * x + s * P + l * N,
  39764. r[12] = o * b + a * S + s * O + l * F,
  39765. r[1] = c * I + h * w + u * M + d * L,
  39766. r[5] = c * E + h * T + u * R + d * D,
  39767. r[9] = c * _ + h * x + u * P + d * N,
  39768. r[13] = c * b + h * S + u * O + d * F,
  39769. r[2] = p * I + f * w + g * M + m * L,
  39770. r[6] = p * E + f * T + g * R + m * D,
  39771. r[10] = p * _ + f * x + g * P + m * N,
  39772. r[14] = p * b + f * S + g * O + m * F,
  39773. r[3] = v * I + y * w + A * M + C * L,
  39774. r[7] = v * E + y * T + A * R + C * D,
  39775. r[11] = v * _ + y * x + A * P + C * N,
  39776. r[15] = v * b + y * S + A * O + C * F,
  39777. this
  39778. },
  39779. multiplyToArray: function(e, t, i) {
  39780. var n = this.elements;
  39781. return this.multiplyMatrices(e, t),
  39782. i[0] = n[0],
  39783. i[1] = n[1],
  39784. i[2] = n[2],
  39785. i[3] = n[3],
  39786. i[4] = n[4],
  39787. i[5] = n[5],
  39788. i[6] = n[6],
  39789. i[7] = n[7],
  39790. i[8] = n[8],
  39791. i[9] = n[9],
  39792. i[10] = n[10],
  39793. i[11] = n[11],
  39794. i[12] = n[12],
  39795. i[13] = n[13],
  39796. i[14] = n[14],
  39797. i[15] = n[15],
  39798. this
  39799. },
  39800. multiplyScalar: function(e) {
  39801. var t = this.elements;
  39802. return t[0] *= e,
  39803. t[4] *= e,
  39804. t[8] *= e,
  39805. t[12] *= e,
  39806. t[1] *= e,
  39807. t[5] *= e,
  39808. t[9] *= e,
  39809. t[13] *= e,
  39810. t[2] *= e,
  39811. t[6] *= e,
  39812. t[10] *= e,
  39813. t[14] *= e,
  39814. t[3] *= e,
  39815. t[7] *= e,
  39816. t[11] *= e,
  39817. t[15] *= e,
  39818. this
  39819. },
  39820. applyToVector3Array: function(e, t, i) {
  39821. void 0 === re && (re = new Ci.Vector3),
  39822. void 0 === t && (t = 0),
  39823. void 0 === i && (i = e.length);
  39824. for (var n = 0, r = t; n < i; n += 3,
  39825. r += 3)
  39826. re.fromArray(e, r),
  39827. re.applyMatrix4(this),
  39828. re.toArray(e, r);
  39829. return e
  39830. },
  39831. applyToBuffer: function(e, t, i) {
  39832. void 0 === ne && (ne = new Ci.Vector3),
  39833. void 0 === t && (t = 0),
  39834. void 0 === i && (i = e.length / e.itemSize);
  39835. for (var n = 0, r = t; n < i; n++,
  39836. r++)
  39837. ne.x = e.getX(r),
  39838. ne.y = e.getY(r),
  39839. ne.z = e.getZ(r),
  39840. ne.applyMatrix4(this),
  39841. e.setXYZ(ne.x, ne.y, ne.z);
  39842. return e
  39843. },
  39844. determinant: function() {
  39845. var e = this.elements
  39846. , t = e[0]
  39847. , i = e[4]
  39848. , n = e[8]
  39849. , r = e[12]
  39850. , o = e[1]
  39851. , a = e[5]
  39852. , s = e[9]
  39853. , l = e[13]
  39854. , c = e[2]
  39855. , h = e[6]
  39856. , u = e[10]
  39857. , d = e[14];
  39858. 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)
  39859. },
  39860. transpose: function() {
  39861. var e, t = this.elements;
  39862. return e = t[1],
  39863. t[1] = t[4],
  39864. t[4] = e,
  39865. e = t[2],
  39866. t[2] = t[8],
  39867. t[8] = e,
  39868. e = t[6],
  39869. t[6] = t[9],
  39870. t[9] = e,
  39871. e = t[3],
  39872. t[3] = t[12],
  39873. t[12] = e,
  39874. e = t[7],
  39875. t[7] = t[13],
  39876. t[13] = e,
  39877. e = t[11],
  39878. t[11] = t[14],
  39879. t[14] = e,
  39880. this
  39881. },
  39882. flattenToArrayOffset: function(e, t) {
  39883. var i = this.elements;
  39884. return e[t] = i[0],
  39885. e[t + 1] = i[1],
  39886. e[t + 2] = i[2],
  39887. e[t + 3] = i[3],
  39888. e[t + 4] = i[4],
  39889. e[t + 5] = i[5],
  39890. e[t + 6] = i[6],
  39891. e[t + 7] = i[7],
  39892. e[t + 8] = i[8],
  39893. e[t + 9] = i[9],
  39894. e[t + 10] = i[10],
  39895. e[t + 11] = i[11],
  39896. e[t + 12] = i[12],
  39897. e[t + 13] = i[13],
  39898. e[t + 14] = i[14],
  39899. e[t + 15] = i[15],
  39900. e
  39901. },
  39902. getPosition: function() {
  39903. return void 0 === ie && (ie = new Ci.Vector3),
  39904. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39905. ie.setFromMatrixColumn(this, 3)
  39906. },
  39907. setPosition: function(e) {
  39908. var t = this.elements;
  39909. return t[12] = e.x,
  39910. t[13] = e.y,
  39911. t[14] = e.z,
  39912. this
  39913. },
  39914. getInverse: function(e, t) {
  39915. var i = this.elements
  39916. , n = e.elements
  39917. , r = n[0]
  39918. , o = n[1]
  39919. , a = n[2]
  39920. , s = n[3]
  39921. , l = n[4]
  39922. , c = n[5]
  39923. , h = n[6]
  39924. , u = n[7]
  39925. , d = n[8]
  39926. , p = n[9]
  39927. , f = n[10]
  39928. , g = n[11]
  39929. , m = n[12]
  39930. , v = n[13]
  39931. , y = n[14]
  39932. , A = n[15]
  39933. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39934. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39935. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39936. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39937. , b = r * C + o * I + a * E + s * _;
  39938. if (0 != b)
  39939. return i[0] = C,
  39940. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39941. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39942. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39943. i[4] = I,
  39944. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39945. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39946. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39947. i[8] = E,
  39948. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39949. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39950. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39951. i[12] = _,
  39952. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39953. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39954. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39955. this.multiplyScalar(1 / b);
  39956. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39957. if (t)
  39958. throw new Error(w);
  39959. return console.warn(w),
  39960. this.identity()
  39961. },
  39962. scale: function(e) {
  39963. var t = this.elements
  39964. , i = e.x
  39965. , n = e.y
  39966. , r = e.z;
  39967. return t[0] *= i,
  39968. t[4] *= n,
  39969. t[8] *= r,
  39970. t[1] *= i,
  39971. t[5] *= n,
  39972. t[9] *= r,
  39973. t[2] *= i,
  39974. t[6] *= n,
  39975. t[10] *= r,
  39976. t[3] *= i,
  39977. t[7] *= n,
  39978. t[11] *= r,
  39979. this
  39980. },
  39981. getMaxScaleOnAxis: function() {
  39982. var e = this.elements
  39983. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39984. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39985. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39986. return Math.sqrt(Math.max(t, i, n))
  39987. },
  39988. makeTranslation: function(e, t, i) {
  39989. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39990. this
  39991. },
  39992. makeRotationX: function(e) {
  39993. var t = Math.cos(e)
  39994. , i = Math.sin(e);
  39995. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39996. this
  39997. },
  39998. makeRotationY: function(e) {
  39999. var t = Math.cos(e)
  40000. , i = Math.sin(e);
  40001. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40002. this
  40003. },
  40004. makeRotationZ: function(e) {
  40005. var t = Math.cos(e)
  40006. , i = Math.sin(e);
  40007. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40008. this
  40009. },
  40010. makeRotationAxis: function(e, t) {
  40011. var i = Math.cos(t)
  40012. , n = Math.sin(t)
  40013. , r = 1 - i
  40014. , o = e.x
  40015. , a = e.y
  40016. , s = e.z
  40017. , l = r * o
  40018. , c = r * a;
  40019. 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),
  40020. this
  40021. },
  40022. makeScale: function(e, t, i) {
  40023. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40024. this
  40025. },
  40026. compose: function(e, t, i) {
  40027. return this.makeRotationFromQuaternion(t),
  40028. this.scale(i),
  40029. this.setPosition(e),
  40030. this
  40031. },
  40032. decompose: function(e, t, i) {
  40033. void 0 === ee && (ee = new Ci.Vector3),
  40034. void 0 === te && (te = new Ci.Matrix4);
  40035. var n = this.elements
  40036. , r = ee.set(n[0], n[1], n[2]).length()
  40037. , o = ee.set(n[4], n[5], n[6]).length()
  40038. , a = ee.set(n[8], n[9], n[10]).length();
  40039. this.determinant() < 0 && (r = -r),
  40040. e.x = n[12],
  40041. e.y = n[13],
  40042. e.z = n[14],
  40043. te.elements.set(this.elements);
  40044. var s = 1 / r
  40045. , l = 1 / o
  40046. , c = 1 / a;
  40047. return te.elements[0] *= s,
  40048. te.elements[1] *= s,
  40049. te.elements[2] *= s,
  40050. te.elements[4] *= l,
  40051. te.elements[5] *= l,
  40052. te.elements[6] *= l,
  40053. te.elements[8] *= c,
  40054. te.elements[9] *= c,
  40055. te.elements[10] *= c,
  40056. t.setFromRotationMatrix(te),
  40057. i.x = r,
  40058. i.y = o,
  40059. i.z = a,
  40060. this
  40061. },
  40062. makeFrustum: function(e, t, i, n, r, o) {
  40063. var a = this.elements
  40064. , s = 2 * r / (t - e)
  40065. , l = 2 * r / (n - i)
  40066. , c = (t + e) / (t - e)
  40067. , h = (n + i) / (n - i)
  40068. , u = -(o + r) / (o - r)
  40069. , d = -2 * o * r / (o - r);
  40070. return a[0] = s,
  40071. a[4] = 0,
  40072. a[8] = c,
  40073. a[12] = 0,
  40074. a[1] = 0,
  40075. a[5] = l,
  40076. a[9] = h,
  40077. a[13] = 0,
  40078. a[2] = 0,
  40079. a[6] = 0,
  40080. a[10] = u,
  40081. a[14] = d,
  40082. a[3] = 0,
  40083. a[7] = 0,
  40084. a[11] = -1,
  40085. a[15] = 0,
  40086. this
  40087. },
  40088. makePerspective: function(e, t, i, n) {
  40089. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40090. , o = -r
  40091. , a = o * t
  40092. , s = r * t;
  40093. return this.makeFrustum(a, s, o, r, i, n)
  40094. },
  40095. makeOrthographic: function(e, t, i, n, r, o) {
  40096. var a = this.elements
  40097. , s = 1 / (t - e)
  40098. , l = 1 / (i - n)
  40099. , c = 1 / (o - r)
  40100. , h = (t + e) * s
  40101. , u = (i + n) * l
  40102. , d = (o + r) * c;
  40103. return a[0] = 2 * s,
  40104. a[4] = 0,
  40105. a[8] = 0,
  40106. a[12] = -h,
  40107. a[1] = 0,
  40108. a[5] = 2 * l,
  40109. a[9] = 0,
  40110. a[13] = -u,
  40111. a[2] = 0,
  40112. a[6] = 0,
  40113. a[10] = -2 * c,
  40114. a[14] = -d,
  40115. a[3] = 0,
  40116. a[7] = 0,
  40117. a[11] = 0,
  40118. a[15] = 1,
  40119. this
  40120. },
  40121. equals: function(e) {
  40122. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40123. if (t[n] !== i[n])
  40124. return !1;
  40125. return !0
  40126. },
  40127. fromArray: function(e) {
  40128. return this.elements.set(e),
  40129. this
  40130. },
  40131. toArray: function() {
  40132. var e = this.elements;
  40133. 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]]
  40134. }
  40135. },
  40136. Ci.Ray = function(e, t) {
  40137. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40138. this.direction = void 0 !== t ? t : new Ci.Vector3
  40139. }
  40140. ,
  40141. Ci.Ray.prototype = {
  40142. constructor: Ci.Ray,
  40143. set: function(e, t) {
  40144. return this.origin.copy(e),
  40145. this.direction.copy(t),
  40146. this
  40147. },
  40148. clone: function() {
  40149. return (new this.constructor).copy(this)
  40150. },
  40151. copy: function(e) {
  40152. return this.origin.copy(e.origin),
  40153. this.direction.copy(e.direction),
  40154. this
  40155. },
  40156. at: function(e, t) {
  40157. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40158. },
  40159. lookAt: function(e) {
  40160. this.direction.copy(e).sub(this.origin).normalize()
  40161. },
  40162. recast: ($ = new Ci.Vector3,
  40163. function(e) {
  40164. return this.origin.copy(this.at(e, $)),
  40165. this
  40166. }
  40167. ),
  40168. closestPointToPoint: function(e, t) {
  40169. var i = t || new Ci.Vector3;
  40170. i.subVectors(e, this.origin);
  40171. var n = i.dot(this.direction);
  40172. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40173. },
  40174. distanceToPoint: function(e) {
  40175. return Math.sqrt(this.distanceSqToPoint(e))
  40176. },
  40177. distanceSqToPoint: (J = new Ci.Vector3,
  40178. function(e) {
  40179. var t = J.subVectors(e, this.origin).dot(this.direction);
  40180. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40181. J.distanceToSquared(e))
  40182. }
  40183. ),
  40184. distanceSqToSegment: (Z = new Ci.Vector3,
  40185. K = new Ci.Vector3,
  40186. Q = new Ci.Vector3,
  40187. function(e, t, i, n) {
  40188. Z.copy(e).add(t).multiplyScalar(.5),
  40189. K.copy(t).sub(e).normalize(),
  40190. Q.copy(this.origin).sub(Z);
  40191. 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);
  40192. if (0 < p)
  40193. if (o = c * h - u,
  40194. s = l * p,
  40195. 0 <= (r = c * u - h))
  40196. if (-s <= o)
  40197. if (o <= s) {
  40198. var f = 1 / p;
  40199. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40200. } else
  40201. o = l,
  40202. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40203. else
  40204. o = -l,
  40205. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40206. else
  40207. 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,
  40208. (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;
  40209. else
  40210. o = 0 < c ? -l : l,
  40211. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40212. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40213. n && n.copy(K).multiplyScalar(o).add(Z),
  40214. a
  40215. }
  40216. ),
  40217. intersectSphere: (X = new Ci.Vector3,
  40218. function(e, t) {
  40219. X.subVectors(e.center, this.origin);
  40220. var i = X.dot(this.direction)
  40221. , n = X.dot(X) - i * i
  40222. , r = e.radius * e.radius;
  40223. if (r < n)
  40224. return null;
  40225. var o = Math.sqrt(r - n)
  40226. , a = i - o
  40227. , s = i + o;
  40228. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40229. }
  40230. ),
  40231. intersectsSphere: function(e) {
  40232. return this.distanceToPoint(e.center) <= e.radius
  40233. },
  40234. distanceToPlane: function(e) {
  40235. var t = e.normal.dot(this.direction);
  40236. if (0 === t)
  40237. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40238. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40239. return 0 <= i ? i : null
  40240. },
  40241. intersectPlane: function(e, t) {
  40242. var i = this.distanceToPlane(e);
  40243. return null === i ? null : this.at(i, t)
  40244. },
  40245. intersectsPlane: function(e) {
  40246. var t = e.distanceToPoint(this.origin);
  40247. return 0 === t || e.normal.dot(this.direction) * t < 0
  40248. },
  40249. intersectBox: function(e, t) {
  40250. 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;
  40251. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40252. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40253. (e.min.x - u.x) * l),
  40254. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40255. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40256. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40257. (o < n || n != n) && (n = o),
  40258. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40259. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40260. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40261. (s < n || n != n) && (n = s),
  40262. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40263. },
  40264. intersectsBox: (q = new Ci.Vector3,
  40265. function(e) {
  40266. return null !== this.intersectBox(e, q)
  40267. }
  40268. ),
  40269. intersectTriangle: (G = new Ci.Vector3,
  40270. W = new Ci.Vector3,
  40271. j = new Ci.Vector3,
  40272. Y = new Ci.Vector3,
  40273. function(e, t, i, n, r) {
  40274. W.subVectors(t, e),
  40275. j.subVectors(i, e),
  40276. Y.crossVectors(W, j);
  40277. var o, a = this.direction.dot(Y);
  40278. if (0 < a) {
  40279. if (n)
  40280. return null;
  40281. o = 1
  40282. } else {
  40283. if (!(a < 0))
  40284. return null;
  40285. o = -1,
  40286. a = -a
  40287. }
  40288. G.subVectors(this.origin, e);
  40289. var s = o * this.direction.dot(j.crossVectors(G, j));
  40290. if (s < 0)
  40291. return null;
  40292. var l = o * this.direction.dot(W.cross(G));
  40293. if (l < 0)
  40294. return null;
  40295. if (a < s + l)
  40296. return null;
  40297. var c = -o * G.dot(Y);
  40298. return c < 0 ? null : this.at(c / a, r)
  40299. }
  40300. ),
  40301. applyMatrix4: function(e) {
  40302. return this.direction.add(this.origin).applyMatrix4(e),
  40303. this.origin.applyMatrix4(e),
  40304. this.direction.sub(this.origin),
  40305. this.direction.normalize(),
  40306. this
  40307. },
  40308. equals: function(e) {
  40309. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40310. }
  40311. },
  40312. Ci.Sphere = function(e, t) {
  40313. this.center = void 0 !== e ? e : new Ci.Vector3,
  40314. this.radius = void 0 !== t ? t : 0
  40315. }
  40316. ,
  40317. Ci.Sphere.prototype = {
  40318. constructor: Ci.Sphere,
  40319. set: function(e, t) {
  40320. return this.center.copy(e),
  40321. this.radius = t,
  40322. this
  40323. },
  40324. setFromPoints: (z = new Ci.Box3,
  40325. function(e, t) {
  40326. var i = this.center;
  40327. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40328. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40329. n = Math.max(n, i.distanceToSquared(e[r]));
  40330. return this.radius = Math.sqrt(n),
  40331. this
  40332. }
  40333. ),
  40334. clone: function() {
  40335. return (new this.constructor).copy(this)
  40336. },
  40337. copy: function(e) {
  40338. return this.center.copy(e.center),
  40339. this.radius = e.radius,
  40340. this
  40341. },
  40342. empty: function() {
  40343. return this.radius <= 0
  40344. },
  40345. containsPoint: function(e) {
  40346. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40347. },
  40348. distanceToPoint: function(e) {
  40349. return e.distanceTo(this.center) - this.radius
  40350. },
  40351. intersectsSphere: function(e) {
  40352. var t = this.radius + e.radius;
  40353. return e.center.distanceToSquared(this.center) <= t * t
  40354. },
  40355. intersectsBox: function(e) {
  40356. return e.intersectsSphere(this)
  40357. },
  40358. intersectsPlane: function(e) {
  40359. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40360. },
  40361. clampPoint: function(e, t) {
  40362. var i = this.center.distanceToSquared(e)
  40363. , n = t || new Ci.Vector3;
  40364. return n.copy(e),
  40365. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40366. n.multiplyScalar(this.radius).add(this.center)),
  40367. n
  40368. },
  40369. getBoundingBox: function(e) {
  40370. var t = e || new Ci.Box3;
  40371. return t.set(this.center, this.center),
  40372. t.expandByScalar(this.radius),
  40373. t
  40374. },
  40375. applyMatrix4: function(e) {
  40376. return this.center.applyMatrix4(e),
  40377. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40378. this
  40379. },
  40380. translate: function(e) {
  40381. return this.center.add(e),
  40382. this
  40383. },
  40384. equals: function(e) {
  40385. return e.center.equals(this.center) && e.radius === this.radius
  40386. }
  40387. },
  40388. Ci.Frustum = function(e, t, i, n, r, o) {
  40389. 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]
  40390. }
  40391. ,
  40392. Ci.Frustum.prototype = {
  40393. constructor: Ci.Frustum,
  40394. set: function(e, t, i, n, r, o) {
  40395. var a = this.planes;
  40396. return a[0].copy(e),
  40397. a[1].copy(t),
  40398. a[2].copy(i),
  40399. a[3].copy(n),
  40400. a[4].copy(r),
  40401. a[5].copy(o),
  40402. this
  40403. },
  40404. clone: function() {
  40405. return (new this.constructor).copy(this)
  40406. },
  40407. copy: function(e) {
  40408. for (var t = this.planes, i = 0; i < 6; i++)
  40409. t[i].copy(e.planes[i]);
  40410. return this
  40411. },
  40412. setFromMatrix: function(e) {
  40413. var t = this.planes
  40414. , i = e.elements
  40415. , n = i[0]
  40416. , r = i[1]
  40417. , o = i[2]
  40418. , a = i[3]
  40419. , s = i[4]
  40420. , l = i[5]
  40421. , c = i[6]
  40422. , h = i[7]
  40423. , u = i[8]
  40424. , d = i[9]
  40425. , p = i[10]
  40426. , f = i[11]
  40427. , g = i[12]
  40428. , m = i[13]
  40429. , v = i[14]
  40430. , y = i[15];
  40431. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40432. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40433. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40434. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40435. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40436. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40437. this
  40438. },
  40439. intersectsObject: (H = new Ci.Sphere,
  40440. function(e) {
  40441. var t = e.geometry;
  40442. return null === t.boundingSphere && t.computeBoundingSphere(),
  40443. H.copy(t.boundingSphere),
  40444. H.applyMatrix4(e.matrixWorld),
  40445. this.intersectsSphere(H)
  40446. }
  40447. ),
  40448. intersectsSphere: function(e) {
  40449. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40450. if (t[r].distanceToPoint(i) < n)
  40451. return !1
  40452. }
  40453. return !0
  40454. },
  40455. intersectsBox: (k = new Ci.Vector3,
  40456. U = new Ci.Vector3,
  40457. function(e) {
  40458. for (var t = this.planes, i = 0; i < 6; i++) {
  40459. var n = t[i];
  40460. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40461. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40462. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40463. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40464. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40465. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40466. var r = n.distanceToPoint(k)
  40467. , o = n.distanceToPoint(U);
  40468. if (r < 0 && o < 0)
  40469. return !1
  40470. }
  40471. return !0
  40472. }
  40473. ),
  40474. containsPoint: function(e) {
  40475. for (var t = this.planes, i = 0; i < 6; i++)
  40476. if (t[i].distanceToPoint(e) < 0)
  40477. return !1;
  40478. return !0
  40479. }
  40480. },
  40481. Ci.Plane = function(e, t) {
  40482. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40483. this.constant = void 0 !== t ? t : 0
  40484. }
  40485. ,
  40486. Ci.Plane.prototype = {
  40487. constructor: Ci.Plane,
  40488. set: function(e, t) {
  40489. return this.normal.copy(e),
  40490. this.constant = t,
  40491. this
  40492. },
  40493. setComponents: function(e, t, i, n) {
  40494. return this.normal.set(e, t, i),
  40495. this.constant = n,
  40496. this
  40497. },
  40498. setFromNormalAndCoplanarPoint: function(e, t) {
  40499. return this.normal.copy(e),
  40500. this.constant = -t.dot(this.normal),
  40501. this
  40502. },
  40503. setFromCoplanarPoints: (B = new Ci.Vector3,
  40504. V = new Ci.Vector3,
  40505. function(e, t, i) {
  40506. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40507. return this.setFromNormalAndCoplanarPoint(n, e),
  40508. this
  40509. }
  40510. ),
  40511. clone: function() {
  40512. return (new this.constructor).copy(this)
  40513. },
  40514. copy: function(e) {
  40515. return this.normal.copy(e.normal),
  40516. this.constant = e.constant,
  40517. this
  40518. },
  40519. normalize: function() {
  40520. var e = 1 / this.normal.length();
  40521. return this.normal.multiplyScalar(e),
  40522. this.constant *= e,
  40523. this
  40524. },
  40525. negate: function() {
  40526. return this.constant *= -1,
  40527. this.normal.negate(),
  40528. this
  40529. },
  40530. distanceToPoint: function(e) {
  40531. return this.normal.dot(e) + this.constant
  40532. },
  40533. distanceToSphere: function(e) {
  40534. return this.distanceToPoint(e.center) - e.radius
  40535. },
  40536. projectPoint: function(e, t) {
  40537. return this.orthoPoint(e, t).sub(e).negate()
  40538. },
  40539. orthoPoint: function(e, t) {
  40540. var i = this.distanceToPoint(e);
  40541. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40542. },
  40543. intersectLine: (F = new Ci.Vector3,
  40544. function(e, t) {
  40545. var i = t || new Ci.Vector3
  40546. , n = e.delta(F)
  40547. , r = this.normal.dot(n);
  40548. if (0 !== r) {
  40549. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40550. if (!(o < 0 || 1 < o))
  40551. return i.copy(n).multiplyScalar(o).add(e.start)
  40552. } else if (0 === this.distanceToPoint(e.start))
  40553. return i.copy(e.start)
  40554. }
  40555. ),
  40556. intersectsLine: function(e) {
  40557. var t = this.distanceToPoint(e.start)
  40558. , i = this.distanceToPoint(e.end);
  40559. return t < 0 && 0 < i || i < 0 && 0 < t
  40560. },
  40561. intersectsBox: function(e) {
  40562. return e.intersectsPlane(this)
  40563. },
  40564. intersectsSphere: function(e) {
  40565. return e.intersectsPlane(this)
  40566. },
  40567. coplanarPoint: function(e) {
  40568. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40569. },
  40570. applyMatrix4: (L = new Ci.Vector3,
  40571. D = new Ci.Vector3,
  40572. N = new Ci.Matrix3,
  40573. function(e, t) {
  40574. var i = t || N.getNormalMatrix(e)
  40575. , n = L.copy(this.normal).applyMatrix3(i)
  40576. , r = this.coplanarPoint(D);
  40577. return r.applyMatrix4(e),
  40578. this.setFromNormalAndCoplanarPoint(n, r),
  40579. this
  40580. }
  40581. ),
  40582. translate: function(e) {
  40583. return this.constant = this.constant - e.dot(this.normal),
  40584. this
  40585. },
  40586. equals: function(e) {
  40587. return e.normal.equals(this.normal) && e.constant === this.constant
  40588. }
  40589. },
  40590. Ci.Spherical = function(e, t, i) {
  40591. return this.radius = void 0 !== e ? e : 1,
  40592. this.phi = void 0 !== t ? t : 0,
  40593. this.theta = void 0 !== i ? i : 0,
  40594. this
  40595. }
  40596. ,
  40597. Ci.Spherical.prototype = {
  40598. constructor: Ci.Spherical,
  40599. set: function(e, t, i) {
  40600. this.radius = e,
  40601. this.phi = t,
  40602. this.theta = i
  40603. },
  40604. clone: function() {
  40605. return (new this.constructor).copy(this)
  40606. },
  40607. copy: function(e) {
  40608. return this.radius.copy(e.radius),
  40609. this.phi.copy(e.phi),
  40610. this.theta.copy(e.theta),
  40611. this
  40612. },
  40613. makeSafe: function() {
  40614. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40615. },
  40616. setFromVector3: function(e) {
  40617. return this.radius = e.length(),
  40618. 0 === this.radius ? (this.theta = 0,
  40619. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40620. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40621. this
  40622. }
  40623. },
  40624. Ci.Math = {
  40625. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40626. P = new Array(36),
  40627. O = 0,
  40628. function() {
  40629. for (var e = 0; e < 36; e++)
  40630. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40631. M = 15 & O,
  40632. O >>= 4,
  40633. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40634. return P.join("")
  40635. }
  40636. ),
  40637. clamp: function(e, t, i) {
  40638. return Math.max(t, Math.min(i, e))
  40639. },
  40640. euclideanModulo: function(e, t) {
  40641. return (e % t + t) % t
  40642. },
  40643. mapLinear: function(e, t, i, n, r) {
  40644. return n + (e - t) * (r - n) / (i - t)
  40645. },
  40646. smoothstep: function(e, t, i) {
  40647. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40648. },
  40649. smootherstep: function(e, t, i) {
  40650. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40651. },
  40652. random16: function() {
  40653. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40654. Math.random()
  40655. },
  40656. randInt: function(e, t) {
  40657. return e + Math.floor(Math.random() * (t - e + 1))
  40658. },
  40659. randFloat: function(e, t) {
  40660. return e + Math.random() * (t - e)
  40661. },
  40662. randFloatSpread: function(e) {
  40663. return e * (.5 - Math.random())
  40664. },
  40665. degToRad: (S = Math.PI / 180,
  40666. function(e) {
  40667. return e * S
  40668. }
  40669. ),
  40670. radToDeg: (x = 180 / Math.PI,
  40671. function(e) {
  40672. return e * x
  40673. }
  40674. ),
  40675. isPowerOfTwo: function(e) {
  40676. return 0 == (e & e - 1) && 0 !== e
  40677. },
  40678. nearestPowerOfTwo: function(e) {
  40679. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40680. },
  40681. nextPowerOfTwo: function(e) {
  40682. return e--,
  40683. e |= e >> 1,
  40684. e |= e >> 2,
  40685. e |= e >> 4,
  40686. e |= e >> 8,
  40687. e |= e >> 16,
  40688. ++e
  40689. }
  40690. },
  40691. Ci.Spline = function(e) {
  40692. function t(e, t, i, n, r, o, a) {
  40693. var s = .5 * (i - e)
  40694. , l = .5 * (n - t);
  40695. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40696. }
  40697. this.points = e;
  40698. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40699. x: 0,
  40700. y: 0,
  40701. z: 0
  40702. };
  40703. this.initFromArray = function(e) {
  40704. this.points = [];
  40705. for (var t = 0; t < e.length; t++)
  40706. this.points[t] = {
  40707. x: e[t][0],
  40708. y: e[t][1],
  40709. z: e[t][2]
  40710. }
  40711. }
  40712. ,
  40713. this.getPoint = function(e) {
  40714. return i = (this.points.length - 1) * e,
  40715. n = Math.floor(i),
  40716. r = i - n,
  40717. u[0] = 0 === n ? n : n - 1,
  40718. u[1] = n,
  40719. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40720. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40721. s = this.points[u[0]],
  40722. l = this.points[u[1]],
  40723. c = this.points[u[2]],
  40724. h = this.points[u[3]],
  40725. a = r * (o = r * r),
  40726. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40727. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40728. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40729. d
  40730. }
  40731. ,
  40732. this.getControlPointsArray = function() {
  40733. var e, t, i = this.points.length, n = [];
  40734. for (e = 0; e < i; e++)
  40735. t = this.points[e],
  40736. n[e] = [t.x, t.y, t.z];
  40737. return n
  40738. }
  40739. ,
  40740. this.getLength = function(e) {
  40741. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40742. for (h[0] = 0,
  40743. e = e || 100,
  40744. n = this.points.length * e,
  40745. l.copy(this.points[0]),
  40746. t = 1; t < n; t++)
  40747. i = t / n,
  40748. r = this.getPoint(i),
  40749. c.copy(r),
  40750. u += c.distanceTo(l),
  40751. l.copy(r),
  40752. o = (this.points.length - 1) * i,
  40753. (a = Math.floor(o)) !== s && (h[a] = u,
  40754. s = a);
  40755. return h[h.length] = u,
  40756. {
  40757. chunks: h,
  40758. total: u
  40759. }
  40760. }
  40761. ,
  40762. this.reparametrizeByArcLength = function(e) {
  40763. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40764. for (c.push(h.copy(this.points[0]).clone()),
  40765. t = 1; t < this.points.length; t++) {
  40766. for (a = u.chunks[t] - u.chunks[t - 1],
  40767. s = Math.ceil(e * a / u.total),
  40768. r = (t - 1) / (this.points.length - 1),
  40769. o = t / (this.points.length - 1),
  40770. i = 1; i < s - 1; i++)
  40771. n = r + i * (1 / s) * (o - r),
  40772. l = this.getPoint(n),
  40773. c.push(h.copy(l).clone());
  40774. c.push(h.copy(this.points[t]).clone())
  40775. }
  40776. this.points = c
  40777. }
  40778. }
  40779. ,
  40780. Ci.Triangle = function(e, t, i) {
  40781. this.a = void 0 !== e ? e : new Ci.Vector3,
  40782. this.b = void 0 !== t ? t : new Ci.Vector3,
  40783. this.c = void 0 !== i ? i : new Ci.Vector3
  40784. }
  40785. ,
  40786. Ci.Triangle.normal = (T = new Ci.Vector3,
  40787. function(e, t, i, n) {
  40788. var r = n || new Ci.Vector3;
  40789. r.subVectors(i, t),
  40790. T.subVectors(e, t),
  40791. r.cross(T);
  40792. var o = r.lengthSq();
  40793. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40794. }
  40795. ),
  40796. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40797. b = new Ci.Vector3,
  40798. w = new Ci.Vector3,
  40799. function(e, t, i, n, r) {
  40800. _.subVectors(n, t),
  40801. b.subVectors(i, t),
  40802. w.subVectors(e, t);
  40803. var o = _.dot(_)
  40804. , a = _.dot(b)
  40805. , s = _.dot(w)
  40806. , l = b.dot(b)
  40807. , c = b.dot(w)
  40808. , h = o * l - a * a
  40809. , u = r || new Ci.Vector3;
  40810. if (0 == h)
  40811. return u.set(-2, -1, -1);
  40812. var d = 1 / h
  40813. , p = (l * s - a * c) * d
  40814. , f = (o * c - a * s) * d;
  40815. return u.set(1 - p - f, f, p)
  40816. }
  40817. ),
  40818. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40819. function(e, t, i, n) {
  40820. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40821. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40822. }
  40823. ),
  40824. Ci.Triangle.prototype = {
  40825. constructor: Ci.Triangle,
  40826. set: function(e, t, i) {
  40827. return this.a.copy(e),
  40828. this.b.copy(t),
  40829. this.c.copy(i),
  40830. this
  40831. },
  40832. setFromPointsAndIndices: function(e, t, i, n) {
  40833. return this.a.copy(e[t]),
  40834. this.b.copy(e[i]),
  40835. this.c.copy(e[n]),
  40836. this
  40837. },
  40838. clone: function() {
  40839. return (new this.constructor).copy(this)
  40840. },
  40841. copy: function(e) {
  40842. return this.a.copy(e.a),
  40843. this.b.copy(e.b),
  40844. this.c.copy(e.c),
  40845. this
  40846. },
  40847. area: (C = new Ci.Vector3,
  40848. I = new Ci.Vector3,
  40849. function() {
  40850. return C.subVectors(this.c, this.b),
  40851. I.subVectors(this.a, this.b),
  40852. .5 * C.cross(I).length()
  40853. }
  40854. ),
  40855. midpoint: function(e) {
  40856. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40857. },
  40858. normal: function(e) {
  40859. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40860. },
  40861. plane: function(e) {
  40862. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40863. },
  40864. barycoordFromPoint: function(e, t) {
  40865. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40866. },
  40867. containsPoint: function(e) {
  40868. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40869. },
  40870. equals: function(e) {
  40871. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40872. }
  40873. },
  40874. Ci.Interpolant = function(e, t, i, n) {
  40875. this.parameterPositions = e,
  40876. this._cachedIndex = 0,
  40877. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40878. this.sampleValues = t,
  40879. this.valueSize = i
  40880. }
  40881. ,
  40882. Ci.Interpolant.prototype = {
  40883. constructor: Ci.Interpolant,
  40884. evaluate: function(e) {
  40885. var t = this.parameterPositions
  40886. , i = this._cachedIndex
  40887. , n = t[i]
  40888. , r = t[i - 1];
  40889. e: {
  40890. t: {
  40891. var o;
  40892. i: {
  40893. n: if (!(e < n)) {
  40894. for (var a = i + 2; ; ) {
  40895. if (void 0 === n) {
  40896. if (e < r)
  40897. break n;
  40898. return i = t.length,
  40899. this._cachedIndex = i,
  40900. this.afterEnd_(i - 1, e, r)
  40901. }
  40902. if (i === a)
  40903. break;
  40904. if (r = n,
  40905. e < (n = t[++i]))
  40906. break t
  40907. }
  40908. o = t.length;
  40909. break i
  40910. }
  40911. if (r <= e)
  40912. break e;
  40913. var s = t[1];
  40914. e < s && (i = 2,
  40915. r = s);
  40916. for (a = i - 2; ; ) {
  40917. if (void 0 === r)
  40918. return this._cachedIndex = 0,
  40919. this.beforeStart_(0, e, n);
  40920. if (i === a)
  40921. break;
  40922. if (n = r,
  40923. (r = t[--i - 1]) <= e)
  40924. break t
  40925. }
  40926. o = i,
  40927. i = 0
  40928. }
  40929. for (; i < o; ) {
  40930. var l = i + o >>> 1;
  40931. e < t[l] ? o = l : i = 1 + l
  40932. }
  40933. if (n = t[i],
  40934. void 0 === (r = t[i - 1]))
  40935. return this._cachedIndex = 0,
  40936. this.beforeStart_(0, e, n);
  40937. if (void 0 === n)
  40938. return i = t.length,
  40939. this._cachedIndex = i,
  40940. this.afterEnd_(i - 1, r, e)
  40941. }
  40942. this._cachedIndex = i,
  40943. this.intervalChanged_(i, r, n)
  40944. }
  40945. return this.interpolate_(i, r, e, n)
  40946. },
  40947. settings: null,
  40948. DefaultSettings_: {},
  40949. getSettings_: function() {
  40950. return this.settings || this.DefaultSettings_
  40951. },
  40952. copySampleValue_: function(e) {
  40953. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40954. t[o] = i[r + o];
  40955. return t
  40956. },
  40957. interpolate_: function(e, t, i, n) {
  40958. throw new Error("call to abstract method")
  40959. },
  40960. intervalChanged_: function(e, t, i) {}
  40961. },
  40962. Object.assign(Ci.Interpolant.prototype, {
  40963. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40964. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40965. }),
  40966. Ci.CubicInterpolant = function(e, t, i, n) {
  40967. Ci.Interpolant.call(this, e, t, i, n),
  40968. this._weightPrev = -0,
  40969. this._offsetPrev = -0,
  40970. this._weightNext = -0,
  40971. this._offsetNext = -0
  40972. }
  40973. ,
  40974. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40975. constructor: Ci.CubicInterpolant,
  40976. DefaultSettings_: {
  40977. endingStart: Ci.ZeroCurvatureEnding,
  40978. endingEnd: Ci.ZeroCurvatureEnding
  40979. },
  40980. intervalChanged_: function(e, t, i) {
  40981. var n = this.parameterPositions
  40982. , r = e - 2
  40983. , o = e + 1
  40984. , a = n[r]
  40985. , s = n[o];
  40986. if (void 0 === a)
  40987. switch (this.getSettings_().endingStart) {
  40988. case Ci.ZeroSlopeEnding:
  40989. r = e,
  40990. a = 2 * t - i;
  40991. break;
  40992. case Ci.WrapAroundEnding:
  40993. a = t + n[r = n.length - 2] - n[r + 1];
  40994. break;
  40995. default:
  40996. r = e,
  40997. a = i
  40998. }
  40999. if (void 0 === s)
  41000. switch (this.getSettings_().endingEnd) {
  41001. case Ci.ZeroSlopeEnding:
  41002. o = e,
  41003. s = 2 * i - t;
  41004. break;
  41005. case Ci.WrapAroundEnding:
  41006. s = i + n[o = 1] - n[0];
  41007. break;
  41008. default:
  41009. o = e - 1,
  41010. s = t
  41011. }
  41012. var l = .5 * (i - t)
  41013. , c = this.valueSize;
  41014. this._weightPrev = l / (t - a),
  41015. this._weightNext = l / (s - i),
  41016. this._offsetPrev = r * c,
  41017. this._offsetNext = o * c
  41018. },
  41019. interpolate_: function(e, t, i, n) {
  41020. 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)
  41021. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41022. return r
  41023. }
  41024. }),
  41025. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41026. Ci.Interpolant.call(this, e, t, i, n)
  41027. }
  41028. ,
  41029. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41030. constructor: Ci.DiscreteInterpolant,
  41031. interpolate_: function(e, t, i, n) {
  41032. return this.copySampleValue_(e - 1)
  41033. }
  41034. }),
  41035. Ci.LinearInterpolant = function(e, t, i, n) {
  41036. Ci.Interpolant.call(this, e, t, i, n)
  41037. }
  41038. ,
  41039. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41040. constructor: Ci.LinearInterpolant,
  41041. interpolate_: function(e, t, i, n) {
  41042. 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)
  41043. r[u] = o[l + u] * h + o[s + u] * c;
  41044. return r
  41045. }
  41046. }),
  41047. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41048. Ci.Interpolant.call(this, e, t, i, n)
  41049. }
  41050. ,
  41051. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41052. constructor: Ci.QuaternionLinearInterpolant,
  41053. interpolate_: function(e, t, i, n) {
  41054. 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)
  41055. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41056. return r
  41057. }
  41058. }),
  41059. Ci.Clock = function(e) {
  41060. this.autoStart = void 0 === e || e,
  41061. this.startTime = 0,
  41062. this.oldTime = 0,
  41063. this.elapsedTime = 0,
  41064. this.running = !1
  41065. }
  41066. ,
  41067. Ci.Clock.prototype = {
  41068. constructor: Ci.Clock,
  41069. start: function() {
  41070. this.startTime = performance.now(),
  41071. this.oldTime = this.startTime,
  41072. this.running = !0
  41073. },
  41074. stop: function() {
  41075. this.getElapsedTime(),
  41076. this.running = !1
  41077. },
  41078. getElapsedTime: function() {
  41079. return this.getDelta(),
  41080. this.elapsedTime
  41081. },
  41082. getDelta: function() {
  41083. var e = 0;
  41084. if (this.autoStart && !this.running && this.start(),
  41085. this.running) {
  41086. var t = performance.now();
  41087. e = .001 * (t - this.oldTime),
  41088. this.oldTime = t,
  41089. this.elapsedTime += e
  41090. }
  41091. return e
  41092. }
  41093. },
  41094. Ci.EventDispatcher = function() {}
  41095. ,
  41096. Ci.EventDispatcher.prototype = {
  41097. constructor: Ci.EventDispatcher,
  41098. apply: function(e) {
  41099. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41100. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41101. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41102. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41103. },
  41104. addEventListener: function(e, t) {
  41105. void 0 === this._listeners && (this._listeners = {});
  41106. var i = this._listeners;
  41107. void 0 === i[e] && (i[e] = []),
  41108. -1 === i[e].indexOf(t) && i[e].push(t)
  41109. },
  41110. hasEventListener: function(e, t) {
  41111. if (void 0 === this._listeners)
  41112. return !1;
  41113. var i = this._listeners;
  41114. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41115. },
  41116. removeEventListener: function(e, t) {
  41117. if (void 0 !== this._listeners) {
  41118. var i = this._listeners[e];
  41119. if (void 0 !== i) {
  41120. var n = i.indexOf(t);
  41121. -1 !== n && i.splice(n, 1)
  41122. }
  41123. }
  41124. },
  41125. dispatchEvent: function(e) {
  41126. if (void 0 !== this._listeners) {
  41127. var t = this._listeners[e.type];
  41128. if (void 0 !== t) {
  41129. e.target = this;
  41130. for (var i = [], n = t.length, r = 0; r < n; r++)
  41131. i[r] = t[r];
  41132. for (r = 0; r < n; r++)
  41133. i[r].call(this, e)
  41134. }
  41135. }
  41136. }
  41137. },
  41138. Ci.Layers = function() {
  41139. this.mask = 1
  41140. }
  41141. ,
  41142. Ci.Layers.prototype = {
  41143. constructor: Ci.Layers,
  41144. set: function(e) {
  41145. this.mask = 1 << e
  41146. },
  41147. enable: function(e) {
  41148. this.mask |= 1 << e
  41149. },
  41150. toggle: function(e) {
  41151. this.mask ^= 1 << e
  41152. },
  41153. disable: function(e) {
  41154. this.mask &= ~(1 << e)
  41155. },
  41156. test: function(e) {
  41157. return 0 != (this.mask & e.mask)
  41158. }
  41159. },
  41160. (A = Ci).Raycaster = function(e, t, i, n) {
  41161. this.ray = new A.Ray(e,t),
  41162. this.near = i || 0,
  41163. this.far = n || 1 / 0,
  41164. this.params = {
  41165. Mesh: {},
  41166. Line: {},
  41167. LOD: {},
  41168. Points: {
  41169. threshold: 1
  41170. },
  41171. Sprite: {}
  41172. },
  41173. Object.defineProperties(this.params, {
  41174. PointCloud: {
  41175. get: function() {
  41176. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41177. this.Points
  41178. }
  41179. }
  41180. })
  41181. }
  41182. ,
  41183. A.Raycaster.prototype = {
  41184. constructor: A.Raycaster,
  41185. linePrecision: 1,
  41186. set: function(e, t) {
  41187. this.ray.set(e, t)
  41188. },
  41189. setFromCamera: function(e, t) {
  41190. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41191. 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),
  41192. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41193. },
  41194. intersectObject: function(e, t) {
  41195. var i = [];
  41196. return Ei(e, this, i, t),
  41197. i.sort(Ii),
  41198. i
  41199. },
  41200. intersectObjects: function(e, t) {
  41201. var i = [];
  41202. if (!1 === Array.isArray(e))
  41203. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41204. i;
  41205. for (var n = 0, r = e.length; n < r; n++)
  41206. Ei(e[n], this, i, t);
  41207. return i.sort(Ii),
  41208. i
  41209. }
  41210. },
  41211. Ci.Object3D = function() {
  41212. Object.defineProperty(this, "id", {
  41213. value: Ci.Object3DIdCount++
  41214. }),
  41215. this.uuid = Ci.Math.generateUUID(),
  41216. this.name = "",
  41217. this.type = "Object3D",
  41218. this.parent = null,
  41219. this.children = [],
  41220. this.up = Ci.Object3D.DefaultUp.clone();
  41221. var e = new Ci.Vector3
  41222. , t = new Ci.Euler
  41223. , i = new Ci.Quaternion
  41224. , n = new Ci.Vector3(1,1,1);
  41225. t.onChange(function() {
  41226. i.setFromEuler(t, !1)
  41227. }),
  41228. i.onChange(function() {
  41229. t.setFromQuaternion(i, void 0, !1)
  41230. }),
  41231. Object.defineProperties(this, {
  41232. position: {
  41233. enumerable: !0,
  41234. value: e
  41235. },
  41236. rotation: {
  41237. enumerable: !0,
  41238. value: t
  41239. },
  41240. quaternion: {
  41241. enumerable: !0,
  41242. value: i
  41243. },
  41244. scale: {
  41245. enumerable: !0,
  41246. value: n
  41247. },
  41248. modelViewMatrix: {
  41249. value: new Ci.Matrix4
  41250. },
  41251. normalMatrix: {
  41252. value: new Ci.Matrix3
  41253. }
  41254. }),
  41255. this.rotationAutoUpdate = !0,
  41256. this.matrix = new Ci.Matrix4,
  41257. this.matrixWorld = new Ci.Matrix4,
  41258. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41259. this.matrixWorldNeedsUpdate = !1,
  41260. this.layers = new Ci.Layers,
  41261. this.visible = !0,
  41262. this.castShadow = !1,
  41263. this.receiveShadow = !1,
  41264. this.frustumCulled = !0,
  41265. this.renderOrder = 0,
  41266. this.userData = {}
  41267. }
  41268. ,
  41269. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41270. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41271. Ci.Object3D.prototype = {
  41272. constructor: Ci.Object3D,
  41273. applyMatrix: function(e) {
  41274. this.matrix.multiplyMatrices(e, this.matrix),
  41275. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41276. },
  41277. setRotationFromAxisAngle: function(e, t) {
  41278. this.quaternion.setFromAxisAngle(e, t)
  41279. },
  41280. setRotationFromEuler: function(e) {
  41281. this.quaternion.setFromEuler(e, !0)
  41282. },
  41283. setRotationFromMatrix: function(e) {
  41284. this.quaternion.setFromRotationMatrix(e)
  41285. },
  41286. setRotationFromQuaternion: function(e) {
  41287. this.quaternion.copy(e)
  41288. },
  41289. rotateOnAxis: (y = new Ci.Quaternion,
  41290. function(e, t) {
  41291. return y.setFromAxisAngle(e, t),
  41292. this.quaternion.multiply(y),
  41293. this
  41294. }
  41295. ),
  41296. rotateX: (v = new Ci.Vector3(1,0,0),
  41297. function(e) {
  41298. return this.rotateOnAxis(v, e)
  41299. }
  41300. ),
  41301. rotateY: (m = new Ci.Vector3(0,1,0),
  41302. function(e) {
  41303. return this.rotateOnAxis(m, e)
  41304. }
  41305. ),
  41306. rotateZ: (g = new Ci.Vector3(0,0,1),
  41307. function(e) {
  41308. return this.rotateOnAxis(g, e)
  41309. }
  41310. ),
  41311. translateOnAxis: (f = new Ci.Vector3,
  41312. function(e, t) {
  41313. return f.copy(e).applyQuaternion(this.quaternion),
  41314. this.position.add(f.multiplyScalar(t)),
  41315. this
  41316. }
  41317. ),
  41318. translateX: (p = new Ci.Vector3(1,0,0),
  41319. function(e) {
  41320. return this.translateOnAxis(p, e)
  41321. }
  41322. ),
  41323. translateY: (d = new Ci.Vector3(0,1,0),
  41324. function(e) {
  41325. return this.translateOnAxis(d, e)
  41326. }
  41327. ),
  41328. translateZ: (u = new Ci.Vector3(0,0,1),
  41329. function(e) {
  41330. return this.translateOnAxis(u, e)
  41331. }
  41332. ),
  41333. localToWorld: function(e) {
  41334. return e.applyMatrix4(this.matrixWorld)
  41335. },
  41336. worldToLocal: (h = new Ci.Matrix4,
  41337. function(e) {
  41338. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41339. }
  41340. ),
  41341. lookAt: (c = new Ci.Matrix4,
  41342. function(e) {
  41343. c.lookAt(e, this.position, this.up),
  41344. this.quaternion.setFromRotationMatrix(c)
  41345. }
  41346. ),
  41347. add: function(e) {
  41348. if (1 < arguments.length) {
  41349. for (var t = 0; t < arguments.length; t++)
  41350. this.add(arguments[t]);
  41351. return this
  41352. }
  41353. 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),
  41354. e.parent = this,
  41355. e.dispatchEvent({
  41356. type: "added"
  41357. }),
  41358. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41359. this
  41360. },
  41361. remove: function(e) {
  41362. if (1 < arguments.length)
  41363. for (var t = 0; t < arguments.length; t++)
  41364. this.remove(arguments[t]);
  41365. var i = this.children.indexOf(e);
  41366. -1 !== i && (e.parent = null,
  41367. e.dispatchEvent({
  41368. type: "removed"
  41369. }),
  41370. this.children.splice(i, 1))
  41371. },
  41372. getObjectById: function(e) {
  41373. return this.getObjectByProperty("id", e)
  41374. },
  41375. getObjectByName: function(e) {
  41376. return this.getObjectByProperty("name", e)
  41377. },
  41378. getObjectByProperty: function(e, t) {
  41379. if (this[e] === t)
  41380. return this;
  41381. for (var i = 0, n = this.children.length; i < n; i++) {
  41382. var r = this.children[i].getObjectByProperty(e, t);
  41383. if (void 0 !== r)
  41384. return r
  41385. }
  41386. },
  41387. getWorldPosition: function(e) {
  41388. var t = e || new Ci.Vector3;
  41389. return this.updateMatrixWorld(!0),
  41390. t.setFromMatrixPosition(this.matrixWorld)
  41391. },
  41392. getWorldQuaternion: (s = new Ci.Vector3,
  41393. l = new Ci.Vector3,
  41394. function(e) {
  41395. var t = e || new Ci.Quaternion;
  41396. return this.updateMatrixWorld(!0),
  41397. this.matrixWorld.decompose(s, t, l),
  41398. t
  41399. }
  41400. ),
  41401. getWorldRotation: (a = new Ci.Quaternion,
  41402. function(e) {
  41403. var t = e || new Ci.Euler;
  41404. return this.getWorldQuaternion(a),
  41405. t.setFromQuaternion(a, this.rotation.order, !1)
  41406. }
  41407. ),
  41408. getWorldScale: (r = new Ci.Vector3,
  41409. o = new Ci.Quaternion,
  41410. function(e) {
  41411. var t = e || new Ci.Vector3;
  41412. return this.updateMatrixWorld(!0),
  41413. this.matrixWorld.decompose(r, o, t),
  41414. t
  41415. }
  41416. ),
  41417. getWorldDirection: (n = new Ci.Quaternion,
  41418. function(e) {
  41419. var t = e || new Ci.Vector3;
  41420. return this.getWorldQuaternion(n),
  41421. t.set(0, 0, 1).applyQuaternion(n)
  41422. }
  41423. ),
  41424. raycast: function() {},
  41425. traverse: function(e) {
  41426. e(this);
  41427. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41428. t[i].traverse(e)
  41429. },
  41430. traverseVisible: function(e) {
  41431. if (!1 !== this.visible) {
  41432. e(this);
  41433. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41434. t[i].traverseVisible(e)
  41435. }
  41436. },
  41437. traverseAncestors: function(e) {
  41438. var t = this.parent;
  41439. null !== t && (e(t),
  41440. t.traverseAncestors(e))
  41441. },
  41442. updateMatrix: function() {
  41443. this.matrix.compose(this.position, this.quaternion, this.scale),
  41444. this.matrixWorldNeedsUpdate = !0
  41445. },
  41446. updateMatrixWorld: function(e) {
  41447. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41448. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41449. e = !(this.matrixWorldNeedsUpdate = !1));
  41450. for (var t = 0, i = this.children.length; t < i; t++)
  41451. this.children[t].updateMatrixWorld(e)
  41452. },
  41453. toJSON: function(e) {
  41454. function t(e) {
  41455. var t = [];
  41456. for (var i in e) {
  41457. var n = e[i];
  41458. delete n.metadata,
  41459. t.push(n)
  41460. }
  41461. return t
  41462. }
  41463. var i = void 0 === e
  41464. , n = {};
  41465. i && (e = {
  41466. geometries: {},
  41467. materials: {},
  41468. textures: {},
  41469. images: {}
  41470. },
  41471. n.metadata = {
  41472. version: 4.4,
  41473. type: "Object",
  41474. generator: "Object3D.toJSON"
  41475. });
  41476. var r = {};
  41477. if (r.uuid = this.uuid,
  41478. r.type = this.type,
  41479. "" !== this.name && (r.name = this.name),
  41480. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41481. !0 === this.castShadow && (r.castShadow = !0),
  41482. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41483. !1 === this.visible && (r.visible = !1),
  41484. r.matrix = this.matrix.toArray(),
  41485. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41486. r.geometry = this.geometry.uuid),
  41487. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41488. r.material = this.material.uuid),
  41489. 0 < this.children.length) {
  41490. r.children = [];
  41491. for (var o = 0; o < this.children.length; o++)
  41492. r.children.push(this.children[o].toJSON(e).object)
  41493. }
  41494. if (i) {
  41495. var a = t(e.geometries)
  41496. , s = t(e.materials)
  41497. , l = t(e.textures)
  41498. , c = t(e.images);
  41499. 0 < a.length && (n.geometries = a),
  41500. 0 < s.length && (n.materials = s),
  41501. 0 < l.length && (n.textures = l),
  41502. 0 < c.length && (n.images = c)
  41503. }
  41504. return n.object = r,
  41505. n
  41506. },
  41507. clone: function(e) {
  41508. return (new this.constructor).copy(this, e)
  41509. },
  41510. copy: function(e, t) {
  41511. if (void 0 === t && (t = !0),
  41512. this.name = e.name,
  41513. this.up.copy(e.up),
  41514. this.position.copy(e.position),
  41515. this.quaternion.copy(e.quaternion),
  41516. this.scale.copy(e.scale),
  41517. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41518. this.matrix.copy(e.matrix),
  41519. this.matrixWorld.copy(e.matrixWorld),
  41520. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41521. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41522. this.visible = e.visible,
  41523. this.castShadow = e.castShadow,
  41524. this.receiveShadow = e.receiveShadow,
  41525. this.frustumCulled = e.frustumCulled,
  41526. this.renderOrder = e.renderOrder,
  41527. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41528. !0 === t)
  41529. for (var i = 0; i < e.children.length; i++) {
  41530. var n = e.children[i];
  41531. this.add(n.clone())
  41532. }
  41533. return this
  41534. }
  41535. },
  41536. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41537. Ci.Object3DIdCount = 0,
  41538. Ci.Face3 = function(e, t, i, n, r, o) {
  41539. this.a = e,
  41540. this.b = t,
  41541. this.c = i,
  41542. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41543. this.vertexNormals = Array.isArray(n) ? n : [],
  41544. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41545. this.vertexColors = Array.isArray(r) ? r : [],
  41546. this.materialIndex = void 0 !== o ? o : 0
  41547. }
  41548. ,
  41549. Ci.Face3.prototype = {
  41550. constructor: Ci.Face3,
  41551. clone: function() {
  41552. return (new this.constructor).copy(this)
  41553. },
  41554. copy: function(e) {
  41555. this.a = e.a,
  41556. this.b = e.b,
  41557. this.c = e.c,
  41558. this.normal.copy(e.normal),
  41559. this.color.copy(e.color),
  41560. this.materialIndex = e.materialIndex;
  41561. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41562. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41563. for (t = 0,
  41564. i = e.vertexColors.length; t < i; t++)
  41565. this.vertexColors[t] = e.vertexColors[t].clone();
  41566. return this
  41567. }
  41568. },
  41569. Ci.BufferAttribute = function(e, t) {
  41570. this.uuid = Ci.Math.generateUUID(),
  41571. this.array = e,
  41572. this.itemSize = t,
  41573. this.dynamic = !1,
  41574. this.updateRange = {
  41575. offset: 0,
  41576. count: -1
  41577. },
  41578. this.version = 0
  41579. }
  41580. ,
  41581. Ci.BufferAttribute.prototype = {
  41582. constructor: Ci.BufferAttribute,
  41583. get count() {
  41584. return this.array.length / this.itemSize
  41585. },
  41586. set needsUpdate(e) {
  41587. !0 === e && this.version++
  41588. },
  41589. setDynamic: function(e) {
  41590. return this.dynamic = e,
  41591. this
  41592. },
  41593. copy: function(e) {
  41594. return this.array = new e.array.constructor(e.array),
  41595. this.itemSize = e.itemSize,
  41596. this.dynamic = e.dynamic,
  41597. this
  41598. },
  41599. copyAt: function(e, t, i) {
  41600. e *= this.itemSize,
  41601. i *= t.itemSize;
  41602. for (var n = 0, r = this.itemSize; n < r; n++)
  41603. this.array[e + n] = t.array[i + n];
  41604. return this
  41605. },
  41606. copyArray: function(e) {
  41607. return this.array.set(e),
  41608. this
  41609. },
  41610. copyColorsArray: function(e) {
  41611. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41612. var o = e[n];
  41613. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41614. o = new Ci.Color),
  41615. t[i++] = o.r,
  41616. t[i++] = o.g,
  41617. t[i++] = o.b
  41618. }
  41619. return this
  41620. },
  41621. copyIndicesArray: function(e) {
  41622. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41623. var o = e[n];
  41624. t[i++] = o.a,
  41625. t[i++] = o.b,
  41626. t[i++] = o.c
  41627. }
  41628. return this
  41629. },
  41630. copyVector2sArray: function(e) {
  41631. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41632. var o = e[n];
  41633. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41634. o = new Ci.Vector2),
  41635. t[i++] = o.x,
  41636. t[i++] = o.y
  41637. }
  41638. return this
  41639. },
  41640. copyVector3sArray: function(e) {
  41641. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41642. var o = e[n];
  41643. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41644. o = new Ci.Vector3),
  41645. t[i++] = o.x,
  41646. t[i++] = o.y,
  41647. t[i++] = o.z
  41648. }
  41649. return this
  41650. },
  41651. copyVector4sArray: function(e) {
  41652. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41653. var o = e[n];
  41654. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41655. o = new Ci.Vector4),
  41656. t[i++] = o.x,
  41657. t[i++] = o.y,
  41658. t[i++] = o.z,
  41659. t[i++] = o.w
  41660. }
  41661. return this
  41662. },
  41663. set: function(e, t) {
  41664. return void 0 === t && (t = 0),
  41665. this.array.set(e, t),
  41666. this
  41667. },
  41668. getX: function(e) {
  41669. return this.array[e * this.itemSize]
  41670. },
  41671. setX: function(e, t) {
  41672. return this.array[e * this.itemSize] = t,
  41673. this
  41674. },
  41675. getY: function(e) {
  41676. return this.array[e * this.itemSize + 1]
  41677. },
  41678. setY: function(e, t) {
  41679. return this.array[e * this.itemSize + 1] = t,
  41680. this
  41681. },
  41682. getZ: function(e) {
  41683. return this.array[e * this.itemSize + 2]
  41684. },
  41685. setZ: function(e, t) {
  41686. return this.array[e * this.itemSize + 2] = t,
  41687. this
  41688. },
  41689. getW: function(e) {
  41690. return this.array[e * this.itemSize + 3]
  41691. },
  41692. setW: function(e, t) {
  41693. return this.array[e * this.itemSize + 3] = t,
  41694. this
  41695. },
  41696. setXY: function(e, t, i) {
  41697. return e *= this.itemSize,
  41698. this.array[e + 0] = t,
  41699. this.array[e + 1] = i,
  41700. this
  41701. },
  41702. setXYZ: function(e, t, i, n) {
  41703. return e *= this.itemSize,
  41704. this.array[e + 0] = t,
  41705. this.array[e + 1] = i,
  41706. this.array[e + 2] = n,
  41707. this
  41708. },
  41709. setXYZW: function(e, t, i, n, r) {
  41710. return e *= this.itemSize,
  41711. this.array[e + 0] = t,
  41712. this.array[e + 1] = i,
  41713. this.array[e + 2] = n,
  41714. this.array[e + 3] = r,
  41715. this
  41716. },
  41717. clone: function() {
  41718. return (new this.constructor).copy(this)
  41719. }
  41720. },
  41721. Ci.Int8Attribute = function(e, t) {
  41722. return new Ci.BufferAttribute(new Int8Array(e),t)
  41723. }
  41724. ,
  41725. Ci.Uint8Attribute = function(e, t) {
  41726. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41727. }
  41728. ,
  41729. Ci.Uint8ClampedAttribute = function(e, t) {
  41730. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41731. }
  41732. ,
  41733. Ci.Int16Attribute = function(e, t) {
  41734. return new Ci.BufferAttribute(new Int16Array(e),t)
  41735. }
  41736. ,
  41737. Ci.Uint16Attribute = function(e, t) {
  41738. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41739. }
  41740. ,
  41741. Ci.Int32Attribute = function(e, t) {
  41742. return new Ci.BufferAttribute(new Int32Array(e),t)
  41743. }
  41744. ,
  41745. Ci.Uint32Attribute = function(e, t) {
  41746. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41747. }
  41748. ,
  41749. Ci.Float32Attribute = function(e, t) {
  41750. return new Ci.BufferAttribute(new Float32Array(e),t)
  41751. }
  41752. ,
  41753. Ci.Float64Attribute = function(e, t) {
  41754. return new Ci.BufferAttribute(new Float64Array(e),t)
  41755. }
  41756. ,
  41757. Ci.DynamicBufferAttribute = function(e, t) {
  41758. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41759. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41760. }
  41761. ,
  41762. Ci.InstancedBufferAttribute = function(e, t, i) {
  41763. Ci.BufferAttribute.call(this, e, t),
  41764. this.meshPerAttribute = i || 1
  41765. }
  41766. ,
  41767. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41768. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41769. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41770. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41771. this.meshPerAttribute = e.meshPerAttribute,
  41772. this
  41773. }
  41774. ,
  41775. Ci.InterleavedBuffer = function(e, t) {
  41776. this.uuid = Ci.Math.generateUUID(),
  41777. this.array = e,
  41778. this.stride = t,
  41779. this.dynamic = !1,
  41780. this.updateRange = {
  41781. offset: 0,
  41782. count: -1
  41783. },
  41784. this.version = 0
  41785. }
  41786. ,
  41787. Ci.InterleavedBuffer.prototype = {
  41788. constructor: Ci.InterleavedBuffer,
  41789. get length() {
  41790. return this.array.length
  41791. },
  41792. get count() {
  41793. return this.array.length / this.stride
  41794. },
  41795. set needsUpdate(e) {
  41796. !0 === e && this.version++
  41797. },
  41798. setDynamic: function(e) {
  41799. return this.dynamic = e,
  41800. this
  41801. },
  41802. copy: function(e) {
  41803. return this.array = new e.array.constructor(e.array),
  41804. this.stride = e.stride,
  41805. this.dynamic = e.dynamic,
  41806. this
  41807. },
  41808. copyAt: function(e, t, i) {
  41809. e *= this.stride,
  41810. i *= t.stride;
  41811. for (var n = 0, r = this.stride; n < r; n++)
  41812. this.array[e + n] = t.array[i + n];
  41813. return this
  41814. },
  41815. set: function(e, t) {
  41816. return void 0 === t && (t = 0),
  41817. this.array.set(e, t),
  41818. this
  41819. },
  41820. clone: function() {
  41821. return (new this.constructor).copy(this)
  41822. }
  41823. },
  41824. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41825. Ci.InterleavedBuffer.call(this, e, t),
  41826. this.meshPerAttribute = i || 1
  41827. }
  41828. ,
  41829. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41830. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41831. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41832. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41833. this.meshPerAttribute = e.meshPerAttribute,
  41834. this
  41835. }
  41836. ,
  41837. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41838. this.uuid = Ci.Math.generateUUID(),
  41839. this.data = e,
  41840. this.itemSize = t,
  41841. this.offset = i
  41842. }
  41843. ,
  41844. Ci.InterleavedBufferAttribute.prototype = {
  41845. constructor: Ci.InterleavedBufferAttribute,
  41846. get length() {
  41847. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41848. this.array.length
  41849. },
  41850. get count() {
  41851. return this.data.count
  41852. },
  41853. setX: function(e, t) {
  41854. return this.data.array[e * this.data.stride + this.offset] = t,
  41855. this
  41856. },
  41857. setY: function(e, t) {
  41858. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41859. this
  41860. },
  41861. setZ: function(e, t) {
  41862. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41863. this
  41864. },
  41865. setW: function(e, t) {
  41866. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41867. this
  41868. },
  41869. getX: function(e) {
  41870. return this.data.array[e * this.data.stride + this.offset]
  41871. },
  41872. getY: function(e) {
  41873. return this.data.array[e * this.data.stride + this.offset + 1]
  41874. },
  41875. getZ: function(e) {
  41876. return this.data.array[e * this.data.stride + this.offset + 2]
  41877. },
  41878. getW: function(e) {
  41879. return this.data.array[e * this.data.stride + this.offset + 3]
  41880. },
  41881. setXY: function(e, t, i) {
  41882. return e = e * this.data.stride + this.offset,
  41883. this.data.array[e + 0] = t,
  41884. this.data.array[e + 1] = i,
  41885. this
  41886. },
  41887. setXYZ: function(e, t, i, n) {
  41888. return e = e * this.data.stride + this.offset,
  41889. this.data.array[e + 0] = t,
  41890. this.data.array[e + 1] = i,
  41891. this.data.array[e + 2] = n,
  41892. this
  41893. },
  41894. setXYZW: function(e, t, i, n, r) {
  41895. return e = e * this.data.stride + this.offset,
  41896. this.data.array[e + 0] = t,
  41897. this.data.array[e + 1] = i,
  41898. this.data.array[e + 2] = n,
  41899. this.data.array[e + 3] = r,
  41900. this
  41901. }
  41902. },
  41903. Ci.Geometry = function() {
  41904. Object.defineProperty(this, "id", {
  41905. value: Ci.GeometryIdCount++
  41906. }),
  41907. this.uuid = Ci.Math.generateUUID(),
  41908. this.name = "",
  41909. this.type = "Geometry",
  41910. this.vertices = [],
  41911. this.colors = [],
  41912. this.faces = [],
  41913. this.faceVertexUvs = [[]],
  41914. this.morphTargets = [],
  41915. this.morphNormals = [],
  41916. this.skinWeights = [],
  41917. this.skinIndices = [],
  41918. this.lineDistances = [],
  41919. this.boundingBox = null,
  41920. this.boundingSphere = null,
  41921. this.verticesNeedUpdate = !1,
  41922. this.elementsNeedUpdate = !1,
  41923. this.uvsNeedUpdate = !1,
  41924. this.normalsNeedUpdate = !1,
  41925. this.colorsNeedUpdate = !1,
  41926. this.lineDistancesNeedUpdate = !1,
  41927. this.groupsNeedUpdate = !1
  41928. }
  41929. ,
  41930. Ci.Geometry.prototype = {
  41931. constructor: Ci.Geometry,
  41932. applyMatrix: function(e) {
  41933. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41934. this.vertices[i].applyMatrix4(e)
  41935. }
  41936. for (i = 0,
  41937. n = this.faces.length; i < n; i++) {
  41938. var r = this.faces[i];
  41939. r.normal.applyMatrix3(t).normalize();
  41940. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41941. r.vertexNormals[o].applyMatrix3(t).normalize()
  41942. }
  41943. return null !== this.boundingBox && this.computeBoundingBox(),
  41944. null !== this.boundingSphere && this.computeBoundingSphere(),
  41945. this.verticesNeedUpdate = !0,
  41946. this.normalsNeedUpdate = !0,
  41947. this
  41948. },
  41949. rotateX: function(e) {
  41950. return void 0 === mt && (mt = new Ci.Matrix4),
  41951. mt.makeRotationX(e),
  41952. this.applyMatrix(mt),
  41953. this
  41954. },
  41955. rotateY: function(e) {
  41956. return void 0 === gt && (gt = new Ci.Matrix4),
  41957. gt.makeRotationY(e),
  41958. this.applyMatrix(gt),
  41959. this
  41960. },
  41961. rotateZ: function(e) {
  41962. return void 0 === ft && (ft = new Ci.Matrix4),
  41963. ft.makeRotationZ(e),
  41964. this.applyMatrix(ft),
  41965. this
  41966. },
  41967. translate: function(e, t, i) {
  41968. return void 0 === pt && (pt = new Ci.Matrix4),
  41969. pt.makeTranslation(e, t, i),
  41970. this.applyMatrix(pt),
  41971. this
  41972. },
  41973. scale: function(e, t, i) {
  41974. return void 0 === dt && (dt = new Ci.Matrix4),
  41975. dt.makeScale(e, t, i),
  41976. this.applyMatrix(dt),
  41977. this
  41978. },
  41979. lookAt: function(e) {
  41980. void 0 === ut && (ut = new Ci.Object3D),
  41981. ut.lookAt(e),
  41982. ut.updateMatrix(),
  41983. this.applyMatrix(ut.matrix)
  41984. },
  41985. fromBufferGeometry: function(e) {
  41986. function t(e, t, i, n) {
  41987. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41988. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41989. , a = new Ci.Face3(e,t,i,r,o,n);
  41990. s.faces.push(a),
  41991. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41992. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41993. }
  41994. var s = this
  41995. , i = null !== e.index ? e.index.array : void 0
  41996. , n = e.attributes
  41997. , r = n.position.array
  41998. , l = void 0 !== n.normal ? n.normal.array : void 0
  41999. , c = void 0 !== n.color ? n.color.array : void 0
  42000. , h = void 0 !== n.uv ? n.uv.array : void 0
  42001. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42002. void 0 !== u && (this.faceVertexUvs[1] = []);
  42003. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42004. a += 2)
  42005. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42006. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42007. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42008. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42009. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42010. if (void 0 !== i) {
  42011. var g = e.groups;
  42012. if (0 < g.length)
  42013. for (o = 0; o < g.length; o++)
  42014. for (var m = g[o], v = m.start, y = (a = v,
  42015. v + m.count); a < y; a += 3)
  42016. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42017. else
  42018. for (o = 0; o < i.length; o += 3)
  42019. t(i[o], i[o + 1], i[o + 2])
  42020. } else
  42021. for (o = 0; o < r.length / 3; o += 3)
  42022. t(o, o + 1, o + 2);
  42023. return this.computeFaceNormals(),
  42024. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42025. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42026. this
  42027. },
  42028. center: function() {
  42029. this.computeBoundingBox();
  42030. var e = this.boundingBox.center().negate();
  42031. return this.translate(e.x, e.y, e.z),
  42032. e
  42033. },
  42034. normalize: function() {
  42035. this.computeBoundingSphere();
  42036. var e = this.boundingSphere.center
  42037. , t = this.boundingSphere.radius
  42038. , i = 0 === t ? 1 : 1 / t
  42039. , n = new Ci.Matrix4;
  42040. 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),
  42041. this.applyMatrix(n),
  42042. this
  42043. },
  42044. computeFaceNormals: function() {
  42045. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42046. var r = this.faces[i]
  42047. , o = this.vertices[r.a]
  42048. , a = this.vertices[r.b]
  42049. , s = this.vertices[r.c];
  42050. e.subVectors(s, a),
  42051. t.subVectors(o, a),
  42052. e.cross(t),
  42053. e.normalize(),
  42054. r.normal.copy(e)
  42055. }
  42056. },
  42057. computeVertexNormals: function(e) {
  42058. var t, i, n, r, o, a;
  42059. for (void 0 === e && (e = !0),
  42060. a = new Array(this.vertices.length),
  42061. t = 0,
  42062. i = this.vertices.length; t < i; t++)
  42063. a[t] = new Ci.Vector3;
  42064. if (e) {
  42065. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42066. for (n = 0,
  42067. r = this.faces.length; n < r; n++)
  42068. o = this.faces[n],
  42069. s = this.vertices[o.a],
  42070. l = this.vertices[o.b],
  42071. c = this.vertices[o.c],
  42072. h.subVectors(c, l),
  42073. u.subVectors(s, l),
  42074. h.cross(u),
  42075. a[o.a].add(h),
  42076. a[o.b].add(h),
  42077. a[o.c].add(h)
  42078. } else
  42079. for (n = 0,
  42080. r = this.faces.length; n < r; n++)
  42081. a[(o = this.faces[n]).a].add(o.normal),
  42082. a[o.b].add(o.normal),
  42083. a[o.c].add(o.normal);
  42084. for (t = 0,
  42085. i = this.vertices.length; t < i; t++)
  42086. a[t].normalize();
  42087. for (n = 0,
  42088. r = this.faces.length; n < r; n++) {
  42089. var d = (o = this.faces[n]).vertexNormals;
  42090. 3 === d.length ? (d[0].copy(a[o.a]),
  42091. d[1].copy(a[o.b]),
  42092. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42093. d[1] = a[o.b].clone(),
  42094. d[2] = a[o.c].clone())
  42095. }
  42096. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42097. },
  42098. computeMorphNormals: function() {
  42099. var e, t, i, n, r;
  42100. for (i = 0,
  42101. n = this.faces.length; i < n; i++)
  42102. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42103. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42104. e = 0,
  42105. t = r.vertexNormals.length; e < t; e++)
  42106. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42107. var o = new Ci.Geometry;
  42108. for (o.faces = this.faces,
  42109. e = 0,
  42110. t = this.morphTargets.length; e < t; e++) {
  42111. if (!this.morphNormals[e]) {
  42112. this.morphNormals[e] = {},
  42113. this.morphNormals[e].faceNormals = [],
  42114. this.morphNormals[e].vertexNormals = [];
  42115. var a = this.morphNormals[e].faceNormals
  42116. , s = this.morphNormals[e].vertexNormals;
  42117. for (i = 0,
  42118. n = this.faces.length; i < n; i++)
  42119. l = new Ci.Vector3,
  42120. c = {
  42121. a: new Ci.Vector3,
  42122. b: new Ci.Vector3,
  42123. c: new Ci.Vector3
  42124. },
  42125. a.push(l),
  42126. s.push(c)
  42127. }
  42128. var l, c, h = this.morphNormals[e];
  42129. for (o.vertices = this.morphTargets[e].vertices,
  42130. o.computeFaceNormals(),
  42131. o.computeVertexNormals(),
  42132. i = 0,
  42133. n = this.faces.length; i < n; i++)
  42134. r = this.faces[i],
  42135. l = h.faceNormals[i],
  42136. c = h.vertexNormals[i],
  42137. l.copy(r.normal),
  42138. c.a.copy(r.vertexNormals[0]),
  42139. c.b.copy(r.vertexNormals[1]),
  42140. c.c.copy(r.vertexNormals[2])
  42141. }
  42142. for (i = 0,
  42143. n = this.faces.length; i < n; i++)
  42144. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42145. r.vertexNormals = r.__originalVertexNormals
  42146. },
  42147. computeTangents: function() {
  42148. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42149. },
  42150. computeLineDistances: function() {
  42151. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42152. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42153. this.lineDistances[i] = e
  42154. },
  42155. computeBoundingBox: function() {
  42156. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42157. this.boundingBox.setFromPoints(this.vertices)
  42158. },
  42159. computeBoundingSphere: function() {
  42160. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42161. this.boundingSphere.setFromPoints(this.vertices)
  42162. },
  42163. merge: function(e, t, i) {
  42164. if (e instanceof Ci.Geometry != 0) {
  42165. 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];
  42166. void 0 === i && (i = 0),
  42167. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42168. for (var u = 0, d = a.length; u < d; u++) {
  42169. var p = a[u].clone();
  42170. void 0 !== t && p.applyMatrix4(t),
  42171. o.push(p)
  42172. }
  42173. for (u = 0,
  42174. d = l.length; u < d; u++) {
  42175. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42176. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42177. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42178. for (var C = 0, I = y.length; C < I; C++)
  42179. g = y[C].clone(),
  42180. void 0 !== n && g.applyMatrix3(n).normalize(),
  42181. f.vertexNormals.push(g);
  42182. f.color.copy(v.color);
  42183. for (C = 0,
  42184. I = A.length; C < I; C++)
  42185. m = A[C],
  42186. f.vertexColors.push(m.clone());
  42187. f.materialIndex = v.materialIndex + i,
  42188. s.push(f)
  42189. }
  42190. for (u = 0,
  42191. d = h.length; u < d; u++) {
  42192. var E = h[u]
  42193. , _ = [];
  42194. if (void 0 !== E) {
  42195. for (C = 0,
  42196. I = E.length; C < I; C++)
  42197. _.push(E[C].clone());
  42198. c.push(_)
  42199. }
  42200. }
  42201. } else
  42202. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42203. },
  42204. mergeMesh: function(e) {
  42205. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42206. void this.merge(e.geometry, e.matrix))
  42207. },
  42208. mergeVertices: function() {
  42209. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42210. for (i = 0,
  42211. n = this.vertices.length; i < n; i++)
  42212. e = this.vertices[i],
  42213. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42214. c.push(this.vertices[i]),
  42215. h[i] = c.length - 1) : h[i] = h[l[t]];
  42216. var d = [];
  42217. for (i = 0,
  42218. n = this.faces.length; i < n; i++) {
  42219. (r = this.faces[i]).a = h[r.a],
  42220. r.b = h[r.b],
  42221. r.c = h[r.c],
  42222. o = [r.a, r.b, r.c];
  42223. for (var p = 0; p < 3; p++)
  42224. if (o[p] === o[(p + 1) % 3]) {
  42225. p,
  42226. d.push(i);
  42227. break
  42228. }
  42229. }
  42230. for (i = d.length - 1; 0 <= i; i--) {
  42231. var f = d[i];
  42232. for (this.faces.splice(f, 1),
  42233. a = 0,
  42234. s = this.faceVertexUvs.length; a < s; a++)
  42235. this.faceVertexUvs[a].splice(f, 1)
  42236. }
  42237. var g = this.vertices.length - c.length;
  42238. return this.vertices = c,
  42239. g
  42240. },
  42241. sortFacesByMaterialIndex: function() {
  42242. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42243. e[i]._id = i;
  42244. e.sort(function(e, t) {
  42245. return e.materialIndex - t.materialIndex
  42246. });
  42247. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42248. o && o.length === t && (n = []),
  42249. a && a.length === t && (r = []);
  42250. for (i = 0; i < t; i++) {
  42251. var s = e[i]._id;
  42252. n && n.push(o[s]),
  42253. r && r.push(a[s])
  42254. }
  42255. n && (this.faceVertexUvs[0] = n),
  42256. r && (this.faceVertexUvs[1] = r)
  42257. },
  42258. toJSON: function() {
  42259. function e(e, t, i) {
  42260. return i ? e | 1 << t : e & ~(1 << t)
  42261. }
  42262. function t(e) {
  42263. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42264. return void 0 !== d[t] || (d[t] = u.length / 3,
  42265. u.push(e.x, e.y, e.z)),
  42266. d[t]
  42267. }
  42268. function i(e) {
  42269. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42270. return void 0 !== f[t] || (f[t] = p.length,
  42271. p.push(e.getHex())),
  42272. f[t]
  42273. }
  42274. function n(e) {
  42275. var t = e.x.toString() + e.y.toString();
  42276. return void 0 !== m[t] || (m[t] = g.length / 2,
  42277. g.push(e.x, e.y)),
  42278. m[t]
  42279. }
  42280. var r = {
  42281. metadata: {
  42282. version: 4.4,
  42283. type: "Geometry",
  42284. generator: "Geometry.toJSON"
  42285. }
  42286. };
  42287. if (r.uuid = this.uuid,
  42288. r.type = this.type,
  42289. "" !== this.name && (r.name = this.name),
  42290. void 0 !== this.parameters) {
  42291. var o = this.parameters;
  42292. for (var a in o)
  42293. void 0 !== o[a] && (r[a] = o[a]);
  42294. return r
  42295. }
  42296. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42297. var c = this.vertices[l];
  42298. s.push(c.x, c.y, c.z)
  42299. }
  42300. var h = []
  42301. , u = []
  42302. , d = {}
  42303. , p = []
  42304. , f = {}
  42305. , g = []
  42306. , m = {};
  42307. for (l = 0; l < this.faces.length; l++) {
  42308. var v = this.faces[l]
  42309. , y = void 0 !== this.faceVertexUvs[0][l]
  42310. , A = 0 < v.normal.length()
  42311. , C = 0 < v.vertexNormals.length
  42312. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42313. , E = 0 < v.vertexColors.length
  42314. , _ = 0;
  42315. 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),
  42316. h.push(_),
  42317. h.push(v.a, v.b, v.c),
  42318. h.push(v.materialIndex),
  42319. y) {
  42320. var b = this.faceVertexUvs[0][l];
  42321. h.push(n(b[0]), n(b[1]), n(b[2]))
  42322. }
  42323. if (A && h.push(t(v.normal)),
  42324. C) {
  42325. var w = v.vertexNormals;
  42326. h.push(t(w[0]), t(w[1]), t(w[2]))
  42327. }
  42328. if (I && h.push(i(v.color)),
  42329. E) {
  42330. var T = v.vertexColors;
  42331. h.push(i(T[0]), i(T[1]), i(T[2]))
  42332. }
  42333. }
  42334. return r.data = {},
  42335. r.data.vertices = s,
  42336. r.data.normals = u,
  42337. 0 < p.length && (r.data.colors = p),
  42338. 0 < g.length && (r.data.uvs = [g]),
  42339. r.data.faces = h,
  42340. r
  42341. },
  42342. clone: function() {
  42343. return (new Ci.Geometry).copy(this)
  42344. },
  42345. copy: function(e) {
  42346. this.vertices = [],
  42347. this.faces = [],
  42348. this.faceVertexUvs = [[]];
  42349. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42350. this.vertices.push(t[i].clone());
  42351. var r = e.faces;
  42352. for (i = 0,
  42353. n = r.length; i < n; i++)
  42354. this.faces.push(r[i].clone());
  42355. for (i = 0,
  42356. n = e.faceVertexUvs.length; i < n; i++) {
  42357. var o = e.faceVertexUvs[i];
  42358. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42359. for (var a = 0, s = o.length; a < s; a++) {
  42360. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42361. var d = l[h];
  42362. c.push(d.clone())
  42363. }
  42364. this.faceVertexUvs[i].push(c)
  42365. }
  42366. }
  42367. return this
  42368. },
  42369. dispose: function() {
  42370. this.dispatchEvent({
  42371. type: "dispose"
  42372. })
  42373. }
  42374. },
  42375. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42376. Ci.GeometryIdCount = 0,
  42377. Ci.DirectGeometry = function() {
  42378. Object.defineProperty(this, "id", {
  42379. value: Ci.GeometryIdCount++
  42380. }),
  42381. this.uuid = Ci.Math.generateUUID(),
  42382. this.name = "",
  42383. this.type = "DirectGeometry",
  42384. this.indices = [],
  42385. this.vertices = [],
  42386. this.normals = [],
  42387. this.colors = [],
  42388. this.uvs = [],
  42389. this.uvs2 = [],
  42390. this.groups = [],
  42391. this.morphTargets = {},
  42392. this.skinWeights = [],
  42393. this.skinIndices = [],
  42394. this.boundingBox = null,
  42395. this.boundingSphere = null,
  42396. this.verticesNeedUpdate = !1,
  42397. this.normalsNeedUpdate = !1,
  42398. this.colorsNeedUpdate = !1,
  42399. this.uvsNeedUpdate = !1,
  42400. this.groupsNeedUpdate = !1
  42401. }
  42402. ,
  42403. Ci.DirectGeometry.prototype = {
  42404. constructor: Ci.DirectGeometry,
  42405. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42406. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42407. computeFaceNormals: function() {
  42408. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42409. },
  42410. computeVertexNormals: function() {
  42411. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42412. },
  42413. computeGroups: function(e) {
  42414. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42415. var a = r[o];
  42416. a.materialIndex !== i && (i = a.materialIndex,
  42417. void 0 !== t && (t.count = 3 * o - t.start,
  42418. n.push(t)),
  42419. t = {
  42420. start: 3 * o,
  42421. materialIndex: i
  42422. })
  42423. }
  42424. void 0 !== t && (t.count = 3 * o - t.start,
  42425. n.push(t)),
  42426. this.groups = n
  42427. },
  42428. fromGeometry: function(e) {
  42429. 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;
  42430. if (0 < l) {
  42431. t = [];
  42432. for (var c = 0; c < l; c++)
  42433. t[c] = [];
  42434. this.morphTargets.position = t
  42435. }
  42436. var h, u = e.morphNormals, d = u.length;
  42437. if (0 < d) {
  42438. h = [];
  42439. for (c = 0; c < d; c++)
  42440. h[c] = [];
  42441. this.morphTargets.normal = h
  42442. }
  42443. var p = e.skinIndices
  42444. , f = e.skinWeights
  42445. , g = p.length === n.length
  42446. , m = f.length === n.length;
  42447. for (c = 0; c < i.length; c++) {
  42448. var v = i[c];
  42449. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42450. var y = v.vertexNormals;
  42451. if (3 === y.length)
  42452. this.normals.push(y[0], y[1], y[2]);
  42453. else {
  42454. var A = v.normal;
  42455. this.normals.push(A, A, A)
  42456. }
  42457. var C, I = v.vertexColors;
  42458. if (3 === I.length)
  42459. this.colors.push(I[0], I[1], I[2]);
  42460. else {
  42461. var E = v.color;
  42462. this.colors.push(E, E, E)
  42463. }
  42464. if (!0 === o)
  42465. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42466. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42467. if (!0 === a)
  42468. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42469. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42470. for (var _ = 0; _ < l; _++) {
  42471. var b = s[_].vertices;
  42472. t[_].push(b[v.a], b[v.b], b[v.c])
  42473. }
  42474. for (_ = 0; _ < d; _++) {
  42475. var w = u[_].vertexNormals[c];
  42476. h[_].push(w.a, w.b, w.c)
  42477. }
  42478. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42479. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42480. }
  42481. return this.computeGroups(e),
  42482. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42483. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42484. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42485. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42486. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42487. this
  42488. },
  42489. dispose: function() {
  42490. this.dispatchEvent({
  42491. type: "dispose"
  42492. })
  42493. }
  42494. },
  42495. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42496. Ci.BufferGeometry = function() {
  42497. Object.defineProperty(this, "id", {
  42498. value: Ci.GeometryIdCount++
  42499. }),
  42500. this.uuid = Ci.Math.generateUUID(),
  42501. this.name = "",
  42502. this.type = "BufferGeometry",
  42503. this.index = null,
  42504. this.attributes = {},
  42505. this.morphAttributes = {},
  42506. this.groups = [],
  42507. this.boundingBox = null,
  42508. this.boundingSphere = null,
  42509. this.drawRange = {
  42510. start: 0,
  42511. count: 1 / 0
  42512. }
  42513. }
  42514. ,
  42515. Ci.BufferGeometry.prototype = {
  42516. constructor: Ci.BufferGeometry,
  42517. getIndex: function() {
  42518. return this.index
  42519. },
  42520. setIndex: function(e) {
  42521. this.index = e
  42522. },
  42523. addAttribute: function(e, t) {
  42524. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42525. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42526. void this.setIndex(t)) : (this.attributes[e] = t,
  42527. this)
  42528. },
  42529. getAttribute: function(e) {
  42530. return this.attributes[e]
  42531. },
  42532. removeAttribute: function(e) {
  42533. return delete this.attributes[e],
  42534. this
  42535. },
  42536. addGroup: function(e, t, i) {
  42537. this.groups.push({
  42538. start: e,
  42539. count: t,
  42540. materialIndex: void 0 !== i ? i : 0
  42541. })
  42542. },
  42543. clearGroups: function() {
  42544. this.groups = []
  42545. },
  42546. setDrawRange: function(e, t) {
  42547. this.drawRange.start = e,
  42548. this.drawRange.count = t
  42549. },
  42550. applyMatrix: function(e) {
  42551. var t = this.attributes.position;
  42552. void 0 !== t && (e.applyToVector3Array(t.array),
  42553. t.needsUpdate = !0);
  42554. var i = this.attributes.normal;
  42555. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42556. i.needsUpdate = !0);
  42557. return null !== this.boundingBox && this.computeBoundingBox(),
  42558. null !== this.boundingSphere && this.computeBoundingSphere(),
  42559. this
  42560. },
  42561. rotateX: function(e) {
  42562. return void 0 === ht && (ht = new Ci.Matrix4),
  42563. ht.makeRotationX(e),
  42564. this.applyMatrix(ht),
  42565. this
  42566. },
  42567. rotateY: function(e) {
  42568. return void 0 === ct && (ct = new Ci.Matrix4),
  42569. ct.makeRotationY(e),
  42570. this.applyMatrix(ct),
  42571. this
  42572. },
  42573. rotateZ: function(e) {
  42574. return void 0 === lt && (lt = new Ci.Matrix4),
  42575. lt.makeRotationZ(e),
  42576. this.applyMatrix(lt),
  42577. this
  42578. },
  42579. translate: function(e, t, i) {
  42580. return void 0 === st && (st = new Ci.Matrix4),
  42581. st.makeTranslation(e, t, i),
  42582. this.applyMatrix(st),
  42583. this
  42584. },
  42585. scale: function(e, t, i) {
  42586. return void 0 === at && (at = new Ci.Matrix4),
  42587. at.makeScale(e, t, i),
  42588. this.applyMatrix(at),
  42589. this
  42590. },
  42591. lookAt: function(e) {
  42592. void 0 === ot && (ot = new Ci.Object3D),
  42593. ot.lookAt(e),
  42594. ot.updateMatrix(),
  42595. this.applyMatrix(ot.matrix)
  42596. },
  42597. center: function() {
  42598. this.computeBoundingBox();
  42599. var e = this.boundingBox.center().negate();
  42600. return this.translate(e.x, e.y, e.z),
  42601. e
  42602. },
  42603. setFromObject: function(e) {
  42604. var t = e.geometry;
  42605. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42606. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42607. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42608. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42609. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42610. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42611. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42612. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42613. }
  42614. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42615. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42616. } else
  42617. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42618. return this
  42619. },
  42620. updateFromObject: function(e) {
  42621. var t, i = e.geometry;
  42622. if (e instanceof Ci.Mesh) {
  42623. var n = i.__directGeometry;
  42624. if (void 0 === n)
  42625. return this.fromGeometry(i);
  42626. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42627. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42628. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42629. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42630. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42631. i.verticesNeedUpdate = !1,
  42632. i.normalsNeedUpdate = !1,
  42633. i.colorsNeedUpdate = !1,
  42634. i.uvsNeedUpdate = !1,
  42635. i.groupsNeedUpdate = !1,
  42636. i = n
  42637. }
  42638. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42639. t.needsUpdate = !0),
  42640. i.verticesNeedUpdate = !1);
  42641. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42642. t.needsUpdate = !0),
  42643. i.normalsNeedUpdate = !1);
  42644. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42645. t.needsUpdate = !0),
  42646. i.colorsNeedUpdate = !1);
  42647. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42648. t.needsUpdate = !0),
  42649. i.uvsNeedUpdate = !1);
  42650. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42651. t.needsUpdate = !0),
  42652. i.lineDistancesNeedUpdate = !1);
  42653. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42654. this.groups = i.groups,
  42655. i.groupsNeedUpdate = !1),
  42656. this
  42657. },
  42658. fromGeometry: function(e) {
  42659. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42660. this.fromDirectGeometry(e.__directGeometry)
  42661. },
  42662. fromDirectGeometry: function(e) {
  42663. var t = new Float32Array(3 * e.vertices.length);
  42664. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42665. 0 < e.normals.length) {
  42666. var i = new Float32Array(3 * e.normals.length);
  42667. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42668. }
  42669. if (0 < e.colors.length) {
  42670. var n = new Float32Array(3 * e.colors.length);
  42671. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42672. }
  42673. if (0 < e.uvs.length) {
  42674. var r = new Float32Array(2 * e.uvs.length);
  42675. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42676. }
  42677. if (0 < e.uvs2.length) {
  42678. var o = new Float32Array(2 * e.uvs2.length);
  42679. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42680. }
  42681. if (0 < e.indices.length) {
  42682. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42683. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42684. }
  42685. for (var s in this.groups = e.groups,
  42686. e.morphTargets) {
  42687. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42688. var d = c[h]
  42689. , p = new Ci.Float32Attribute(3 * d.length,3);
  42690. l.push(p.copyVector3sArray(d))
  42691. }
  42692. this.morphAttributes[s] = l
  42693. }
  42694. if (0 < e.skinIndices.length) {
  42695. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42696. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42697. }
  42698. if (0 < e.skinWeights.length) {
  42699. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42700. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42701. }
  42702. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42703. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42704. this
  42705. },
  42706. computeBoundingBox: (new Ci.Vector3,
  42707. function() {
  42708. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42709. var e = this.attributes.position.array;
  42710. e && this.boundingBox.setFromArray(e),
  42711. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42712. this.boundingBox.max.set(0, 0, 0)),
  42713. (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)
  42714. }
  42715. ),
  42716. computeBoundingSphere: (nt = new Ci.Box3,
  42717. rt = new Ci.Vector3,
  42718. function() {
  42719. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42720. var e = this.attributes.position.array;
  42721. if (e) {
  42722. var t = this.boundingSphere.center;
  42723. nt.setFromArray(e),
  42724. nt.center(t);
  42725. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42726. rt.fromArray(e, n),
  42727. i = Math.max(i, t.distanceToSquared(rt));
  42728. this.boundingSphere.radius = Math.sqrt(i),
  42729. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42730. }
  42731. }
  42732. ),
  42733. computeFaceNormals: function() {},
  42734. computeVertexNormals: function() {
  42735. var e = this.index
  42736. , t = this.attributes
  42737. , i = this.groups;
  42738. if (t.position) {
  42739. var n = t.position.array;
  42740. if (void 0 === t.normal)
  42741. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42742. else
  42743. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42744. r[o] = 0;
  42745. 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;
  42746. if (e) {
  42747. var m = e.array;
  42748. 0 === i.length && this.addGroup(0, m.length);
  42749. for (var v = 0, y = i.length; v < y; ++v) {
  42750. var A = i[v]
  42751. , C = A.start;
  42752. for (o = C,
  42753. a = C + A.count; o < a; o += 3)
  42754. s = 3 * m[o + 0],
  42755. l = 3 * m[o + 1],
  42756. c = 3 * m[o + 2],
  42757. u.fromArray(n, s),
  42758. d.fromArray(n, l),
  42759. p.fromArray(n, c),
  42760. f.subVectors(p, d),
  42761. g.subVectors(u, d),
  42762. f.cross(g),
  42763. h[s] += f.x,
  42764. h[1 + s] += f.y,
  42765. h[2 + s] += f.z,
  42766. h[l] += f.x,
  42767. h[1 + l] += f.y,
  42768. h[2 + l] += f.z,
  42769. h[c] += f.x,
  42770. h[1 + c] += f.y,
  42771. h[2 + c] += f.z
  42772. }
  42773. } else
  42774. for (o = 0,
  42775. a = n.length; o < a; o += 9)
  42776. u.fromArray(n, o),
  42777. d.fromArray(n, o + 3),
  42778. p.fromArray(n, o + 6),
  42779. f.subVectors(p, d),
  42780. g.subVectors(u, d),
  42781. f.cross(g),
  42782. h[o] = f.x,
  42783. h[o + 1] = f.y,
  42784. h[o + 2] = f.z,
  42785. h[o + 3] = f.x,
  42786. h[o + 4] = f.y,
  42787. h[o + 5] = f.z,
  42788. h[o + 6] = f.x,
  42789. h[o + 7] = f.y,
  42790. h[o + 8] = f.z;
  42791. this.normalizeNormals(),
  42792. t.normal.needsUpdate = !0
  42793. }
  42794. },
  42795. merge: function(e, t) {
  42796. if (e instanceof Ci.BufferGeometry != 0) {
  42797. void 0 === t && (t = 0);
  42798. var i = this.attributes;
  42799. for (var n in i)
  42800. if (void 0 !== e.attributes[n])
  42801. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42802. l++)
  42803. r[l] = a[s];
  42804. return this
  42805. }
  42806. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42807. },
  42808. normalizeNormals: function() {
  42809. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42810. e = r[o],
  42811. t = r[o + 1],
  42812. i = r[o + 2],
  42813. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42814. r[o] *= n,
  42815. r[o + 1] *= n,
  42816. r[o + 2] *= n
  42817. },
  42818. toNonIndexed: function() {
  42819. if (null === this.index)
  42820. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42821. this;
  42822. var e = new Ci.BufferGeometry
  42823. , t = this.index.array
  42824. , i = this.attributes;
  42825. for (var n in i) {
  42826. 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++) {
  42827. l = t[h] * a;
  42828. for (var d = 0; d < a; d++)
  42829. s[c++] = o[l++]
  42830. }
  42831. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42832. }
  42833. return e
  42834. },
  42835. toJSON: function() {
  42836. var e = {
  42837. metadata: {
  42838. version: 4.4,
  42839. type: "BufferGeometry",
  42840. generator: "BufferGeometry.toJSON"
  42841. }
  42842. };
  42843. if (e.uuid = this.uuid,
  42844. e.type = this.type,
  42845. "" !== this.name && (e.name = this.name),
  42846. void 0 !== this.parameters) {
  42847. var t = this.parameters;
  42848. for (var i in t)
  42849. void 0 !== t[i] && (e[i] = t[i]);
  42850. return e
  42851. }
  42852. e.data = {
  42853. attributes: {}
  42854. };
  42855. var n = this.index;
  42856. if (null !== n) {
  42857. var r = Array.prototype.slice.call(n.array);
  42858. e.data.index = {
  42859. type: n.array.constructor.name,
  42860. array: r
  42861. }
  42862. }
  42863. var o = this.attributes;
  42864. for (var i in o) {
  42865. var a = o[i];
  42866. r = Array.prototype.slice.call(a.array);
  42867. e.data.attributes[i] = {
  42868. itemSize: a.itemSize,
  42869. type: a.array.constructor.name,
  42870. array: r
  42871. }
  42872. }
  42873. var s = this.groups;
  42874. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42875. var l = this.boundingSphere;
  42876. return null !== l && (e.data.boundingSphere = {
  42877. center: l.center.toArray(),
  42878. radius: l.radius
  42879. }),
  42880. e
  42881. },
  42882. clone: function() {
  42883. return (new Ci.BufferGeometry).copy(this)
  42884. },
  42885. copy: function(e) {
  42886. var t = e.index;
  42887. null !== t && this.setIndex(t.clone());
  42888. var i = e.attributes;
  42889. for (var n in i) {
  42890. var r = i[n];
  42891. this.addAttribute(n, r.clone())
  42892. }
  42893. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42894. var l = o[a];
  42895. this.addGroup(l.start, l.count)
  42896. }
  42897. return this
  42898. },
  42899. dispose: function() {
  42900. this.dispatchEvent({
  42901. type: "dispose"
  42902. })
  42903. }
  42904. },
  42905. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42906. Ci.BufferGeometry.MaxIndex = 65535,
  42907. Ci.InstancedBufferGeometry = function() {
  42908. Ci.BufferGeometry.call(this),
  42909. this.type = "InstancedBufferGeometry",
  42910. this.maxInstancedCount = void 0
  42911. }
  42912. ,
  42913. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42914. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42915. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42916. this.groups.push({
  42917. start: e,
  42918. count: t,
  42919. instances: i
  42920. })
  42921. }
  42922. ,
  42923. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42924. var t = e.index;
  42925. null !== t && this.setIndex(t.clone());
  42926. var i = e.attributes;
  42927. for (var n in i) {
  42928. var r = i[n];
  42929. this.addAttribute(n, r.clone())
  42930. }
  42931. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42932. var l = o[a];
  42933. this.addGroup(l.start, l.count, l.instances)
  42934. }
  42935. return this
  42936. }
  42937. ,
  42938. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42939. Ci.Uniform = function(e, t) {
  42940. this.type = e,
  42941. this.value = t,
  42942. this.dynamic = !1
  42943. }
  42944. ,
  42945. Ci.Uniform.prototype = {
  42946. constructor: Ci.Uniform,
  42947. onUpdate: function(e) {
  42948. return this.dynamic = !0,
  42949. this.onUpdateCallback = e,
  42950. this
  42951. }
  42952. },
  42953. Ci.AnimationClip = function(e, t, i) {
  42954. this.name = e || Ci.Math.generateUUID(),
  42955. this.tracks = i,
  42956. this.duration = void 0 !== t ? t : -1,
  42957. this.duration < 0 && this.resetDuration(),
  42958. this.trim(),
  42959. this.optimize()
  42960. }
  42961. ,
  42962. Ci.AnimationClip.prototype = {
  42963. constructor: Ci.AnimationClip,
  42964. resetDuration: function() {
  42965. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42966. var n = this.tracks[t];
  42967. e = Math.max(e, n.times[n.times.length - 1])
  42968. }
  42969. this.duration = e
  42970. },
  42971. trim: function() {
  42972. for (var e = 0; e < this.tracks.length; e++)
  42973. this.tracks[e].trim(0, this.duration);
  42974. return this
  42975. },
  42976. optimize: function() {
  42977. for (var e = 0; e < this.tracks.length; e++)
  42978. this.tracks[e].optimize();
  42979. return this
  42980. }
  42981. },
  42982. Object.assign(Ci.AnimationClip, {
  42983. parse: function(e) {
  42984. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42985. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42986. return new Ci.AnimationClip(e.name,e.duration,t)
  42987. },
  42988. toJSON: function(e) {
  42989. for (var t = [], i = e.tracks, n = {
  42990. name: e.name,
  42991. duration: e.duration,
  42992. tracks: t
  42993. }, r = 0, o = i.length; r !== o; ++r)
  42994. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42995. return n
  42996. },
  42997. CreateFromMorphTargetSequence: function(e, t, i) {
  42998. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42999. var a = []
  43000. , s = [];
  43001. a.push((o + n - 1) % n, o, (o + 1) % n),
  43002. s.push(0, 1, 0);
  43003. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43004. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43005. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43006. 0 === a[0] && (a.push(n),
  43007. s.push(s[0])),
  43008. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43009. }
  43010. return new Ci.AnimationClip(e,-1,r)
  43011. },
  43012. findByName: function(e, t) {
  43013. for (var i = 0; i < e.length; i++)
  43014. if (e[i].name === t)
  43015. return e[i];
  43016. return null
  43017. },
  43018. CreateClipsFromMorphTargetSequences: function(e, t) {
  43019. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43020. var a = e[r]
  43021. , s = a.name.match(n);
  43022. if (s && 1 < s.length) {
  43023. var l = i[h = s[1]];
  43024. l || (i[h] = l = []),
  43025. l.push(a)
  43026. }
  43027. }
  43028. var c = [];
  43029. for (var h in i)
  43030. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43031. return c
  43032. },
  43033. parseAnimation: function(e, t, i) {
  43034. if (!e)
  43035. return console.error(" no animation in JSONLoader data"),
  43036. null;
  43037. function n(e, t, i, n, r) {
  43038. if (0 !== i.length) {
  43039. var o = []
  43040. , a = [];
  43041. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43042. 0 !== o.length && r.push(new e(t,o,a))
  43043. }
  43044. }
  43045. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43046. var h = l[c].keys;
  43047. if (h && 0 != h.length)
  43048. if (h[0].morphTargets) {
  43049. for (var u = {}, d = 0; d < h.length; d++)
  43050. if (h[d].morphTargets)
  43051. for (var p = 0; p < h[d].morphTargets.length; p++)
  43052. u[h[d].morphTargets[p]] = -1;
  43053. for (var f in u) {
  43054. var g = []
  43055. , m = [];
  43056. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43057. var v = h[d];
  43058. g.push(v.time),
  43059. m.push(v.morphTarget === f ? 1 : 0)
  43060. }
  43061. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43062. }
  43063. a = u.length * (s || 1)
  43064. } else {
  43065. var y = ".bones[" + t[c].name + "]";
  43066. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43067. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43068. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43069. }
  43070. }
  43071. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43072. }
  43073. }),
  43074. Ci.AnimationMixer = function(e) {
  43075. this._root = e,
  43076. this._initMemoryManager(),
  43077. this._accuIndex = 0,
  43078. this.time = 0,
  43079. this.timeScale = 1
  43080. }
  43081. ,
  43082. Ci.AnimationMixer.prototype = {
  43083. constructor: Ci.AnimationMixer,
  43084. clipAction: function(e, t) {
  43085. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43086. if (void 0 !== a) {
  43087. var s = a.actionByRoot[n];
  43088. if (void 0 !== s)
  43089. return s;
  43090. if (o = (i = a.knownActions[0])._clip,
  43091. e !== r && e !== o)
  43092. throw new Error("Different clips with the same name detected!")
  43093. }
  43094. if (null === o)
  43095. return null;
  43096. var l = new Ci.AnimationMixer._Action(this,o,t);
  43097. return this._bindAction(l, i),
  43098. this._addInactiveAction(l, r, n),
  43099. l
  43100. },
  43101. existingAction: function(e, t) {
  43102. var i = (t || this._root).uuid
  43103. , n = "string" == typeof e ? e : e.name
  43104. , r = this._actionsByClip[n];
  43105. return void 0 !== r && r.actionByRoot[i] || null
  43106. },
  43107. stopAllAction: function() {
  43108. var e = this._actions
  43109. , t = this._nActiveActions
  43110. , i = this._bindings
  43111. , n = this._nActiveBindings;
  43112. this._nActiveActions = 0;
  43113. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43114. e[r].reset();
  43115. for (r = 0; r !== n; ++r)
  43116. i[r].useCount = 0;
  43117. return this
  43118. },
  43119. update: function(e) {
  43120. e *= this.timeScale;
  43121. 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) {
  43122. var s = t[a];
  43123. s.enabled && s._update(n, e, r, o)
  43124. }
  43125. var l = this._bindings
  43126. , c = this._nActiveBindings;
  43127. for (a = 0; a !== c; ++a)
  43128. l[a].apply(o);
  43129. return this
  43130. },
  43131. getRoot: function() {
  43132. return this._root
  43133. },
  43134. uncacheClip: function(e) {
  43135. var t = this._actions
  43136. , i = e.name
  43137. , n = this._actionsByClip
  43138. , r = n[i];
  43139. if (void 0 !== r) {
  43140. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43141. var l = o[a];
  43142. this._deactivateAction(l);
  43143. var c = l._cacheIndex
  43144. , h = t[t.length - 1];
  43145. l._cacheIndex = null,
  43146. l._byClipCacheIndex = null,
  43147. t[h._cacheIndex = c] = h,
  43148. t.pop(),
  43149. this._removeInactiveBindingsForAction(l)
  43150. }
  43151. delete n[i]
  43152. }
  43153. },
  43154. uncacheRoot: function(e) {
  43155. var t = e.uuid
  43156. , i = this._actionsByClip;
  43157. for (var n in i) {
  43158. var r = i[n].actionByRoot[t];
  43159. void 0 !== r && (this._deactivateAction(r),
  43160. this._removeInactiveAction(r))
  43161. }
  43162. var o = this._bindingsByRootAndName[t];
  43163. if (void 0 !== o)
  43164. for (var a in o) {
  43165. var s = o[a];
  43166. s.restoreOriginalState(),
  43167. this._removeInactiveBinding(s)
  43168. }
  43169. },
  43170. uncacheAction: function(e, t) {
  43171. var i = this.existingAction(e, t);
  43172. null !== i && (this._deactivateAction(i),
  43173. this._removeInactiveAction(i))
  43174. }
  43175. },
  43176. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43177. Ci.AnimationMixer._Action = function(e, t, i) {
  43178. this._mixer = e,
  43179. this._clip = t,
  43180. this._localRoot = i || null;
  43181. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43182. endingStart: Ci.ZeroCurvatureEnding,
  43183. endingEnd: Ci.ZeroCurvatureEnding
  43184. }, s = 0; s !== r; ++s) {
  43185. var l = n[s].createInterpolant(null);
  43186. (o[s] = l).settings = a
  43187. }
  43188. this._interpolantSettings = a,
  43189. this._interpolants = o,
  43190. this._propertyBindings = new Array(r),
  43191. this._cacheIndex = null,
  43192. this._byClipCacheIndex = null,
  43193. this._timeScaleInterpolant = null,
  43194. this._weightInterpolant = null,
  43195. this.loop = Ci.LoopRepeat,
  43196. this._loopCount = -1,
  43197. this._startTime = null,
  43198. this.time = 0,
  43199. this.timeScale = 1,
  43200. this._effectiveTimeScale = 1,
  43201. this.weight = 1,
  43202. this._effectiveWeight = 1,
  43203. this.repetitions = 1 / 0,
  43204. this.paused = !1,
  43205. this.enabled = !0,
  43206. this.clampWhenFinished = !1,
  43207. this.zeroSlopeAtStart = !0,
  43208. this.zeroSlopeAtEnd = !0
  43209. }
  43210. ,
  43211. Ci.AnimationMixer._Action.prototype = {
  43212. constructor: Ci.AnimationMixer._Action,
  43213. play: function() {
  43214. return this._mixer._activateAction(this),
  43215. this
  43216. },
  43217. stop: function() {
  43218. return this._mixer._deactivateAction(this),
  43219. this.reset()
  43220. },
  43221. reset: function() {
  43222. return this.paused = !1,
  43223. this.enabled = !0,
  43224. this.time = 0,
  43225. this._loopCount = -1,
  43226. this._startTime = null,
  43227. this.stopFading().stopWarping()
  43228. },
  43229. isRunning: function() {
  43230. return this._startTime,
  43231. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43232. },
  43233. isScheduled: function() {
  43234. return this._mixer._isActiveAction(this)
  43235. },
  43236. startAt: function(e) {
  43237. return this._startTime = e,
  43238. this
  43239. },
  43240. setLoop: function(e, t) {
  43241. return this.loop = e,
  43242. this.repetitions = t,
  43243. this
  43244. },
  43245. setEffectiveWeight: function(e) {
  43246. return this.weight = e,
  43247. this._effectiveWeight = this.enabled ? e : 0,
  43248. this.stopFading()
  43249. },
  43250. getEffectiveWeight: function() {
  43251. return this._effectiveWeight
  43252. },
  43253. fadeIn: function(e) {
  43254. return this._scheduleFading(e, 0, 1)
  43255. },
  43256. fadeOut: function(e) {
  43257. return this._scheduleFading(e, 1, 0)
  43258. },
  43259. crossFadeFrom: function(e, t, i) {
  43260. if (this._mixer,
  43261. e.fadeOut(t),
  43262. this.fadeIn(t),
  43263. i) {
  43264. var n = this._clip.duration
  43265. , r = e._clip.duration
  43266. , o = r / n
  43267. , a = n / r;
  43268. e.warp(1, o, t),
  43269. this.warp(a, 1, t)
  43270. }
  43271. return this
  43272. },
  43273. crossFadeTo: function(e, t, i) {
  43274. return e.crossFadeFrom(this, t, i)
  43275. },
  43276. stopFading: function() {
  43277. var e = this._weightInterpolant;
  43278. return null !== e && (this._weightInterpolant = null,
  43279. this._mixer._takeBackControlInterpolant(e)),
  43280. this
  43281. },
  43282. setEffectiveTimeScale: function(e) {
  43283. return this.timeScale = e,
  43284. this._effectiveTimeScale = this.paused ? 0 : e,
  43285. this.stopWarping()
  43286. },
  43287. getEffectiveTimeScale: function() {
  43288. return this._effectiveTimeScale
  43289. },
  43290. setDuration: function(e) {
  43291. return this.timeScale = this._clip.duration / e,
  43292. this.stopWarping()
  43293. },
  43294. syncWith: function(e) {
  43295. return this.time = e.time,
  43296. this.timeScale = e.timeScale,
  43297. this.stopWarping()
  43298. },
  43299. halt: function(e) {
  43300. return this.warp(this._currentTimeScale, 0, e)
  43301. },
  43302. warp: function(e, t, i) {
  43303. var n = this._mixer
  43304. , r = n.time
  43305. , o = this._timeScaleInterpolant
  43306. , a = this.timeScale;
  43307. null === o && (o = n._lendControlInterpolant(),
  43308. this._timeScaleInterpolant = o);
  43309. var s = o.parameterPositions
  43310. , l = o.sampleValues;
  43311. return s[0] = r,
  43312. s[1] = r + i,
  43313. l[0] = e / a,
  43314. l[1] = t / a,
  43315. this
  43316. },
  43317. stopWarping: function() {
  43318. var e = this._timeScaleInterpolant;
  43319. return null !== e && (this._timeScaleInterpolant = null,
  43320. this._mixer._takeBackControlInterpolant(e)),
  43321. this
  43322. },
  43323. getMixer: function() {
  43324. return this._mixer
  43325. },
  43326. getClip: function() {
  43327. return this._clip
  43328. },
  43329. getRoot: function() {
  43330. return this._localRoot || this._mixer._root
  43331. },
  43332. _update: function(e, t, i, n) {
  43333. var r = this._startTime;
  43334. if (null !== r) {
  43335. var o = (e - r) * i;
  43336. if (o < 0 || 0 === i)
  43337. return;
  43338. this._startTime = null,
  43339. t = i * o
  43340. }
  43341. t *= this._updateTimeScale(e);
  43342. var a = this._updateTime(t)
  43343. , s = this._updateWeight(e);
  43344. if (0 < s)
  43345. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43346. l[h].evaluate(a),
  43347. c[h].accumulate(n, s)
  43348. },
  43349. _updateWeight: function(e) {
  43350. var t = 0;
  43351. if (this.enabled) {
  43352. t = this.weight;
  43353. var i = this._weightInterpolant;
  43354. if (null !== i) {
  43355. var n = i.evaluate(e)[0];
  43356. t *= n,
  43357. e > i.parameterPositions[1] && (this.stopFading(),
  43358. 0 === n && (this.enabled = !1))
  43359. }
  43360. }
  43361. return this._effectiveWeight = t
  43362. },
  43363. _updateTimeScale: function(e) {
  43364. var t = 0;
  43365. if (!this.paused) {
  43366. t = this.timeScale;
  43367. var i = this._timeScaleInterpolant;
  43368. if (null !== i)
  43369. t *= i.evaluate(e)[0],
  43370. e > i.parameterPositions[1] && (this.stopWarping(),
  43371. 0 === t ? this.pause = !0 : this.timeScale = t)
  43372. }
  43373. return this._effectiveTimeScale = t
  43374. },
  43375. _updateTime: function(e) {
  43376. var t = this.time + e;
  43377. if (0 === e)
  43378. return t;
  43379. var i = this._clip.duration
  43380. , n = this.loop
  43381. , r = this._loopCount
  43382. , o = !1;
  43383. switch (n) {
  43384. case Ci.LoopOnce:
  43385. if (-1 === r && (this.loopCount = 0,
  43386. this._setEndings(!0, !0, !1)),
  43387. i <= t)
  43388. t = i;
  43389. else {
  43390. if (!(t < 0))
  43391. break;
  43392. t = 0
  43393. }
  43394. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43395. this._mixer.dispatchEvent({
  43396. type: "finished",
  43397. action: this,
  43398. direction: e < 0 ? -1 : 1
  43399. });
  43400. break;
  43401. case Ci.LoopPingPong:
  43402. o = !0;
  43403. case Ci.LoopRepeat:
  43404. if (-1 === r && (0 < e ? (r = 0,
  43405. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43406. i <= t || t < 0) {
  43407. var a = Math.floor(t / i);
  43408. t -= i * a,
  43409. r += Math.abs(a);
  43410. var s = this.repetitions - r;
  43411. if (s < 0) {
  43412. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43413. t = 0 < e ? i : 0,
  43414. this._mixer.dispatchEvent({
  43415. type: "finished",
  43416. action: this,
  43417. direction: 0 < e ? 1 : -1
  43418. });
  43419. break
  43420. }
  43421. if (0 == s) {
  43422. var l = e < 0;
  43423. this._setEndings(l, !l, o)
  43424. } else
  43425. this._setEndings(!1, !1, o);
  43426. this._loopCount = r,
  43427. this._mixer.dispatchEvent({
  43428. type: "loop",
  43429. action: this,
  43430. loopDelta: a
  43431. })
  43432. }
  43433. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43434. return i - (this.time = t)
  43435. }
  43436. return this.time = t
  43437. },
  43438. _setEndings: function(e, t, i) {
  43439. var n = this._interpolantSettings;
  43440. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43441. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43442. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43443. },
  43444. _scheduleFading: function(e, t, i) {
  43445. var n = this._mixer
  43446. , r = n.time
  43447. , o = this._weightInterpolant;
  43448. null === o && (o = n._lendControlInterpolant(),
  43449. this._weightInterpolant = o);
  43450. var a = o.parameterPositions
  43451. , s = o.sampleValues;
  43452. return a[0] = r,
  43453. s[0] = t,
  43454. a[1] = r + e,
  43455. s[1] = i,
  43456. this
  43457. }
  43458. },
  43459. Object.assign(Ci.AnimationMixer.prototype, {
  43460. _bindAction: function(e, t) {
  43461. var i = e._localRoot || this._root
  43462. , n = e._clip.tracks
  43463. , r = n.length
  43464. , o = e._propertyBindings
  43465. , a = e._interpolants
  43466. , s = i.uuid
  43467. , l = this._bindingsByRootAndName
  43468. , c = l[s];
  43469. void 0 === c && (c = {},
  43470. l[s] = c);
  43471. for (var h = 0; h !== r; ++h) {
  43472. var u = n[h]
  43473. , d = u.name
  43474. , p = c[d];
  43475. if (void 0 !== p)
  43476. o[h] = p;
  43477. else {
  43478. if (void 0 !== (p = o[h])) {
  43479. null === p._cacheIndex && (++p.referenceCount,
  43480. this._addInactiveBinding(p, s, d));
  43481. continue
  43482. }
  43483. var f = t && t._propertyBindings[h].binding.parsedPath;
  43484. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43485. this._addInactiveBinding(p, s, d),
  43486. o[h] = p
  43487. }
  43488. a[h].resultBuffer = p.buffer
  43489. }
  43490. },
  43491. _activateAction: function(e) {
  43492. if (!this._isActiveAction(e)) {
  43493. if (null === e._cacheIndex) {
  43494. var t = (e._localRoot || this._root).uuid
  43495. , i = e._clip.name
  43496. , n = this._actionsByClip[i];
  43497. this._bindAction(e, n && n.knownActions[0]),
  43498. this._addInactiveAction(e, i, t)
  43499. }
  43500. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43501. var s = r[o];
  43502. 0 == s.useCount++ && (this._lendBinding(s),
  43503. s.saveOriginalState())
  43504. }
  43505. this._lendAction(e)
  43506. }
  43507. },
  43508. _deactivateAction: function(e) {
  43509. if (this._isActiveAction(e)) {
  43510. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43511. var r = t[i];
  43512. 0 == --r.useCount && (r.restoreOriginalState(),
  43513. this._takeBackBinding(r))
  43514. }
  43515. this._takeBackAction(e)
  43516. }
  43517. },
  43518. _initMemoryManager: function() {
  43519. this._actions = [],
  43520. this._nActiveActions = 0,
  43521. this._actionsByClip = {},
  43522. this._bindings = [],
  43523. this._nActiveBindings = 0,
  43524. this._bindingsByRootAndName = {},
  43525. this._controlInterpolants = [],
  43526. this._nActiveControlInterpolants = 0;
  43527. var e = this;
  43528. this.stats = {
  43529. actions: {
  43530. get total() {
  43531. return e._actions.length
  43532. },
  43533. get inUse() {
  43534. return e._nActiveActions
  43535. }
  43536. },
  43537. bindings: {
  43538. get total() {
  43539. return e._bindings.length
  43540. },
  43541. get inUse() {
  43542. return e._nActiveBindings
  43543. }
  43544. },
  43545. controlInterpolants: {
  43546. get total() {
  43547. return e._controlInterpolants.length
  43548. },
  43549. get inUse() {
  43550. return e._nActiveControlInterpolants
  43551. }
  43552. }
  43553. }
  43554. },
  43555. _isActiveAction: function(e) {
  43556. var t = e._cacheIndex;
  43557. return null !== t && t < this._nActiveActions
  43558. },
  43559. _addInactiveAction: function(e, t, i) {
  43560. var n = this._actions
  43561. , r = this._actionsByClip
  43562. , o = r[t];
  43563. if (void 0 === o)
  43564. o = {
  43565. knownActions: [e],
  43566. actionByRoot: {}
  43567. },
  43568. e._byClipCacheIndex = 0,
  43569. r[t] = o;
  43570. else {
  43571. var a = o.knownActions;
  43572. e._byClipCacheIndex = a.length,
  43573. a.push(e)
  43574. }
  43575. e._cacheIndex = n.length,
  43576. n.push(e),
  43577. o.actionByRoot[i] = e
  43578. },
  43579. _removeInactiveAction: function(e) {
  43580. var t = this._actions
  43581. , i = t[t.length - 1]
  43582. , n = e._cacheIndex;
  43583. t[i._cacheIndex = n] = i,
  43584. t.pop(),
  43585. e._cacheIndex = null;
  43586. var r = e._clip.name
  43587. , o = this._actionsByClip
  43588. , a = o[r]
  43589. , s = a.knownActions
  43590. , l = s[s.length - 1]
  43591. , c = e._byClipCacheIndex;
  43592. s[l._byClipCacheIndex = c] = l,
  43593. s.pop(),
  43594. e._byClipCacheIndex = null,
  43595. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43596. 0 === s.length && delete o[r],
  43597. this._removeInactiveBindingsForAction(e)
  43598. },
  43599. _removeInactiveBindingsForAction: function(e) {
  43600. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43601. var r = t[i];
  43602. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43603. }
  43604. },
  43605. _lendAction: function(e) {
  43606. var t = this._actions
  43607. , i = e._cacheIndex
  43608. , n = this._nActiveActions++
  43609. , r = t[n];
  43610. t[e._cacheIndex = n] = e,
  43611. t[r._cacheIndex = i] = r
  43612. },
  43613. _takeBackAction: function(e) {
  43614. var t = this._actions
  43615. , i = e._cacheIndex
  43616. , n = --this._nActiveActions
  43617. , r = t[n];
  43618. t[e._cacheIndex = n] = e,
  43619. t[r._cacheIndex = i] = r
  43620. },
  43621. _addInactiveBinding: function(e, t, i) {
  43622. var n = this._bindingsByRootAndName
  43623. , r = n[t]
  43624. , o = this._bindings;
  43625. void 0 === r && (r = {},
  43626. n[t] = r),
  43627. (r[i] = e)._cacheIndex = o.length,
  43628. o.push(e)
  43629. },
  43630. _removeInactiveBinding: function(e) {
  43631. var t = this._bindings
  43632. , i = e.binding
  43633. , n = i.rootNode.uuid
  43634. , r = i.path
  43635. , o = this._bindingsByRootAndName
  43636. , a = o[n]
  43637. , s = t[t.length - 1]
  43638. , l = e._cacheIndex;
  43639. t[s._cacheIndex = l] = s,
  43640. t.pop(),
  43641. delete a[r];
  43642. e: {
  43643. for (var c in a)
  43644. break e;
  43645. delete o[n]
  43646. }
  43647. },
  43648. _lendBinding: function(e) {
  43649. var t = this._bindings
  43650. , i = e._cacheIndex
  43651. , n = this._nActiveBindings++
  43652. , r = t[n];
  43653. t[e._cacheIndex = n] = e,
  43654. t[r._cacheIndex = i] = r
  43655. },
  43656. _takeBackBinding: function(e) {
  43657. var t = this._bindings
  43658. , i = e._cacheIndex
  43659. , n = --this._nActiveBindings
  43660. , r = t[n];
  43661. t[e._cacheIndex = n] = e,
  43662. t[r._cacheIndex = i] = r
  43663. },
  43664. _lendControlInterpolant: function() {
  43665. var e = this._controlInterpolants
  43666. , t = this._nActiveControlInterpolants++
  43667. , i = e[t];
  43668. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43669. i
  43670. },
  43671. _takeBackControlInterpolant: function(e) {
  43672. var t = this._controlInterpolants
  43673. , i = e.__cacheIndex
  43674. , n = --this._nActiveControlInterpolants
  43675. , r = t[n];
  43676. t[e.__cacheIndex = n] = e,
  43677. t[r.__cacheIndex = i] = r
  43678. },
  43679. _controlInterpolantsResultBuffer: new Float32Array(1)
  43680. }),
  43681. Ci.AnimationObjectGroup = function(e) {
  43682. this.uuid = Ci.Math.generateUUID(),
  43683. this._objects = Array.prototype.slice.call(arguments),
  43684. this.nCachedObjects_ = 0;
  43685. var t = {};
  43686. this._indicesByUUID = t;
  43687. for (var i = 0, n = arguments.length; i !== n; ++i)
  43688. t[arguments[i].uuid] = i;
  43689. this._paths = [],
  43690. this._parsedPaths = [],
  43691. this._bindings = [],
  43692. this._bindingsIndicesByPath = {};
  43693. var r = this;
  43694. this.stats = {
  43695. objects: {
  43696. get total() {
  43697. return r._objects.length
  43698. },
  43699. get inUse() {
  43700. return this.total - r.nCachedObjects_
  43701. }
  43702. },
  43703. get bindingsPerObject() {
  43704. return r._bindings.length
  43705. }
  43706. }
  43707. }
  43708. ,
  43709. Ci.AnimationObjectGroup.prototype = {
  43710. constructor: Ci.AnimationObjectGroup,
  43711. add: function(e) {
  43712. 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) {
  43713. var u = arguments[c]
  43714. , d = u.uuid
  43715. , p = r[d];
  43716. if (void 0 === p) {
  43717. p = i++,
  43718. r[d] = p,
  43719. t.push(u);
  43720. for (var f = 0, g = l; f !== g; ++f)
  43721. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43722. } else if (p < n) {
  43723. var m = t[p]
  43724. , v = --n
  43725. , y = t[v];
  43726. t[r[y.uuid] = p] = y,
  43727. t[r[d] = v] = u;
  43728. for (f = 0,
  43729. g = l; f !== g; ++f) {
  43730. var A = s[f]
  43731. , C = A[v]
  43732. , I = A[p];
  43733. A[p] = C,
  43734. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43735. A[v] = I
  43736. }
  43737. } else
  43738. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43739. }
  43740. this.nCachedObjects_ = n
  43741. },
  43742. remove: function(e) {
  43743. for (var t = this._objects, i = (t.length,
  43744. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43745. var l = arguments[a]
  43746. , c = l.uuid
  43747. , h = n[c];
  43748. if (void 0 !== h && i <= h) {
  43749. var u = i++
  43750. , d = t[u];
  43751. t[n[d.uuid] = h] = d,
  43752. t[n[c] = u] = l;
  43753. for (var p = 0, f = o; p !== f; ++p) {
  43754. var g = r[p]
  43755. , m = g[u]
  43756. , v = g[h];
  43757. g[h] = m,
  43758. g[u] = v
  43759. }
  43760. }
  43761. }
  43762. this.nCachedObjects_ = i
  43763. },
  43764. uncache: function(e) {
  43765. 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) {
  43766. var c = arguments[s].uuid
  43767. , h = r[c];
  43768. if (void 0 !== h)
  43769. if (delete r[c],
  43770. h < n) {
  43771. var u = --n
  43772. , d = t[u]
  43773. , p = t[y = --i];
  43774. t[r[d.uuid] = h] = d,
  43775. t[r[p.uuid] = u] = p,
  43776. t.pop();
  43777. for (var f = 0, g = a; f !== g; ++f) {
  43778. var m = (A = o[f])[u]
  43779. , v = A[y];
  43780. A[h] = m,
  43781. A[u] = v,
  43782. A.pop()
  43783. }
  43784. } else {
  43785. var y;
  43786. t[r[(p = t[y = --i]).uuid] = h] = p,
  43787. t.pop();
  43788. for (f = 0,
  43789. g = a; f !== g; ++f) {
  43790. var A;
  43791. (A = o[f])[h] = A[y],
  43792. A.pop()
  43793. }
  43794. }
  43795. }
  43796. this.nCachedObjects_ = n
  43797. },
  43798. subscribe_: function(e, t) {
  43799. var i = this._bindingsIndicesByPath
  43800. , n = i[e]
  43801. , r = this._bindings;
  43802. if (void 0 !== n)
  43803. return r[n];
  43804. var o = this._paths
  43805. , a = this._parsedPaths
  43806. , s = this._objects
  43807. , l = s.length
  43808. , c = this.nCachedObjects_
  43809. , h = new Array(l);
  43810. n = r.length,
  43811. i[e] = n,
  43812. o.push(e),
  43813. a.push(t),
  43814. r.push(h);
  43815. for (var u = c, d = s.length; u !== d; ++u) {
  43816. var p = s[u];
  43817. h[u] = new Ci.PropertyBinding(p,e,t)
  43818. }
  43819. return h
  43820. },
  43821. unsubscribe_: function(e) {
  43822. var t = this._bindingsIndicesByPath
  43823. , i = t[e];
  43824. if (void 0 !== i) {
  43825. var n = this._paths
  43826. , r = this._parsedPaths
  43827. , o = this._bindings
  43828. , a = o.length - 1
  43829. , s = o[a];
  43830. o[t[e[a]] = i] = s,
  43831. o.pop(),
  43832. r[i] = r[a],
  43833. r.pop(),
  43834. n[i] = n[a],
  43835. n.pop()
  43836. }
  43837. }
  43838. },
  43839. Ci.AnimationUtils = {
  43840. arraySlice: function(e, t, i) {
  43841. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43842. },
  43843. convertArray: function(e, t, i) {
  43844. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43845. },
  43846. isTypedArray: function(e) {
  43847. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43848. },
  43849. getKeyframeOrder: function(i) {
  43850. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43851. t[n] = n;
  43852. return t.sort(function(e, t) {
  43853. return i[e] - i[t]
  43854. }),
  43855. t
  43856. },
  43857. sortedArray: function(e, t, i) {
  43858. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43859. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43860. r[a++] = e[s + l];
  43861. return r
  43862. },
  43863. flattenJSON: function(e, t, i, n) {
  43864. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43865. o = e[r++];
  43866. if (void 0 !== o) {
  43867. var a = o[n];
  43868. if (void 0 !== a)
  43869. if (Array.isArray(a))
  43870. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43871. i.push.apply(i, a)),
  43872. void 0 !== (o = e[r++]); )
  43873. ;
  43874. else if (void 0 !== a.toArray)
  43875. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43876. a.toArray(i, i.length)),
  43877. void 0 !== (o = e[r++]); )
  43878. ;
  43879. else
  43880. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43881. i.push(a)),
  43882. void 0 !== (o = e[r++]); )
  43883. ;
  43884. }
  43885. }
  43886. },
  43887. Ci.KeyframeTrack = function(e, t, i, n) {
  43888. if (void 0 === e)
  43889. throw new Error("track name is undefined");
  43890. if (void 0 === t || 0 === t.length)
  43891. throw new Error("no keyframes in track named " + e);
  43892. this.name = e,
  43893. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43894. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43895. this.setInterpolation(n || this.DefaultInterpolation),
  43896. this.validate(),
  43897. this.optimize()
  43898. }
  43899. ,
  43900. Ci.KeyframeTrack.prototype = {
  43901. constructor: Ci.KeyframeTrack,
  43902. TimeBufferType: Float32Array,
  43903. ValueBufferType: Float32Array,
  43904. DefaultInterpolation: Ci.InterpolateLinear,
  43905. InterpolantFactoryMethodDiscrete: function(e) {
  43906. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43907. },
  43908. InterpolantFactoryMethodLinear: function(e) {
  43909. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43910. },
  43911. InterpolantFactoryMethodSmooth: function(e) {
  43912. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43913. },
  43914. setInterpolation: function(e) {
  43915. var t = void 0;
  43916. switch (e) {
  43917. case Ci.InterpolateDiscrete:
  43918. t = this.InterpolantFactoryMethodDiscrete;
  43919. break;
  43920. case Ci.InterpolateLinear:
  43921. t = this.InterpolantFactoryMethodLinear;
  43922. break;
  43923. case Ci.InterpolateSmooth:
  43924. t = this.InterpolantFactoryMethodSmooth
  43925. }
  43926. if (void 0 !== t)
  43927. this.createInterpolant = t;
  43928. else {
  43929. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43930. if (void 0 === this.createInterpolant) {
  43931. if (e === this.DefaultInterpolation)
  43932. throw new Error(i);
  43933. this.setInterpolation(this.DefaultInterpolation)
  43934. }
  43935. console.warn(i)
  43936. }
  43937. },
  43938. getInterpolation: function() {
  43939. switch (this.createInterpolant) {
  43940. case this.InterpolantFactoryMethodDiscrete:
  43941. return Ci.InterpolateDiscrete;
  43942. case this.InterpolantFactoryMethodLinear:
  43943. return Ci.InterpolateLinear;
  43944. case this.InterpolantFactoryMethodSmooth:
  43945. return Ci.InterpolateSmooth
  43946. }
  43947. },
  43948. getValueSize: function() {
  43949. return this.values.length / this.times.length
  43950. },
  43951. shift: function(e) {
  43952. if (0 !== e)
  43953. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43954. t[i] += e;
  43955. return this
  43956. },
  43957. scale: function(e) {
  43958. if (1 !== e)
  43959. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43960. t[i] *= e;
  43961. return this
  43962. },
  43963. trim: function(e, t) {
  43964. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43965. ++r;
  43966. for (; -1 !== o && i[o] > t; )
  43967. --o;
  43968. if (++o,
  43969. 0 !== r || o !== n) {
  43970. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43971. var a = this.getValueSize();
  43972. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43973. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43974. }
  43975. return this
  43976. },
  43977. validate: function() {
  43978. var e = !0
  43979. , t = this.getValueSize();
  43980. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43981. e = !1);
  43982. var i = this.times
  43983. , n = this.values
  43984. , r = i.length;
  43985. 0 === r && (console.error("track is empty", this),
  43986. e = !1);
  43987. for (var o = null, a = 0; a !== r; a++) {
  43988. var s = i[a];
  43989. if ("number" == typeof s && isNaN(s)) {
  43990. console.error("time is not a valid number", this, a, s),
  43991. e = !1;
  43992. break
  43993. }
  43994. if (null !== o && s < o) {
  43995. console.error("out of order keys", this, a, s, o),
  43996. e = !1;
  43997. break
  43998. }
  43999. o = s
  44000. }
  44001. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44002. a = 0;
  44003. for (var l = n.length; a !== l; ++a) {
  44004. var c = n[a];
  44005. if (isNaN(c)) {
  44006. console.error("value is not a valid number", this, a, c),
  44007. e = !1;
  44008. break
  44009. }
  44010. }
  44011. }
  44012. return e
  44013. },
  44014. optimize: function() {
  44015. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44016. var a = !1
  44017. , s = e[r];
  44018. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44019. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44020. var d = t[l + u];
  44021. if (d !== t[c + u] || d !== t[h + u]) {
  44022. a = !0;
  44023. break
  44024. }
  44025. }
  44026. if (a) {
  44027. if (r !== n) {
  44028. e[n] = e[r];
  44029. var p = r * i
  44030. , f = n * i;
  44031. for (u = 0; u !== i; ++u)
  44032. t[f + u] = t[p + u]
  44033. }
  44034. ++n
  44035. }
  44036. }
  44037. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44038. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44039. this
  44040. }
  44041. },
  44042. Object.assign(Ci.KeyframeTrack, {
  44043. parse: function(e) {
  44044. if (void 0 === e.type)
  44045. throw new Error("track type undefined, can not parse");
  44046. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44047. if (void 0 === e.times) {
  44048. console.warn("legacy JSON format detected, converting");
  44049. var i = []
  44050. , n = [];
  44051. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44052. e.times = i,
  44053. e.values = n
  44054. }
  44055. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44056. },
  44057. toJSON: function(e) {
  44058. var t, i = e.constructor;
  44059. if (void 0 !== i.toJSON)
  44060. t = i.toJSON(e);
  44061. else {
  44062. t = {
  44063. name: e.name,
  44064. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44065. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44066. };
  44067. var n = e.getInterpolation();
  44068. n !== e.DefaultInterpolation && (t.interpolation = n)
  44069. }
  44070. return t.type = e.ValueTypeName,
  44071. t
  44072. },
  44073. _getTrackTypeForValueTypeName: function(e) {
  44074. switch (e.toLowerCase()) {
  44075. case "scalar":
  44076. case "double":
  44077. case "float":
  44078. case "number":
  44079. case "integer":
  44080. return Ci.NumberKeyframeTrack;
  44081. case "vector":
  44082. case "vector2":
  44083. case "vector3":
  44084. case "vector4":
  44085. return Ci.VectorKeyframeTrack;
  44086. case "color":
  44087. return Ci.ColorKeyframeTrack;
  44088. case "quaternion":
  44089. return Ci.QuaternionKeyframeTrack;
  44090. case "bool":
  44091. case "boolean":
  44092. return Ci.BooleanKeyframeTrack;
  44093. case "string":
  44094. return Ci.StringKeyframeTrack
  44095. }
  44096. throw new Error("Unsupported typeName: " + e)
  44097. }
  44098. }),
  44099. Ci.PropertyBinding = function(e, t, i) {
  44100. this.path = t,
  44101. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44102. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44103. this.rootNode = e
  44104. }
  44105. ,
  44106. Ci.PropertyBinding.prototype = {
  44107. constructor: Ci.PropertyBinding,
  44108. getValue: function(e, t) {
  44109. this.bind(),
  44110. this.getValue(e, t)
  44111. },
  44112. setValue: function(e, t) {
  44113. this.bind(),
  44114. this.setValue(e, t)
  44115. },
  44116. bind: function() {
  44117. var e = this.node
  44118. , t = this.parsedPath
  44119. , i = t.objectName
  44120. , n = t.propertyName
  44121. , r = t.propertyIndex;
  44122. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44123. this.node = e),
  44124. this.getValue = this._getValue_unavailable,
  44125. this.setValue = this._setValue_unavailable,
  44126. e) {
  44127. if (i) {
  44128. var o = t.objectIndex;
  44129. switch (i) {
  44130. case "materials":
  44131. if (!e.material)
  44132. return void console.error(" can not bind to material as node does not have a material", this);
  44133. if (!e.material.materials)
  44134. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44135. e = e.material.materials;
  44136. break;
  44137. case "bones":
  44138. if (!e.skeleton)
  44139. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44140. e = e.skeleton.bones;
  44141. for (var a = 0; a < e.length; a++)
  44142. if (e[a].name === o) {
  44143. o = a;
  44144. break
  44145. }
  44146. break;
  44147. default:
  44148. if (void 0 === e[i])
  44149. return void console.error(" can not bind to objectName of node, undefined", this);
  44150. e = e[i]
  44151. }
  44152. if (void 0 !== o) {
  44153. if (void 0 === e[o])
  44154. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44155. e = e[o]
  44156. }
  44157. }
  44158. var s = e[n];
  44159. if (s) {
  44160. var l = this.Versioning.None;
  44161. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44162. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44163. this.targetObject = e);
  44164. var c = this.BindingType.Direct;
  44165. if (void 0 !== r) {
  44166. if ("morphTargetInfluences" === n) {
  44167. if (!e.geometry)
  44168. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44169. if (!e.geometry.morphTargets)
  44170. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44171. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44172. if (e.geometry.morphTargets[a].name === r) {
  44173. r = a;
  44174. break
  44175. }
  44176. }
  44177. c = this.BindingType.ArrayElement,
  44178. this.resolvedProperty = s,
  44179. this.propertyIndex = r
  44180. } else
  44181. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44182. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44183. this.resolvedProperty = s) : this.propertyName = n;
  44184. this.getValue = this.GetterByBindingType[c],
  44185. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44186. } else {
  44187. var h = t.nodeName;
  44188. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44189. }
  44190. } else
  44191. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44192. },
  44193. unbind: function() {
  44194. this.node = null,
  44195. this.getValue = this._getValue_unbound,
  44196. this.setValue = this._setValue_unbound
  44197. }
  44198. },
  44199. Object.assign(Ci.PropertyBinding.prototype, {
  44200. _getValue_unavailable: function() {},
  44201. _setValue_unavailable: function() {},
  44202. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44203. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44204. BindingType: {
  44205. Direct: 0,
  44206. EntireArray: 1,
  44207. ArrayElement: 2,
  44208. HasFromToArray: 3
  44209. },
  44210. Versioning: {
  44211. None: 0,
  44212. NeedsUpdate: 1,
  44213. MatrixWorldNeedsUpdate: 2
  44214. },
  44215. GetterByBindingType: [function(e, t) {
  44216. e[t] = this.node[this.propertyName]
  44217. }
  44218. , function(e, t) {
  44219. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44220. e[t++] = i[n]
  44221. }
  44222. , function(e, t) {
  44223. e[t] = this.resolvedProperty[this.propertyIndex]
  44224. }
  44225. , function(e, t) {
  44226. this.resolvedProperty.toArray(e, t)
  44227. }
  44228. ],
  44229. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44230. this.node[this.propertyName] = e[t]
  44231. }
  44232. , function(e, t) {
  44233. this.node[this.propertyName] = e[t],
  44234. this.targetObject.needsUpdate = !0
  44235. }
  44236. , function(e, t) {
  44237. this.node[this.propertyName] = e[t],
  44238. this.targetObject.matrixWorldNeedsUpdate = !0
  44239. }
  44240. ], [function(e, t) {
  44241. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44242. i[n] = e[t++]
  44243. }
  44244. , function(e, t) {
  44245. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44246. i[n] = e[t++];
  44247. this.targetObject.needsUpdate = !0
  44248. }
  44249. , function(e, t) {
  44250. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44251. i[n] = e[t++];
  44252. this.targetObject.matrixWorldNeedsUpdate = !0
  44253. }
  44254. ], [function(e, t) {
  44255. this.resolvedProperty[this.propertyIndex] = e[t]
  44256. }
  44257. , function(e, t) {
  44258. this.resolvedProperty[this.propertyIndex] = e[t],
  44259. this.targetObject.needsUpdate = !0
  44260. }
  44261. , function(e, t) {
  44262. this.resolvedProperty[this.propertyIndex] = e[t],
  44263. this.targetObject.matrixWorldNeedsUpdate = !0
  44264. }
  44265. ], [function(e, t) {
  44266. this.resolvedProperty.fromArray(e, t)
  44267. }
  44268. , function(e, t) {
  44269. this.resolvedProperty.fromArray(e, t),
  44270. this.targetObject.needsUpdate = !0
  44271. }
  44272. , function(e, t) {
  44273. this.resolvedProperty.fromArray(e, t),
  44274. this.targetObject.matrixWorldNeedsUpdate = !0
  44275. }
  44276. ]]
  44277. }),
  44278. Ci.PropertyBinding.Composite = function(e, t, i) {
  44279. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44280. this._targetGroup = e,
  44281. this._bindings = e.subscribe_(t, n)
  44282. }
  44283. ,
  44284. Ci.PropertyBinding.Composite.prototype = {
  44285. constructor: Ci.PropertyBinding.Composite,
  44286. getValue: function(e, t) {
  44287. this.bind();
  44288. var i = this._targetGroup.nCachedObjects_
  44289. , n = this._bindings[i];
  44290. void 0 !== n && n.getValue(e, t)
  44291. },
  44292. setValue: function(e, t) {
  44293. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44294. i[n].setValue(e, t)
  44295. },
  44296. bind: function() {
  44297. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44298. e[t].bind()
  44299. },
  44300. unbind: function() {
  44301. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44302. e[t].unbind()
  44303. }
  44304. },
  44305. Ci.PropertyBinding.create = function(e, t, i) {
  44306. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44307. }
  44308. ,
  44309. Ci.PropertyBinding.parseTrackName = function(e) {
  44310. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44311. , i = t.exec(e);
  44312. if (!i)
  44313. throw new Error("cannot parse trackName at all: " + e);
  44314. i.index === t.lastIndex && t.lastIndex++;
  44315. var n = {
  44316. nodeName: i[3],
  44317. objectName: i[5],
  44318. objectIndex: i[7],
  44319. propertyName: i[9],
  44320. propertyIndex: i[11]
  44321. };
  44322. if (null === n.propertyName || 0 === n.propertyName.length)
  44323. throw new Error("can not parse propertyName from trackName: " + e);
  44324. return n
  44325. }
  44326. ,
  44327. Ci.PropertyBinding.findNode = function(e, r) {
  44328. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44329. return e;
  44330. if (e.skeleton) {
  44331. var t = function(e) {
  44332. for (var t = 0; t < e.bones.length; t++) {
  44333. var i = e.bones[t];
  44334. if (i.name === r)
  44335. return i
  44336. }
  44337. return null
  44338. }(e.skeleton);
  44339. if (t)
  44340. return t
  44341. }
  44342. if (e.children) {
  44343. var o = function(e) {
  44344. for (var t = 0; t < e.length; t++) {
  44345. var i = e[t];
  44346. if (i.name === r || i.uuid === r)
  44347. return i;
  44348. var n = o(i.children);
  44349. if (n)
  44350. return n
  44351. }
  44352. return null
  44353. }
  44354. , i = o(e.children);
  44355. if (i)
  44356. return i
  44357. }
  44358. return null
  44359. }
  44360. ,
  44361. Ci.PropertyMixer = function(e, t, i) {
  44362. this.binding = e,
  44363. this.valueSize = i;
  44364. var n, r = Float64Array;
  44365. switch (t) {
  44366. case "quaternion":
  44367. n = this._slerp;
  44368. break;
  44369. case "string":
  44370. case "bool":
  44371. r = Array,
  44372. n = this._select;
  44373. break;
  44374. default:
  44375. n = this._lerp
  44376. }
  44377. this.buffer = new r(4 * i),
  44378. this._mixBufferRegion = n,
  44379. this.cumulativeWeight = 0,
  44380. this.useCount = 0,
  44381. this.referenceCount = 0
  44382. }
  44383. ,
  44384. Ci.PropertyMixer.prototype = {
  44385. constructor: Ci.PropertyMixer,
  44386. accumulate: function(e, t) {
  44387. var i = this.buffer
  44388. , n = this.valueSize
  44389. , r = e * n + n
  44390. , o = this.cumulativeWeight;
  44391. if (0 === o) {
  44392. for (var a = 0; a !== n; ++a)
  44393. i[r + a] = i[a];
  44394. o = t
  44395. } else {
  44396. var s = t / (o += t);
  44397. this._mixBufferRegion(i, r, 0, s, n)
  44398. }
  44399. this.cumulativeWeight = o
  44400. },
  44401. apply: function(e) {
  44402. var t = this.valueSize
  44403. , i = this.buffer
  44404. , n = e * t + t
  44405. , r = this.cumulativeWeight
  44406. , o = this.binding;
  44407. if (this.cumulativeWeight = 0,
  44408. r < 1) {
  44409. var a = 3 * t;
  44410. this._mixBufferRegion(i, n, a, 1 - r, t)
  44411. }
  44412. for (var s = t, l = t + t; s !== l; ++s)
  44413. if (i[s] !== i[s + t]) {
  44414. o.setValue(i, n);
  44415. break
  44416. }
  44417. },
  44418. saveOriginalState: function() {
  44419. var e = this.binding
  44420. , t = this.buffer
  44421. , i = this.valueSize
  44422. , n = 3 * i;
  44423. e.getValue(t, n);
  44424. for (var r = i, o = n; r !== o; ++r)
  44425. t[r] = t[n + r % i];
  44426. this.cumulativeWeight = 0
  44427. },
  44428. restoreOriginalState: function() {
  44429. var e = 3 * this.valueSize;
  44430. this.binding.setValue(this.buffer, e)
  44431. },
  44432. _select: function(e, t, i, n, r) {
  44433. if (.5 <= n)
  44434. for (var o = 0; o !== r; ++o)
  44435. e[t + o] = e[i + o]
  44436. },
  44437. _slerp: function(e, t, i, n, r) {
  44438. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44439. },
  44440. _lerp: function(e, t, i, n, r) {
  44441. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44442. var s = t + a;
  44443. e[s] = e[s] * o + e[i + a] * n
  44444. }
  44445. }
  44446. },
  44447. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44448. Ci.KeyframeTrack.call(this, e, t, i)
  44449. }
  44450. ,
  44451. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44452. constructor: Ci.BooleanKeyframeTrack,
  44453. ValueTypeName: "bool",
  44454. ValueBufferType: Array,
  44455. DefaultInterpolation: Ci.IntepolateDiscrete,
  44456. InterpolantFactoryMethodLinear: void 0,
  44457. InterpolantFactoryMethodSmooth: void 0
  44458. }),
  44459. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44460. Ci.KeyframeTrack.call(this, e, t, i, n)
  44461. }
  44462. ,
  44463. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44464. constructor: Ci.NumberKeyframeTrack,
  44465. ValueTypeName: "number"
  44466. }),
  44467. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44468. Ci.KeyframeTrack.call(this, e, t, i, n)
  44469. }
  44470. ,
  44471. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44472. constructor: Ci.QuaternionKeyframeTrack,
  44473. ValueTypeName: "quaternion",
  44474. DefaultInterpolation: Ci.InterpolateLinear,
  44475. InterpolantFactoryMethodLinear: function(e) {
  44476. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44477. },
  44478. InterpolantFactoryMethodSmooth: void 0
  44479. }),
  44480. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44481. Ci.KeyframeTrack.call(this, e, t, i, n)
  44482. }
  44483. ,
  44484. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44485. constructor: Ci.StringKeyframeTrack,
  44486. ValueTypeName: "string",
  44487. ValueBufferType: Array,
  44488. DefaultInterpolation: Ci.IntepolateDiscrete,
  44489. InterpolantFactoryMethodLinear: void 0,
  44490. InterpolantFactoryMethodSmooth: void 0
  44491. }),
  44492. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44493. Ci.KeyframeTrack.call(this, e, t, i, n)
  44494. }
  44495. ,
  44496. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44497. constructor: Ci.VectorKeyframeTrack,
  44498. ValueTypeName: "vector"
  44499. }),
  44500. Ci.Audio = function(e) {
  44501. Ci.Object3D.call(this),
  44502. this.type = "Audio",
  44503. this.context = e.context,
  44504. this.source = this.context.createBufferSource(),
  44505. this.source.onended = this.onEnded.bind(this),
  44506. this.gain = this.context.createGain(),
  44507. this.gain.connect(e.getInput()),
  44508. this.autoplay = !1,
  44509. this.startTime = 0,
  44510. this.playbackRate = 1,
  44511. this.isPlaying = !1,
  44512. this.hasPlaybackControl = !0,
  44513. this.sourceType = "empty",
  44514. this.filter = null
  44515. }
  44516. ,
  44517. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44518. Ci.Audio.prototype.constructor = Ci.Audio,
  44519. Ci.Audio.prototype.getOutput = function() {
  44520. return this.gain
  44521. }
  44522. ,
  44523. Ci.Audio.prototype.load = function(e) {
  44524. var t = new Ci.AudioBuffer(this.context);
  44525. return t.load(e),
  44526. this.setBuffer(t),
  44527. this
  44528. }
  44529. ,
  44530. Ci.Audio.prototype.setNodeSource = function(e) {
  44531. return this.hasPlaybackControl = !1,
  44532. this.sourceType = "audioNode",
  44533. this.source = e,
  44534. this.connect(),
  44535. this
  44536. }
  44537. ,
  44538. Ci.Audio.prototype.setBuffer = function(e) {
  44539. var t = this;
  44540. return e.onReady(function(e) {
  44541. t.source.buffer = e,
  44542. t.sourceType = "buffer",
  44543. t.autoplay && t.play()
  44544. }),
  44545. this
  44546. }
  44547. ,
  44548. Ci.Audio.prototype.play = function() {
  44549. if (!0 !== this.isPlaying)
  44550. if (!1 !== this.hasPlaybackControl) {
  44551. var e = this.context.createBufferSource();
  44552. e.buffer = this.source.buffer,
  44553. e.loop = this.source.loop,
  44554. e.onended = this.source.onended,
  44555. e.start(0, this.startTime),
  44556. e.playbackRate.value = this.playbackRate,
  44557. this.isPlaying = !0,
  44558. this.source = e,
  44559. this.connect()
  44560. } else
  44561. console.warn("THREE.Audio: this Audio has no playback control.");
  44562. else
  44563. console.warn("THREE.Audio: Audio is already playing.")
  44564. }
  44565. ,
  44566. Ci.Audio.prototype.pause = function() {
  44567. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44568. void (this.startTime = this.context.currentTime))
  44569. }
  44570. ,
  44571. Ci.Audio.prototype.stop = function() {
  44572. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44573. void (this.startTime = 0))
  44574. }
  44575. ,
  44576. Ci.Audio.prototype.connect = function() {
  44577. null !== this.filter ? (this.source.connect(this.filter),
  44578. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44579. }
  44580. ,
  44581. Ci.Audio.prototype.disconnect = function() {
  44582. null !== this.filter ? (this.source.disconnect(this.filter),
  44583. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44584. }
  44585. ,
  44586. Ci.Audio.prototype.getFilter = function() {
  44587. return this.filter
  44588. }
  44589. ,
  44590. Ci.Audio.prototype.setFilter = function(e) {
  44591. void 0 === e && (e = null),
  44592. !0 === this.isPlaying ? (this.disconnect(),
  44593. this.filter = e,
  44594. this.connect()) : this.filter = e
  44595. }
  44596. ,
  44597. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44598. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44599. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44600. }
  44601. ,
  44602. Ci.Audio.prototype.getPlaybackRate = function() {
  44603. return this.playbackRate
  44604. }
  44605. ,
  44606. Ci.Audio.prototype.onEnded = function() {
  44607. this.isPlaying = !1
  44608. }
  44609. ,
  44610. Ci.Audio.prototype.setLoop = function(e) {
  44611. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44612. }
  44613. ,
  44614. Ci.Audio.prototype.getLoop = function() {
  44615. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44616. !1) : this.source.loop
  44617. }
  44618. ,
  44619. Ci.Audio.prototype.setVolume = function(e) {
  44620. this.gain.gain.value = e
  44621. }
  44622. ,
  44623. Ci.Audio.prototype.getVolume = function() {
  44624. return this.gain.gain.value
  44625. }
  44626. ,
  44627. Ci.AudioAnalyser = function(e, t) {
  44628. this.analyser = e.context.createAnalyser(),
  44629. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44630. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44631. e.getOutput().connect(this.analyser)
  44632. }
  44633. ,
  44634. Ci.AudioAnalyser.prototype = {
  44635. constructor: Ci.AudioAnalyser,
  44636. getData: function() {
  44637. return this.analyser.getByteFrequencyData(this.data),
  44638. this.data
  44639. }
  44640. },
  44641. Ci.AudioBuffer = function(e) {
  44642. this.context = e,
  44643. this.ready = !1,
  44644. this.readyCallbacks = []
  44645. }
  44646. ,
  44647. Ci.AudioBuffer.prototype.load = function(e) {
  44648. var i = this
  44649. , t = new XMLHttpRequest;
  44650. return t.open("GET", e, !0),
  44651. t.responseType = "arraybuffer",
  44652. t.onload = function(e) {
  44653. i.context.decodeAudioData(this.response, function(e) {
  44654. i.buffer = e,
  44655. i.ready = !0;
  44656. for (var t = 0; t < i.readyCallbacks.length; t++)
  44657. i.readyCallbacks[t](i.buffer);
  44658. i.readyCallbacks = []
  44659. })
  44660. }
  44661. ,
  44662. t.send(),
  44663. this
  44664. }
  44665. ,
  44666. Ci.AudioBuffer.prototype.onReady = function(e) {
  44667. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44668. }
  44669. ,
  44670. Ci.PositionalAudio = function(e) {
  44671. Ci.Audio.call(this, e),
  44672. this.panner = this.context.createPanner(),
  44673. this.panner.connect(this.gain)
  44674. }
  44675. ,
  44676. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44677. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44678. Ci.PositionalAudio.prototype.getOutput = function() {
  44679. return this.panner
  44680. }
  44681. ,
  44682. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44683. this.panner.refDistance = e
  44684. }
  44685. ,
  44686. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44687. return this.panner.refDistance
  44688. }
  44689. ,
  44690. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44691. this.panner.rolloffFactor = e
  44692. }
  44693. ,
  44694. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44695. return this.panner.rolloffFactor
  44696. }
  44697. ,
  44698. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44699. this.panner.distanceModel = e
  44700. }
  44701. ,
  44702. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44703. return this.panner.distanceModel
  44704. }
  44705. ,
  44706. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44707. this.panner.maxDistance = e
  44708. }
  44709. ,
  44710. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44711. return this.panner.maxDistance
  44712. }
  44713. ,
  44714. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44715. function(e) {
  44716. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44717. it.setFromMatrixPosition(this.matrixWorld),
  44718. this.panner.setPosition(it.x, it.y, it.z)
  44719. }
  44720. ),
  44721. Ci.AudioListener = function() {
  44722. Ci.Object3D.call(this),
  44723. this.type = "AudioListener",
  44724. this.context = new (window.AudioContext || window.webkitAudioContext),
  44725. this.gain = this.context.createGain(),
  44726. this.gain.connect(this.context.destination),
  44727. this.filter = null
  44728. }
  44729. ,
  44730. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44731. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44732. Ci.AudioListener.prototype.getInput = function() {
  44733. return this.gain
  44734. }
  44735. ,
  44736. Ci.AudioListener.prototype.removeFilter = function() {
  44737. null !== this.filter && (this.gain.disconnect(this.filter),
  44738. this.filter.disconnect(this.context.destination),
  44739. this.gain.connect(this.context.destination),
  44740. this.filter = null)
  44741. }
  44742. ,
  44743. Ci.AudioListener.prototype.setFilter = function(e) {
  44744. null !== this.filter ? (this.gain.disconnect(this.filter),
  44745. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44746. this.filter = e,
  44747. this.gain.connect(this.filter),
  44748. this.filter.connect(this.context.destination)
  44749. }
  44750. ,
  44751. Ci.AudioListener.prototype.getFilter = function() {
  44752. return this.filter
  44753. }
  44754. ,
  44755. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44756. this.gain.gain.value = e
  44757. }
  44758. ,
  44759. Ci.AudioListener.prototype.getMasterVolume = function() {
  44760. return this.gain.gain.value
  44761. }
  44762. ,
  44763. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44764. $e = new Ci.Quaternion,
  44765. et = new Ci.Vector3,
  44766. tt = new Ci.Vector3,
  44767. function(e) {
  44768. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44769. var t = this.context.listener
  44770. , i = this.up;
  44771. this.matrixWorld.decompose(Je, $e, et),
  44772. tt.set(0, 0, -1).applyQuaternion($e),
  44773. t.setPosition(Je.x, Je.y, Je.z),
  44774. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44775. }
  44776. ),
  44777. Ci.Camera = function() {
  44778. Ci.Object3D.call(this),
  44779. this.type = "Camera",
  44780. this.matrixWorldInverse = new Ci.Matrix4,
  44781. this.projectionMatrix = new Ci.Matrix4
  44782. }
  44783. ,
  44784. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44785. Ci.Camera.prototype.constructor = Ci.Camera,
  44786. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44787. function(e) {
  44788. var t = e || new Ci.Vector3;
  44789. return this.getWorldQuaternion(Qe),
  44790. t.set(0, 0, -1).applyQuaternion(Qe)
  44791. }
  44792. ),
  44793. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44794. function(e) {
  44795. Ke.lookAt(this.position, e, this.up),
  44796. this.quaternion.setFromRotationMatrix(Ke)
  44797. }
  44798. ),
  44799. Ci.Camera.prototype.clone = function() {
  44800. return (new this.constructor).copy(this)
  44801. }
  44802. ,
  44803. Ci.Camera.prototype.copy = function(e) {
  44804. return Ci.Object3D.prototype.copy.call(this, e),
  44805. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44806. this.projectionMatrix.copy(e.projectionMatrix),
  44807. this
  44808. }
  44809. ,
  44810. Ci.CubeCamera = function(e, t, i) {
  44811. Ci.Object3D.call(this),
  44812. this.type = "CubeCamera";
  44813. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44814. r.up.set(0, -1, 0),
  44815. r.lookAt(new Ci.Vector3(1,0,0)),
  44816. this.add(r);
  44817. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44818. o.up.set(0, -1, 0),
  44819. o.lookAt(new Ci.Vector3(-1,0,0)),
  44820. this.add(o);
  44821. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44822. a.up.set(0, 0, 1),
  44823. a.lookAt(new Ci.Vector3(0,1,0)),
  44824. this.add(a);
  44825. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44826. s.up.set(0, 0, -1),
  44827. s.lookAt(new Ci.Vector3(0,-1,0)),
  44828. this.add(s);
  44829. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44830. l.up.set(0, -1, 0),
  44831. l.lookAt(new Ci.Vector3(0,0,1)),
  44832. this.add(l);
  44833. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44834. c.up.set(0, -1, 0),
  44835. c.lookAt(new Ci.Vector3(0,0,-1)),
  44836. this.add(c);
  44837. var n = {
  44838. format: Ci.RGBFormat,
  44839. magFilter: Ci.LinearFilter,
  44840. minFilter: Ci.LinearFilter
  44841. };
  44842. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44843. this.updateCubeMap = function(e, t) {
  44844. null === this.parent && this.updateMatrixWorld();
  44845. var i = this.renderTarget
  44846. , n = i.texture.generateMipmaps;
  44847. i.texture.generateMipmaps = !1,
  44848. i.activeCubeFace = 0,
  44849. e.render(t, r, i),
  44850. i.activeCubeFace = 1,
  44851. e.render(t, o, i),
  44852. i.activeCubeFace = 2,
  44853. e.render(t, a, i),
  44854. i.activeCubeFace = 3,
  44855. e.render(t, s, i),
  44856. i.activeCubeFace = 4,
  44857. e.render(t, l, i),
  44858. i.texture.generateMipmaps = n,
  44859. i.activeCubeFace = 5,
  44860. e.render(t, c, i),
  44861. e.setRenderTarget(null)
  44862. }
  44863. }
  44864. ,
  44865. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44866. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44867. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44868. Ci.Camera.call(this),
  44869. this.type = "OrthographicCamera",
  44870. this.zoom = 1,
  44871. this.left = e,
  44872. this.right = t,
  44873. this.top = i,
  44874. this.bottom = n,
  44875. this.near = void 0 !== r ? r : .1,
  44876. this.far = void 0 !== o ? o : 2e3,
  44877. this.updateProjectionMatrix()
  44878. }
  44879. ,
  44880. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44881. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44882. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44883. var e = (this.right - this.left) / (2 * this.zoom)
  44884. , t = (this.top - this.bottom) / (2 * this.zoom)
  44885. , i = (this.right + this.left) / 2
  44886. , n = (this.top + this.bottom) / 2;
  44887. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44888. }
  44889. ,
  44890. Ci.OrthographicCamera.prototype.copy = function(e) {
  44891. return Ci.Camera.prototype.copy.call(this, e),
  44892. this.left = e.left,
  44893. this.right = e.right,
  44894. this.top = e.top,
  44895. this.bottom = e.bottom,
  44896. this.near = e.near,
  44897. this.far = e.far,
  44898. this.zoom = e.zoom,
  44899. this
  44900. }
  44901. ,
  44902. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44903. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44904. return t.object.zoom = this.zoom,
  44905. t.object.left = this.left,
  44906. t.object.right = this.right,
  44907. t.object.top = this.top,
  44908. t.object.bottom = this.bottom,
  44909. t.object.near = this.near,
  44910. t.object.far = this.far,
  44911. t
  44912. }
  44913. ,
  44914. Ci.PerspectiveCamera = function(e, t, i, n) {
  44915. Ci.Camera.call(this),
  44916. this.type = "PerspectiveCamera",
  44917. this.focalLength = 10,
  44918. this.zoom = 1,
  44919. this.fov = void 0 !== e ? e : 50,
  44920. this.aspect = void 0 !== t ? t : 1,
  44921. this.near = void 0 !== i ? i : .1,
  44922. this.far = void 0 !== n ? n : 2e3,
  44923. this.updateProjectionMatrix()
  44924. }
  44925. ,
  44926. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44927. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44928. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44929. void 0 === t && (t = 24),
  44930. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44931. this.updateProjectionMatrix()
  44932. }
  44933. ,
  44934. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44935. this.fullWidth = e,
  44936. this.fullHeight = t,
  44937. this.x = i,
  44938. this.y = n,
  44939. this.width = r,
  44940. this.height = o,
  44941. this.updateProjectionMatrix()
  44942. }
  44943. ,
  44944. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44945. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44946. if (this.fullWidth) {
  44947. var t = this.fullWidth / this.fullHeight
  44948. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44949. , n = -i
  44950. , r = t * n
  44951. , o = t * i
  44952. , a = Math.abs(o - r)
  44953. , s = Math.abs(i - n);
  44954. 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)
  44955. } else
  44956. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44957. }
  44958. ,
  44959. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44960. return Ci.Camera.prototype.copy.call(this, e),
  44961. this.focalLength = e.focalLength,
  44962. this.zoom = e.zoom,
  44963. this.fov = e.fov,
  44964. this.aspect = e.aspect,
  44965. this.near = e.near,
  44966. this.far = e.far,
  44967. this
  44968. }
  44969. ,
  44970. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44971. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44972. return t.object.focalLength = this.focalLength,
  44973. t.object.zoom = this.zoom,
  44974. t.object.fov = this.fov,
  44975. t.object.aspect = this.aspect,
  44976. t.object.near = this.near,
  44977. t.object.far = this.far,
  44978. t
  44979. }
  44980. ,
  44981. Ci.StereoCamera = function() {
  44982. this.type = "StereoCamera",
  44983. this.aspect = 1,
  44984. this.cameraL = new Ci.PerspectiveCamera,
  44985. this.cameraL.layers.enable(1),
  44986. this.cameraL.matrixAutoUpdate = !1,
  44987. this.cameraR = new Ci.PerspectiveCamera,
  44988. this.cameraR.layers.enable(2),
  44989. this.cameraR.matrixAutoUpdate = !1
  44990. }
  44991. ,
  44992. Ci.StereoCamera.prototype = {
  44993. constructor: Ci.StereoCamera,
  44994. update: (Xe = new Ci.Matrix4,
  44995. Ze = new Ci.Matrix4,
  44996. function(e) {
  44997. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44998. Ge = e.focalLength,
  44999. We = e.fov,
  45000. je = e.aspect * this.aspect,
  45001. Ye = e.near,
  45002. qe = e.far;
  45003. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45004. Ze.elements[12] = -.032,
  45005. Xe.elements[12] = .032,
  45006. t = -o * je + r,
  45007. i = o * je + r,
  45008. n.elements[0] = 2 * Ye / (i - t),
  45009. n.elements[8] = (i + t) / (i - t),
  45010. this.cameraL.projectionMatrix.copy(n),
  45011. t = -o * je - r,
  45012. i = o * je - r,
  45013. n.elements[0] = 2 * Ye / (i - t),
  45014. n.elements[8] = (i + t) / (i - t),
  45015. this.cameraR.projectionMatrix.copy(n)
  45016. }
  45017. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45018. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45019. }
  45020. )
  45021. },
  45022. Ci.Light = function(e, t) {
  45023. Ci.Object3D.call(this),
  45024. this.type = "Light",
  45025. this.color = new Ci.Color(e),
  45026. this.intensity = void 0 !== t ? t : 1,
  45027. this.receiveShadow = void 0
  45028. }
  45029. ,
  45030. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45031. Ci.Light.prototype.constructor = Ci.Light,
  45032. Ci.Light.prototype.copy = function(e) {
  45033. return Ci.Object3D.prototype.copy.call(this, e),
  45034. this.color.copy(e.color),
  45035. this.intensity = e.intensity,
  45036. this
  45037. }
  45038. ,
  45039. Ci.Light.prototype.toJSON = function(e) {
  45040. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45041. return t.object.color = this.color.getHex(),
  45042. t.object.intensity = this.intensity,
  45043. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45044. void 0 !== this.distance && (t.object.distance = this.distance),
  45045. void 0 !== this.angle && (t.object.angle = this.angle),
  45046. void 0 !== this.decay && (t.object.decay = this.decay),
  45047. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45048. t
  45049. }
  45050. ,
  45051. Ci.LightShadow = function(e) {
  45052. this.camera = e,
  45053. this.bias = 0,
  45054. this.radius = 1,
  45055. this.mapSize = new Ci.Vector2(512,512),
  45056. this.map = null,
  45057. this.matrix = new Ci.Matrix4
  45058. }
  45059. ,
  45060. Ci.LightShadow.prototype = {
  45061. constructor: Ci.LightShadow,
  45062. copy: function(e) {
  45063. return this.camera = e.camera.clone(),
  45064. this.bias = e.bias,
  45065. this.radius = e.radius,
  45066. this.mapSize.copy(e.mapSize),
  45067. this
  45068. },
  45069. clone: function() {
  45070. return (new this.constructor).copy(this)
  45071. }
  45072. },
  45073. Ci.AmbientLight = function(e, t) {
  45074. Ci.Light.call(this, e, t),
  45075. this.type = "AmbientLight",
  45076. this.castShadow = void 0
  45077. }
  45078. ,
  45079. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45080. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45081. Ci.DirectionalLight = function(e, t) {
  45082. Ci.Light.call(this, e, t),
  45083. this.type = "DirectionalLight",
  45084. this.position.set(0, 1, 0),
  45085. this.updateMatrix(),
  45086. this.target = new Ci.Object3D,
  45087. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45088. }
  45089. ,
  45090. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45091. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45092. Ci.DirectionalLight.prototype.copy = function(e) {
  45093. return Ci.Light.prototype.copy.call(this, e),
  45094. this.target = e.target.clone(),
  45095. this.shadow = e.shadow.clone(),
  45096. this
  45097. }
  45098. ,
  45099. Ci.HemisphereLight = function(e, t, i) {
  45100. Ci.Light.call(this, e, i),
  45101. this.type = "HemisphereLight",
  45102. this.castShadow = void 0,
  45103. this.position.set(0, 1, 0),
  45104. this.updateMatrix(),
  45105. this.groundColor = new Ci.Color(t)
  45106. }
  45107. ,
  45108. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45109. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45110. Ci.HemisphereLight.prototype.copy = function(e) {
  45111. return Ci.Light.prototype.copy.call(this, e),
  45112. this.groundColor.copy(e.groundColor),
  45113. this
  45114. }
  45115. ,
  45116. Ci.PointLight = function(e, t, i, n) {
  45117. Ci.Light.call(this, e, t),
  45118. this.type = "PointLight",
  45119. this.distance = void 0 !== i ? i : 0,
  45120. this.decay = void 0 !== n ? n : 1,
  45121. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45122. }
  45123. ,
  45124. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45125. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45126. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45127. get: function() {
  45128. return 4 * this.intensity * Math.PI
  45129. },
  45130. set: function(e) {
  45131. this.intensity = e / (4 * Math.PI)
  45132. }
  45133. }),
  45134. Ci.PointLight.prototype.copy = function(e) {
  45135. return Ci.Light.prototype.copy.call(this, e),
  45136. this.distance = e.distance,
  45137. this.decay = e.decay,
  45138. this.shadow = e.shadow.clone(),
  45139. this
  45140. }
  45141. ,
  45142. Ci.SpotLight = function(e, t, i, n, r, o) {
  45143. Ci.Light.call(this, e, t),
  45144. this.type = "SpotLight",
  45145. this.position.set(0, 1, 0),
  45146. this.updateMatrix(),
  45147. this.target = new Ci.Object3D,
  45148. this.distance = void 0 !== i ? i : 0,
  45149. this.angle = void 0 !== n ? n : Math.PI / 3,
  45150. this.penumbra = void 0 !== r ? r : 0,
  45151. this.decay = void 0 !== o ? o : 1,
  45152. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45153. }
  45154. ,
  45155. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45156. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45157. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45158. get: function() {
  45159. return this.intensity * Math.PI
  45160. },
  45161. set: function(e) {
  45162. this.intensity = e / Math.PI
  45163. }
  45164. }),
  45165. Ci.SpotLight.prototype.copy = function(e) {
  45166. return Ci.Light.prototype.copy.call(this, e),
  45167. this.distance = e.distance,
  45168. this.angle = e.angle,
  45169. this.penumbra = e.penumbra,
  45170. this.decay = e.decay,
  45171. this.target = e.target.clone(),
  45172. this.shadow = e.shadow.clone(),
  45173. this
  45174. }
  45175. ,
  45176. Ci.Cache = {
  45177. enabled: !1,
  45178. files: {},
  45179. add: function(e, t) {
  45180. !1 !== this.enabled && (this.files[e] = t)
  45181. },
  45182. get: function(e) {
  45183. if (!1 !== this.enabled)
  45184. return this.files[e]
  45185. },
  45186. remove: function(e) {
  45187. delete this.files[e]
  45188. },
  45189. clear: function() {
  45190. this.files = {}
  45191. }
  45192. },
  45193. Ci.Loader = function() {
  45194. this.onLoadStart = function() {}
  45195. ,
  45196. this.onLoadProgress = function() {}
  45197. ,
  45198. this.onLoadComplete = function() {}
  45199. }
  45200. ,
  45201. Ci.Loader.prototype = {
  45202. constructor: Ci.Loader,
  45203. crossOrigin: void 0,
  45204. extractUrlBase: function(e) {
  45205. var t = e.split("/");
  45206. return 1 === t.length ? "./" : (t.pop(),
  45207. t.join("/") + "/")
  45208. },
  45209. initMaterials: function(e, t, i) {
  45210. for (var n = [], r = 0; r < e.length; ++r)
  45211. n[r] = this.createMaterial(e[r], t, i);
  45212. return n
  45213. },
  45214. createMaterial: function(e, c, h) {
  45215. function t(e, t, i, n, r) {
  45216. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45217. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45218. He.load(a)),
  45219. void 0 !== t && (o.repeat.fromArray(t),
  45220. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45221. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45222. void 0 !== i && o.offset.fromArray(i),
  45223. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45224. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45225. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45226. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45227. void 0 !== r && (o.anisotropy = r);
  45228. var l = Ci.Math.generateUUID();
  45229. return u[l] = o,
  45230. l
  45231. }
  45232. void 0 === Ue && (Ue = new Ci.Color),
  45233. void 0 === He && (He = new Ci.TextureLoader),
  45234. void 0 === ze && (ze = new Ci.MaterialLoader);
  45235. var u = {}
  45236. , i = {
  45237. uuid: Ci.Math.generateUUID(),
  45238. type: "MeshLambertMaterial"
  45239. };
  45240. for (var n in e) {
  45241. var r = e[n];
  45242. switch (n) {
  45243. case "DbgColor":
  45244. case "DbgIndex":
  45245. case "opticalDensity":
  45246. case "illumination":
  45247. break;
  45248. case "DbgName":
  45249. i.name = r;
  45250. break;
  45251. case "blending":
  45252. i.blending = Ci[r];
  45253. break;
  45254. case "colorAmbient":
  45255. case "mapAmbient":
  45256. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45257. break;
  45258. case "colorDiffuse":
  45259. i.color = Ue.fromArray(r).getHex();
  45260. break;
  45261. case "colorSpecular":
  45262. i.specular = Ue.fromArray(r).getHex();
  45263. break;
  45264. case "colorEmissive":
  45265. i.emissive = Ue.fromArray(r).getHex();
  45266. break;
  45267. case "specularCoef":
  45268. i.shininess = r;
  45269. break;
  45270. case "shading":
  45271. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45272. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45273. break;
  45274. case "mapDiffuse":
  45275. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45276. break;
  45277. case "mapDiffuseRepeat":
  45278. case "mapDiffuseOffset":
  45279. case "mapDiffuseWrap":
  45280. case "mapDiffuseAnisotropy":
  45281. break;
  45282. case "mapLight":
  45283. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45284. break;
  45285. case "mapLightRepeat":
  45286. case "mapLightOffset":
  45287. case "mapLightWrap":
  45288. case "mapLightAnisotropy":
  45289. break;
  45290. case "mapAO":
  45291. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45292. break;
  45293. case "mapAORepeat":
  45294. case "mapAOOffset":
  45295. case "mapAOWrap":
  45296. case "mapAOAnisotropy":
  45297. break;
  45298. case "mapBump":
  45299. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45300. break;
  45301. case "mapBumpScale":
  45302. i.bumpScale = r;
  45303. break;
  45304. case "mapBumpRepeat":
  45305. case "mapBumpOffset":
  45306. case "mapBumpWrap":
  45307. case "mapBumpAnisotropy":
  45308. break;
  45309. case "mapNormal":
  45310. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45311. break;
  45312. case "mapNormalFactor":
  45313. i.normalScale = [r, r];
  45314. break;
  45315. case "mapNormalRepeat":
  45316. case "mapNormalOffset":
  45317. case "mapNormalWrap":
  45318. case "mapNormalAnisotropy":
  45319. break;
  45320. case "mapSpecular":
  45321. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45322. break;
  45323. case "mapSpecularRepeat":
  45324. case "mapSpecularOffset":
  45325. case "mapSpecularWrap":
  45326. case "mapSpecularAnisotropy":
  45327. break;
  45328. case "mapAlpha":
  45329. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45330. break;
  45331. case "mapAlphaRepeat":
  45332. case "mapAlphaOffset":
  45333. case "mapAlphaWrap":
  45334. case "mapAlphaAnisotropy":
  45335. break;
  45336. case "flipSided":
  45337. i.side = Ci.BackSide;
  45338. break;
  45339. case "doubleSided":
  45340. i.side = Ci.DoubleSide;
  45341. break;
  45342. case "transparency":
  45343. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45344. i.opacity = r;
  45345. break;
  45346. case "depthTest":
  45347. case "depthWrite":
  45348. case "colorWrite":
  45349. case "opacity":
  45350. case "reflectivity":
  45351. case "transparent":
  45352. case "visible":
  45353. case "wireframe":
  45354. i[n] = r;
  45355. break;
  45356. case "vertexColors":
  45357. !0 === r && (i.vertexColors = Ci.VertexColors),
  45358. "face" === r && (i.vertexColors = Ci.FaceColors);
  45359. break;
  45360. default:
  45361. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45362. }
  45363. }
  45364. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45365. "MeshPhongMaterial" !== i.type && delete i.specular,
  45366. i.opacity < 1 && (i.transparent = !0),
  45367. ze.setTextures(u),
  45368. ze.parse(i)
  45369. }
  45370. },
  45371. Ci.Loader.Handlers = {
  45372. handlers: [],
  45373. add: function(e, t) {
  45374. this.handlers.push(e, t)
  45375. },
  45376. get: function(e) {
  45377. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45378. var r = t[i]
  45379. , o = t[i + 1];
  45380. if (r.test(e))
  45381. return o
  45382. }
  45383. return null
  45384. }
  45385. },
  45386. Ci.XHRLoader = function(e) {
  45387. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45388. }
  45389. ,
  45390. Ci.XHRLoader.prototype = {
  45391. constructor: Ci.XHRLoader,
  45392. load: function(i, n, t, r) {
  45393. void 0 !== this.path && (i = this.path + i);
  45394. var o = this
  45395. , e = Ci.Cache.get(i);
  45396. if (void 0 !== e)
  45397. return n && setTimeout(function() {
  45398. n(e)
  45399. }, 0),
  45400. e;
  45401. var a = new XMLHttpRequest;
  45402. return a.overrideMimeType("text/plain"),
  45403. a.open("GET", i, !0),
  45404. a.addEventListener("load", function(e) {
  45405. var t = e.target.response;
  45406. Ci.Cache.add(i, t),
  45407. 200 === this.status ? (n && n(t),
  45408. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45409. n && n(t),
  45410. o.manager.itemEnd(i)) : (r && r(e),
  45411. o.manager.itemError(i))
  45412. }, !1),
  45413. void 0 !== t && a.addEventListener("progress", function(e) {
  45414. t(e)
  45415. }, !1),
  45416. a.addEventListener("error", function(e) {
  45417. r && r(e),
  45418. o.manager.itemError(i)
  45419. }, !1),
  45420. void 0 !== this.responseType && (a.responseType = this.responseType),
  45421. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45422. a.send(null),
  45423. o.manager.itemStart(i),
  45424. a
  45425. },
  45426. setPath: function(e) {
  45427. this.path = e
  45428. },
  45429. setResponseType: function(e) {
  45430. this.responseType = e
  45431. },
  45432. setWithCredentials: function(e) {
  45433. this.withCredentials = e
  45434. }
  45435. },
  45436. Ci.FontLoader = function(e) {
  45437. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45438. }
  45439. ,
  45440. Ci.FontLoader.prototype = {
  45441. constructor: Ci.FontLoader,
  45442. load: function(e, t, i, n) {
  45443. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45444. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45445. }, i, n)
  45446. }
  45447. },
  45448. Ci.ImageLoader = function(e) {
  45449. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45450. }
  45451. ,
  45452. Ci.ImageLoader.prototype = {
  45453. constructor: Ci.ImageLoader,
  45454. load: function(t, i, n, r) {
  45455. void 0 !== this.path && (t = this.path + t);
  45456. var o = this
  45457. , e = Ci.Cache.get(t);
  45458. if (void 0 !== e)
  45459. return o.manager.itemStart(t),
  45460. i ? setTimeout(function() {
  45461. i(e),
  45462. o.manager.itemEnd(t)
  45463. }, 0) : o.manager.itemEnd(t),
  45464. e;
  45465. var a = document.createElement("img");
  45466. return a.addEventListener("load", function(e) {
  45467. Ci.Cache.add(t, this),
  45468. i && i(this),
  45469. o.manager.itemEnd(t)
  45470. }, !1),
  45471. void 0 !== n && a.addEventListener("progress", function(e) {
  45472. n(e)
  45473. }, !1),
  45474. a.addEventListener("error", function(e) {
  45475. r && r(e),
  45476. o.manager.itemError(t)
  45477. }, !1),
  45478. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45479. o.manager.itemStart(t),
  45480. a.src = t,
  45481. a
  45482. },
  45483. setCrossOrigin: function(e) {
  45484. this.crossOrigin = e
  45485. },
  45486. setPath: function(e) {
  45487. this.path = e
  45488. }
  45489. },
  45490. Ci.JSONLoader = function(e) {
  45491. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45492. e = void 0),
  45493. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45494. this.withCredentials = !1
  45495. }
  45496. ,
  45497. Ci.JSONLoader.prototype = {
  45498. constructor: Ci.JSONLoader,
  45499. get statusDomElement() {
  45500. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45501. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45502. this._statusDomElement
  45503. },
  45504. load: function(o, a, e, t) {
  45505. var s = this
  45506. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45507. , i = new Ci.XHRLoader(this.manager);
  45508. i.setWithCredentials(this.withCredentials),
  45509. i.load(o, function(e) {
  45510. var t = JSON.parse(e)
  45511. , i = t.metadata;
  45512. if (void 0 !== i) {
  45513. var n = i.type;
  45514. if (void 0 !== n) {
  45515. if ("object" === n.toLowerCase())
  45516. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45517. if ("scene" === n.toLowerCase())
  45518. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45519. }
  45520. }
  45521. var r = s.parse(t, l);
  45522. a(r.geometry, r.materials)
  45523. }, e, t)
  45524. },
  45525. setTexturePath: function(e) {
  45526. this.texturePath = e
  45527. },
  45528. parse: function(D, e) {
  45529. var N = new Ci.Geometry
  45530. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45531. if (function(e) {
  45532. function t(e, t) {
  45533. return e & 1 << t
  45534. }
  45535. 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;
  45536. if (void 0 !== D.uvs) {
  45537. for (i = 0; i < D.uvs.length; i++)
  45538. D.uvs[i].length && L++;
  45539. for (i = 0; i < L; i++)
  45540. N.faceVertexUvs[i] = []
  45541. }
  45542. for (o = 0,
  45543. a = R.length; o < a; )
  45544. (A = new Ci.Vector3).x = R[o++] * e,
  45545. A.y = R[o++] * e,
  45546. A.z = R[o++] * e,
  45547. N.vertices.push(A);
  45548. for (o = 0,
  45549. a = M.length; o < a; )
  45550. if (d = t(u = M[o++], 0),
  45551. p = t(u, 1),
  45552. f = t(u, 3),
  45553. g = t(u, 4),
  45554. m = t(u, 5),
  45555. v = t(u, 6),
  45556. y = t(u, 7),
  45557. d) {
  45558. if ((I = new Ci.Face3).a = M[o],
  45559. I.b = M[o + 1],
  45560. I.c = M[o + 3],
  45561. (E = new Ci.Face3).a = M[o + 1],
  45562. E.b = M[o + 2],
  45563. E.c = M[o + 3],
  45564. o += 4,
  45565. p && (h = M[o++],
  45566. I.materialIndex = h,
  45567. E.materialIndex = h),
  45568. r = N.faces.length,
  45569. f)
  45570. for (i = 0; i < L; i++)
  45571. for (w = D.uvs[i],
  45572. N.faceVertexUvs[i][r] = [],
  45573. N.faceVertexUvs[i][r + 1] = [],
  45574. n = 0; n < 4; n++)
  45575. x = w[2 * (c = M[o++])],
  45576. S = w[2 * c + 1],
  45577. T = new Ci.Vector2(x,S),
  45578. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45579. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45580. if (g && (l = 3 * M[o++],
  45581. I.normal.set(P[l++], P[l++], P[l]),
  45582. E.normal.copy(I.normal)),
  45583. m)
  45584. for (i = 0; i < 4; i++)
  45585. l = 3 * M[o++],
  45586. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45587. 2 !== i && I.vertexNormals.push(b),
  45588. 0 !== i && E.vertexNormals.push(b);
  45589. if (v && (_ = O[s = M[o++]],
  45590. I.color.setHex(_),
  45591. E.color.setHex(_)),
  45592. y)
  45593. for (i = 0; i < 4; i++)
  45594. _ = O[s = M[o++]],
  45595. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45596. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45597. N.faces.push(I),
  45598. N.faces.push(E)
  45599. } else {
  45600. if ((C = new Ci.Face3).a = M[o++],
  45601. C.b = M[o++],
  45602. C.c = M[o++],
  45603. p && (h = M[o++],
  45604. C.materialIndex = h),
  45605. r = N.faces.length,
  45606. f)
  45607. for (i = 0; i < L; i++)
  45608. for (w = D.uvs[i],
  45609. N.faceVertexUvs[i][r] = [],
  45610. n = 0; n < 3; n++)
  45611. x = w[2 * (c = M[o++])],
  45612. S = w[2 * c + 1],
  45613. T = new Ci.Vector2(x,S),
  45614. N.faceVertexUvs[i][r].push(T);
  45615. if (g && (l = 3 * M[o++],
  45616. C.normal.set(P[l++], P[l++], P[l])),
  45617. m)
  45618. for (i = 0; i < 3; i++)
  45619. l = 3 * M[o++],
  45620. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45621. C.vertexNormals.push(b);
  45622. if (v && (s = M[o++],
  45623. C.color.setHex(O[s])),
  45624. y)
  45625. for (i = 0; i < 3; i++)
  45626. s = M[o++],
  45627. C.vertexColors.push(new Ci.Color(O[s]));
  45628. N.faces.push(C)
  45629. }
  45630. }(t),
  45631. function() {
  45632. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45633. if (D.skinWeights)
  45634. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45635. var n = D.skinWeights[t]
  45636. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45637. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45638. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45639. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45640. }
  45641. if (D.skinIndices)
  45642. for (t = 0,
  45643. i = D.skinIndices.length; t < i; t += e) {
  45644. var s = D.skinIndices[t]
  45645. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45646. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45647. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45648. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45649. }
  45650. N.bones = D.bones,
  45651. 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.")
  45652. }(),
  45653. function(e) {
  45654. if (void 0 !== D.morphTargets)
  45655. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45656. N.morphTargets[t] = {},
  45657. N.morphTargets[t].name = D.morphTargets[t].name,
  45658. N.morphTargets[t].vertices = [];
  45659. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45660. var s = new Ci.Vector3;
  45661. s.x = r[o] * e,
  45662. s.y = r[o + 1] * e,
  45663. s.z = r[o + 2] * e,
  45664. n.push(s)
  45665. }
  45666. }
  45667. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45668. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45669. var l = N.faces
  45670. , c = D.morphColors[0].colors;
  45671. for (t = 0,
  45672. i = l.length; t < i; t++)
  45673. l[t].color.fromArray(c, 3 * t)
  45674. }
  45675. }(t),
  45676. function() {
  45677. var e = []
  45678. , t = [];
  45679. void 0 !== D.animation && t.push(D.animation),
  45680. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45681. for (var i = 0; i < t.length; i++) {
  45682. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45683. n && e.push(n)
  45684. }
  45685. if (N.morphTargets) {
  45686. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45687. e = e.concat(r)
  45688. }
  45689. 0 < e.length && (N.animations = e)
  45690. }(),
  45691. N.computeFaceNormals(),
  45692. N.computeBoundingSphere(),
  45693. void 0 === D.materials || 0 === D.materials.length)
  45694. return {
  45695. geometry: N
  45696. };
  45697. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45698. return {
  45699. geometry: N,
  45700. materials: i
  45701. }
  45702. }
  45703. },
  45704. Ci.LoadingManager = function(e, t, i) {
  45705. var n = this
  45706. , r = !1
  45707. , o = 0
  45708. , a = 0;
  45709. this.onStart = void 0,
  45710. this.onLoad = e,
  45711. this.onProgress = t,
  45712. this.onError = i,
  45713. this.itemStart = function(e) {
  45714. a++,
  45715. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45716. r = !0
  45717. }
  45718. ,
  45719. this.itemEnd = function(e) {
  45720. o++,
  45721. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45722. o === a && (r = !1,
  45723. void 0 !== n.onLoad && n.onLoad())
  45724. }
  45725. ,
  45726. this.itemError = function(e) {
  45727. void 0 !== n.onError && n.onError(e)
  45728. }
  45729. }
  45730. ,
  45731. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45732. Ci.BufferGeometryLoader = function(e) {
  45733. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45734. }
  45735. ,
  45736. Ci.BufferGeometryLoader.prototype = {
  45737. constructor: Ci.BufferGeometryLoader,
  45738. load: function(e, t, i, n) {
  45739. var r = this;
  45740. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45741. t(r.parse(JSON.parse(e)))
  45742. }, i, n)
  45743. },
  45744. parse: function(e) {
  45745. var t = new Ci.BufferGeometry
  45746. , i = e.data.index
  45747. , n = {
  45748. Int8Array: Int8Array,
  45749. Uint8Array: Uint8Array,
  45750. Uint8ClampedArray: Uint8ClampedArray,
  45751. Int16Array: Int16Array,
  45752. Uint16Array: Uint16Array,
  45753. Int32Array: Int32Array,
  45754. Uint32Array: Uint32Array,
  45755. Float32Array: Float32Array,
  45756. Float64Array: Float64Array
  45757. };
  45758. if (void 0 !== i) {
  45759. var r = new n[i.type](i.array);
  45760. t.setIndex(new Ci.BufferAttribute(r,1))
  45761. }
  45762. var o = e.data.attributes;
  45763. for (var a in o) {
  45764. var s = o[a];
  45765. r = new n[s.type](s.array);
  45766. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45767. }
  45768. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45769. if (void 0 !== l)
  45770. for (var c = 0, h = l.length; c !== h; ++c) {
  45771. var u = l[c];
  45772. t.addGroup(u.start, u.count, u.materialIndex)
  45773. }
  45774. var d = e.data.boundingSphere;
  45775. if (void 0 !== d) {
  45776. var p = new Ci.Vector3;
  45777. void 0 !== d.center && p.fromArray(d.center),
  45778. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45779. }
  45780. return t
  45781. }
  45782. },
  45783. Ci.MaterialLoader = function(e) {
  45784. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45785. this.textures = {}
  45786. }
  45787. ,
  45788. Ci.MaterialLoader.prototype = {
  45789. constructor: Ci.MaterialLoader,
  45790. load: function(e, t, i, n) {
  45791. var r = this;
  45792. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45793. t(r.parse(JSON.parse(e)))
  45794. }, i, n)
  45795. },
  45796. setTextures: function(e) {
  45797. this.textures = e
  45798. },
  45799. getTexture: function(e) {
  45800. var t = this.textures;
  45801. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45802. t[e]
  45803. },
  45804. parse: function(e) {
  45805. var t = new Ci[e.type];
  45806. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45807. void 0 !== e.name && (t.name = e.name),
  45808. void 0 !== e.color && t.color.setHex(e.color),
  45809. void 0 !== e.roughness && (t.roughness = e.roughness),
  45810. void 0 !== e.metalness && (t.metalness = e.metalness),
  45811. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45812. void 0 !== e.specular && t.specular.setHex(e.specular),
  45813. void 0 !== e.shininess && (t.shininess = e.shininess),
  45814. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45815. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45816. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45817. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45818. void 0 !== e.shading && (t.shading = e.shading),
  45819. void 0 !== e.blending && (t.blending = e.blending),
  45820. void 0 !== e.side && (t.side = e.side),
  45821. void 0 !== e.opacity && (t.opacity = e.opacity),
  45822. void 0 !== e.transparent && (t.transparent = e.transparent),
  45823. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45824. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45825. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45826. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45827. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45828. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45829. void 0 !== e.size && (t.size = e.size),
  45830. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45831. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45832. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45833. t.transparent = !0),
  45834. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45835. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45836. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45837. void 0 !== e.normalScale) {
  45838. var i = e.normalScale;
  45839. !1 === Array.isArray(i) && (i = [i, i]),
  45840. t.normalScale = (new Ci.Vector2).fromArray(i)
  45841. }
  45842. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45843. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45844. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45845. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45846. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45847. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45848. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45849. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45850. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45851. t.combine = Ci.MultiplyOperation),
  45852. e.reflectivity && (t.reflectivity = e.reflectivity),
  45853. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45854. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45855. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45856. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45857. void 0 !== e.materials)
  45858. for (var n = 0, r = e.materials.length; n < r; n++)
  45859. t.materials.push(this.parse(e.materials[n]));
  45860. return t
  45861. }
  45862. },
  45863. Ci.ObjectLoader = function(e) {
  45864. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45865. this.texturePath = ""
  45866. }
  45867. ,
  45868. Ci.ObjectLoader.prototype = {
  45869. constructor: Ci.ObjectLoader,
  45870. load: function(e, t, i, n) {
  45871. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45872. var r = this;
  45873. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45874. r.parse(JSON.parse(e), t)
  45875. }, i, n)
  45876. },
  45877. setTexturePath: function(e) {
  45878. this.texturePath = e
  45879. },
  45880. setCrossOrigin: function(e) {
  45881. this.crossOrigin = e
  45882. },
  45883. parse: function(e, t) {
  45884. var i = this.parseGeometries(e.geometries)
  45885. , n = this.parseImages(e.images, function() {
  45886. void 0 !== t && t(a)
  45887. })
  45888. , r = this.parseTextures(e.textures, n)
  45889. , o = this.parseMaterials(e.materials, r)
  45890. , a = this.parseObject(e.object, i, o);
  45891. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45892. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45893. a
  45894. },
  45895. parseGeometries: function(e) {
  45896. var t = {};
  45897. if (void 0 !== e)
  45898. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45899. var a, s = e[r];
  45900. switch (s.type) {
  45901. case "PlaneGeometry":
  45902. case "PlaneBufferGeometry":
  45903. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45904. break;
  45905. case "BoxGeometry":
  45906. case "BoxBufferGeometry":
  45907. case "CubeGeometry":
  45908. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45909. break;
  45910. case "CircleGeometry":
  45911. case "CircleBufferGeometry":
  45912. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45913. break;
  45914. case "CylinderGeometry":
  45915. case "CylinderBufferGeometry":
  45916. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45917. break;
  45918. case "SphereGeometry":
  45919. case "SphereBufferGeometry":
  45920. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45921. break;
  45922. case "DodecahedronGeometry":
  45923. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45924. break;
  45925. case "IcosahedronGeometry":
  45926. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45927. break;
  45928. case "OctahedronGeometry":
  45929. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45930. break;
  45931. case "TetrahedronGeometry":
  45932. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45933. break;
  45934. case "RingGeometry":
  45935. case "RingBufferGeometry":
  45936. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45937. break;
  45938. case "TorusGeometry":
  45939. case "TorusBufferGeometry":
  45940. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45941. break;
  45942. case "TorusKnotGeometry":
  45943. case "TorusKnotBufferGeometry":
  45944. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45945. break;
  45946. case "LatheGeometry":
  45947. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45948. break;
  45949. case "BufferGeometry":
  45950. a = n.parse(s);
  45951. break;
  45952. case "Geometry":
  45953. a = i.parse(s.data, this.texturePath).geometry;
  45954. break;
  45955. default:
  45956. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45957. continue
  45958. }
  45959. a.uuid = s.uuid,
  45960. void 0 !== s.name && (a.name = s.name),
  45961. t[s.uuid] = a
  45962. }
  45963. return t
  45964. },
  45965. parseMaterials: function(e, t) {
  45966. var i = {};
  45967. if (void 0 !== e) {
  45968. var n = new Ci.MaterialLoader;
  45969. n.setTextures(t);
  45970. for (var r = 0, o = e.length; r < o; r++) {
  45971. var a = n.parse(e[r]);
  45972. i[a.uuid] = a
  45973. }
  45974. }
  45975. return i
  45976. },
  45977. parseAnimations: function(e) {
  45978. for (var t = [], i = 0; i < e.length; i++) {
  45979. var n = Ci.AnimationClip.parse(e[i]);
  45980. t.push(n)
  45981. }
  45982. return t
  45983. },
  45984. parseImages: function(e, t) {
  45985. function i(e) {
  45986. return n.manager.itemStart(e),
  45987. a.load(e, function() {
  45988. n.manager.itemEnd(e)
  45989. })
  45990. }
  45991. var n = this
  45992. , r = {};
  45993. if (void 0 !== e && 0 < e.length) {
  45994. var o = new Ci.LoadingManager(t)
  45995. , a = new Ci.ImageLoader(o);
  45996. a.setCrossOrigin(this.crossOrigin);
  45997. for (var s = 0, l = e.length; s < l; s++) {
  45998. var c = e[s]
  45999. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46000. r[c.uuid] = i(h)
  46001. }
  46002. }
  46003. return r
  46004. },
  46005. parseTextures: function(e, t) {
  46006. function i(e) {
  46007. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46008. Ci[e])
  46009. }
  46010. var n = {};
  46011. if (void 0 !== e)
  46012. for (var r = 0, o = e.length; r < o; r++) {
  46013. var a = e[r];
  46014. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46015. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46016. var s = new Ci.Texture(t[a.image]);
  46017. s.needsUpdate = !0,
  46018. s.uuid = a.uuid,
  46019. void 0 !== a.name && (s.name = a.name),
  46020. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46021. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46022. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46023. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46024. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46025. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46026. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46027. s.wrapT = i(a.wrap[1])),
  46028. n[a.uuid] = s
  46029. }
  46030. return n
  46031. },
  46032. parseObject: (ke = new Ci.Matrix4,
  46033. function(e, t, i) {
  46034. function n(e) {
  46035. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46036. t[e]
  46037. }
  46038. function r(e) {
  46039. if (void 0 !== e)
  46040. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46041. i[e]
  46042. }
  46043. var o;
  46044. switch (e.type) {
  46045. case "Scene":
  46046. o = new Ci.Scene;
  46047. break;
  46048. case "PerspectiveCamera":
  46049. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46050. break;
  46051. case "OrthographicCamera":
  46052. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46053. break;
  46054. case "AmbientLight":
  46055. o = new Ci.AmbientLight(e.color,e.intensity);
  46056. break;
  46057. case "DirectionalLight":
  46058. o = new Ci.DirectionalLight(e.color,e.intensity);
  46059. break;
  46060. case "PointLight":
  46061. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46062. break;
  46063. case "SpotLight":
  46064. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46065. break;
  46066. case "HemisphereLight":
  46067. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46068. break;
  46069. case "Mesh":
  46070. var a = n(e.geometry)
  46071. , s = r(e.material);
  46072. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46073. break;
  46074. case "LOD":
  46075. o = new Ci.LOD;
  46076. break;
  46077. case "Line":
  46078. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46079. break;
  46080. case "PointCloud":
  46081. case "Points":
  46082. o = new Ci.Points(n(e.geometry),r(e.material));
  46083. break;
  46084. case "Sprite":
  46085. o = new Ci.Sprite(r(e.material));
  46086. break;
  46087. case "Group":
  46088. o = new Ci.Group;
  46089. break;
  46090. default:
  46091. o = new Ci.Object3D
  46092. }
  46093. if (o.uuid = e.uuid,
  46094. void 0 !== e.name && (o.name = e.name),
  46095. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46096. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46097. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46098. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46099. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46100. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46101. void 0 !== e.visible && (o.visible = e.visible),
  46102. void 0 !== e.userData && (o.userData = e.userData),
  46103. void 0 !== e.children)
  46104. for (var l in e.children)
  46105. o.add(this.parseObject(e.children[l], t, i));
  46106. if ("LOD" === e.type)
  46107. for (var c = e.levels, h = 0; h < c.length; h++) {
  46108. var u = c[h];
  46109. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46110. }
  46111. return o
  46112. }
  46113. )
  46114. },
  46115. Ci.TextureLoader = function(e) {
  46116. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46117. }
  46118. ,
  46119. Ci.TextureLoader.prototype = {
  46120. constructor: Ci.TextureLoader,
  46121. load: function(e, t, i, n) {
  46122. var r = new Ci.Texture
  46123. , o = new Ci.ImageLoader(this.manager);
  46124. return o.setCrossOrigin(this.crossOrigin),
  46125. o.setPath(this.path),
  46126. o.load(e, function(e) {
  46127. r.image = e,
  46128. r.needsUpdate = !0,
  46129. void 0 !== t && t(r)
  46130. }, i, n),
  46131. r
  46132. },
  46133. setCrossOrigin: function(e) {
  46134. this.crossOrigin = e
  46135. },
  46136. setPath: function(e) {
  46137. this.path = e
  46138. }
  46139. },
  46140. Ci.CubeTextureLoader = function(e) {
  46141. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46142. }
  46143. ,
  46144. Ci.CubeTextureLoader.prototype = {
  46145. constructor: Ci.CubeTextureLoader,
  46146. load: function(e, i, t, n) {
  46147. function r(t) {
  46148. a.load(e[t], function(e) {
  46149. o.images[t] = e,
  46150. 6 === ++s && (o.needsUpdate = !0,
  46151. i && i(o))
  46152. }, void 0, n)
  46153. }
  46154. var o = new Ci.CubeTexture
  46155. , a = new Ci.ImageLoader(this.manager);
  46156. a.setCrossOrigin(this.crossOrigin),
  46157. a.setPath(this.path);
  46158. for (var s = 0, l = 0; l < e.length; ++l)
  46159. r(l);
  46160. return o
  46161. },
  46162. setCrossOrigin: function(e) {
  46163. this.crossOrigin = e
  46164. },
  46165. setPath: function(e) {
  46166. this.path = e
  46167. }
  46168. },
  46169. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46170. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46171. this._parser = null
  46172. }
  46173. ,
  46174. Ci.BinaryTextureLoader.prototype = {
  46175. constructor: Ci.BinaryTextureLoader,
  46176. load: function(e, i, t, n) {
  46177. var r = this
  46178. , o = new Ci.DataTexture
  46179. , a = new Ci.XHRLoader(this.manager);
  46180. return a.setResponseType("arraybuffer"),
  46181. a.load(e, function(e) {
  46182. var t = r._parser(e);
  46183. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46184. o.image.height = t.height,
  46185. o.image.data = t.data),
  46186. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46187. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46188. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46189. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46190. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46191. void 0 !== t.format && (o.format = t.format),
  46192. void 0 !== t.type && (o.type = t.type),
  46193. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46194. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46195. o.needsUpdate = !0,
  46196. i && i(o, t))
  46197. }, t, n),
  46198. o
  46199. }
  46200. },
  46201. Ci.CompressedTextureLoader = function(e) {
  46202. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46203. this._parser = null
  46204. }
  46205. ,
  46206. Ci.CompressedTextureLoader.prototype = {
  46207. constructor: Ci.CompressedTextureLoader,
  46208. load: function(e, o, t, n) {
  46209. function i(i) {
  46210. r.load(e[i], function(e) {
  46211. var t = a._parser(e, !0);
  46212. s[i] = {
  46213. width: t.width,
  46214. height: t.height,
  46215. format: t.format,
  46216. mipmaps: t.mipmaps
  46217. },
  46218. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46219. l.format = t.format,
  46220. l.needsUpdate = !0,
  46221. o && o(l))
  46222. }, t, n)
  46223. }
  46224. var a = this
  46225. , s = []
  46226. , l = new Ci.CompressedTexture;
  46227. l.image = s;
  46228. var r = new Ci.XHRLoader(this.manager);
  46229. if (r.setPath(this.path),
  46230. r.setResponseType("arraybuffer"),
  46231. Array.isArray(e))
  46232. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46233. i(h);
  46234. else
  46235. r.load(e, function(e) {
  46236. var t = a._parser(e, !0);
  46237. if (t.isCubemap)
  46238. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46239. s[n] = {
  46240. mipmaps: []
  46241. };
  46242. for (var r = 0; r < t.mipmapCount; r++)
  46243. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46244. s[n].format = t.format,
  46245. s[n].width = t.width,
  46246. s[n].height = t.height
  46247. }
  46248. else
  46249. l.image.width = t.width,
  46250. l.image.height = t.height,
  46251. l.mipmaps = t.mipmaps;
  46252. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46253. l.format = t.format,
  46254. l.needsUpdate = !0,
  46255. o && o(l)
  46256. }, t, n);
  46257. return l
  46258. },
  46259. setPath: function(e) {
  46260. this.path = e
  46261. }
  46262. },
  46263. Ci.Material = function() {
  46264. Object.defineProperty(this, "id", {
  46265. value: Ci.MaterialIdCount++
  46266. }),
  46267. this.uuid = Ci.Math.generateUUID(),
  46268. this.name = "",
  46269. this.type = "Material",
  46270. this.side = Ci.FrontSide,
  46271. this.opacity = 1,
  46272. this.transparent = !1,
  46273. this.blending = Ci.NormalBlending,
  46274. this.blendSrc = Ci.SrcAlphaFactor,
  46275. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46276. this.blendEquation = Ci.AddEquation,
  46277. this.blendSrcAlpha = null,
  46278. this.blendDstAlpha = null,
  46279. this.blendEquationAlpha = null,
  46280. this.depthFunc = Ci.LessEqualDepth,
  46281. this.depthTest = !0,
  46282. this.depthWrite = !0,
  46283. this.colorWrite = !0,
  46284. this.precision = null,
  46285. this.polygonOffset = !1,
  46286. this.polygonOffsetFactor = 0,
  46287. this.polygonOffsetUnits = 0,
  46288. this.alphaTest = 0,
  46289. this.premultipliedAlpha = !1,
  46290. this.overdraw = 0,
  46291. this.visible = !0,
  46292. this._needsUpdate = !0
  46293. }
  46294. ,
  46295. Ci.Material.prototype = {
  46296. constructor: Ci.Material,
  46297. get needsUpdate() {
  46298. return this._needsUpdate
  46299. },
  46300. set needsUpdate(e) {
  46301. !0 === e && this.update(),
  46302. this._needsUpdate = e
  46303. },
  46304. setValues: function(e) {
  46305. if (void 0 !== e)
  46306. for (var t in e) {
  46307. var i = e[t];
  46308. if (void 0 !== i) {
  46309. var n = this[t];
  46310. 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.")
  46311. } else
  46312. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46313. }
  46314. },
  46315. toJSON: function(e) {
  46316. function t(e) {
  46317. var t = [];
  46318. for (var i in e) {
  46319. var n = e[i];
  46320. delete n.metadata,
  46321. t.push(n)
  46322. }
  46323. return t
  46324. }
  46325. var i = void 0 === e;
  46326. i && (e = {
  46327. textures: {},
  46328. images: {}
  46329. });
  46330. var n = {
  46331. metadata: {
  46332. version: 4.4,
  46333. type: "Material",
  46334. generator: "Material.toJSON"
  46335. }
  46336. };
  46337. if (n.uuid = this.uuid,
  46338. n.type = this.type,
  46339. "" !== this.name && (n.name = this.name),
  46340. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46341. .5 !== this.roughness && (n.roughness = this.roughness),
  46342. .5 !== this.metalness && (n.metalness = this.metalness),
  46343. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46344. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46345. void 0 !== this.shininess && (n.shininess = this.shininess),
  46346. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46347. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46348. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46349. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46350. n.bumpScale = this.bumpScale),
  46351. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46352. n.normalScale = this.normalScale.toArray()),
  46353. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46354. n.displacementScale = this.displacementScale,
  46355. n.displacementBias = this.displacementBias),
  46356. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46357. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46358. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46359. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46360. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46361. n.reflectivity = this.reflectivity),
  46362. void 0 !== this.size && (n.size = this.size),
  46363. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46364. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46365. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46366. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46367. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46368. this.opacity < 1 && (n.opacity = this.opacity),
  46369. !0 === this.transparent && (n.transparent = this.transparent),
  46370. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46371. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46372. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46373. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46374. i) {
  46375. var r = t(e.textures)
  46376. , o = t(e.images);
  46377. 0 < r.length && (n.textures = r),
  46378. 0 < o.length && (n.images = o)
  46379. }
  46380. return n
  46381. },
  46382. clone: function() {
  46383. return (new this.constructor).copy(this)
  46384. },
  46385. copy: function(e) {
  46386. return this.name = e.name,
  46387. this.side = e.side,
  46388. this.opacity = e.opacity,
  46389. this.transparent = e.transparent,
  46390. this.blending = e.blending,
  46391. this.blendSrc = e.blendSrc,
  46392. this.blendDst = e.blendDst,
  46393. this.blendEquation = e.blendEquation,
  46394. this.blendSrcAlpha = e.blendSrcAlpha,
  46395. this.blendDstAlpha = e.blendDstAlpha,
  46396. this.blendEquationAlpha = e.blendEquationAlpha,
  46397. this.depthFunc = e.depthFunc,
  46398. this.depthTest = e.depthTest,
  46399. this.depthWrite = e.depthWrite,
  46400. this.colorWrite = e.colorWrite,
  46401. this.precision = e.precision,
  46402. this.polygonOffset = e.polygonOffset,
  46403. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46404. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46405. this.alphaTest = e.alphaTest,
  46406. this.premultipliedAlpha = e.premultipliedAlpha,
  46407. this.overdraw = e.overdraw,
  46408. this.visible = e.visible,
  46409. this
  46410. },
  46411. update: function() {
  46412. this.dispatchEvent({
  46413. type: "update"
  46414. })
  46415. },
  46416. dispose: function() {
  46417. this.dispatchEvent({
  46418. type: "dispose"
  46419. })
  46420. }
  46421. },
  46422. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46423. Ci.MaterialIdCount = 0,
  46424. Ci.LineBasicMaterial = function(e) {
  46425. Ci.Material.call(this),
  46426. this.type = "LineBasicMaterial",
  46427. this.color = new Ci.Color(16777215),
  46428. this.linewidth = 1,
  46429. this.linecap = "round",
  46430. this.linejoin = "round",
  46431. this.blending = Ci.NormalBlending,
  46432. this.vertexColors = Ci.NoColors,
  46433. this.fog = !0,
  46434. this.setValues(e)
  46435. }
  46436. ,
  46437. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46438. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46439. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46440. return Ci.Material.prototype.copy.call(this, e),
  46441. this.color.copy(e.color),
  46442. this.linewidth = e.linewidth,
  46443. this.linecap = e.linecap,
  46444. this.linejoin = e.linejoin,
  46445. this.vertexColors = e.vertexColors,
  46446. this.fog = e.fog,
  46447. this
  46448. }
  46449. ,
  46450. Ci.LineDashedMaterial = function(e) {
  46451. Ci.Material.call(this),
  46452. this.type = "LineDashedMaterial",
  46453. this.color = new Ci.Color(16777215),
  46454. this.linewidth = 1,
  46455. this.scale = 1,
  46456. this.dashSize = 3,
  46457. this.gapSize = 1,
  46458. this.blending = Ci.NormalBlending,
  46459. this.vertexColors = Ci.NoColors,
  46460. this.fog = !0,
  46461. this.setValues(e)
  46462. }
  46463. ,
  46464. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46465. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46466. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46467. return Ci.Material.prototype.copy.call(this, e),
  46468. this.color.copy(e.color),
  46469. this.linewidth = e.linewidth,
  46470. this.scale = e.scale,
  46471. this.dashSize = e.dashSize,
  46472. this.gapSize = e.gapSize,
  46473. this.vertexColors = e.vertexColors,
  46474. this.fog = e.fog,
  46475. this
  46476. }
  46477. ,
  46478. Ci.MeshBasicMaterial = function(e) {
  46479. Ci.Material.call(this),
  46480. this.type = "MeshBasicMaterial",
  46481. this.color = new Ci.Color(16777215),
  46482. this.map = null,
  46483. this.aoMap = null,
  46484. this.aoMapIntensity = 1,
  46485. this.specularMap = null,
  46486. this.alphaMap = null,
  46487. this.envMap = null,
  46488. this.combine = Ci.MultiplyOperation,
  46489. this.reflectivity = 1,
  46490. this.refractionRatio = .98,
  46491. this.fog = !0,
  46492. this.shading = Ci.SmoothShading,
  46493. this.blending = Ci.NormalBlending,
  46494. this.wireframe = !1,
  46495. this.wireframeLinewidth = 1,
  46496. this.wireframeLinecap = "round",
  46497. this.wireframeLinejoin = "round",
  46498. this.vertexColors = Ci.NoColors,
  46499. this.skinning = !1,
  46500. this.morphTargets = !1,
  46501. this.setValues(e)
  46502. }
  46503. ,
  46504. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46505. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46506. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46507. return Ci.Material.prototype.copy.call(this, e),
  46508. this.color.copy(e.color),
  46509. this.map = e.map,
  46510. this.aoMap = e.aoMap,
  46511. this.aoMapIntensity = e.aoMapIntensity,
  46512. this.specularMap = e.specularMap,
  46513. this.alphaMap = e.alphaMap,
  46514. this.envMap = e.envMap,
  46515. this.combine = e.combine,
  46516. this.reflectivity = e.reflectivity,
  46517. this.refractionRatio = e.refractionRatio,
  46518. this.fog = e.fog,
  46519. this.shading = e.shading,
  46520. this.wireframe = e.wireframe,
  46521. this.wireframeLinewidth = e.wireframeLinewidth,
  46522. this.wireframeLinecap = e.wireframeLinecap,
  46523. this.wireframeLinejoin = e.wireframeLinejoin,
  46524. this.vertexColors = e.vertexColors,
  46525. this.skinning = e.skinning,
  46526. this.morphTargets = e.morphTargets,
  46527. this
  46528. }
  46529. ,
  46530. Ci.MeshLambertMaterial = function(e) {
  46531. Ci.Material.call(this),
  46532. this.type = "MeshLambertMaterial",
  46533. this.color = new Ci.Color(16777215),
  46534. this.map = null,
  46535. this.lightMap = null,
  46536. this.lightMapIntensity = 1,
  46537. this.aoMap = null,
  46538. this.aoMapIntensity = 1,
  46539. this.emissive = new Ci.Color(0),
  46540. this.emissiveIntensity = 1,
  46541. this.emissiveMap = null,
  46542. this.specularMap = null,
  46543. this.alphaMap = null,
  46544. this.envMap = null,
  46545. this.combine = Ci.MultiplyOperation,
  46546. this.reflectivity = 1,
  46547. this.refractionRatio = .98,
  46548. this.fog = !0,
  46549. this.blending = Ci.NormalBlending,
  46550. this.wireframe = !1,
  46551. this.wireframeLinewidth = 1,
  46552. this.wireframeLinecap = "round",
  46553. this.wireframeLinejoin = "round",
  46554. this.vertexColors = Ci.NoColors,
  46555. this.skinning = !1,
  46556. this.morphTargets = !1,
  46557. this.morphNormals = !1,
  46558. this.setValues(e)
  46559. }
  46560. ,
  46561. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46562. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46563. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46564. return Ci.Material.prototype.copy.call(this, e),
  46565. this.color.copy(e.color),
  46566. this.map = e.map,
  46567. this.lightMap = e.lightMap,
  46568. this.lightMapIntensity = e.lightMapIntensity,
  46569. this.aoMap = e.aoMap,
  46570. this.aoMapIntensity = e.aoMapIntensity,
  46571. this.emissive.copy(e.emissive),
  46572. this.emissiveMap = e.emissiveMap,
  46573. this.emissiveIntensity = e.emissiveIntensity,
  46574. this.specularMap = e.specularMap,
  46575. this.alphaMap = e.alphaMap,
  46576. this.envMap = e.envMap,
  46577. this.combine = e.combine,
  46578. this.reflectivity = e.reflectivity,
  46579. this.refractionRatio = e.refractionRatio,
  46580. this.fog = e.fog,
  46581. this.wireframe = e.wireframe,
  46582. this.wireframeLinewidth = e.wireframeLinewidth,
  46583. this.wireframeLinecap = e.wireframeLinecap,
  46584. this.wireframeLinejoin = e.wireframeLinejoin,
  46585. this.vertexColors = e.vertexColors,
  46586. this.skinning = e.skinning,
  46587. this.morphTargets = e.morphTargets,
  46588. this.morphNormals = e.morphNormals,
  46589. this
  46590. }
  46591. ,
  46592. Ci.MeshPhongMaterial = function(e) {
  46593. Ci.Material.call(this),
  46594. this.type = "MeshPhongMaterial",
  46595. this.color = new Ci.Color(16777215),
  46596. this.specular = new Ci.Color(1118481),
  46597. this.shininess = 30,
  46598. this.map = null,
  46599. this.lightMap = null,
  46600. this.lightMapIntensity = 1,
  46601. this.aoMap = null,
  46602. this.aoMapIntensity = 1,
  46603. this.emissive = new Ci.Color(0),
  46604. this.emissiveIntensity = 1,
  46605. this.emissiveMap = null,
  46606. this.bumpMap = null,
  46607. this.bumpScale = 1,
  46608. this.normalMap = null,
  46609. this.normalScale = new Ci.Vector2(1,1),
  46610. this.displacementMap = null,
  46611. this.displacementScale = 1,
  46612. this.displacementBias = 0,
  46613. this.specularMap = null,
  46614. this.alphaMap = null,
  46615. this.envMap = null,
  46616. this.combine = Ci.MultiplyOperation,
  46617. this.reflectivity = 1,
  46618. this.refractionRatio = .98,
  46619. this.fog = !0,
  46620. this.shading = Ci.SmoothShading,
  46621. this.blending = Ci.NormalBlending,
  46622. this.wireframe = !1,
  46623. this.wireframeLinewidth = 1,
  46624. this.wireframeLinecap = "round",
  46625. this.wireframeLinejoin = "round",
  46626. this.vertexColors = Ci.NoColors,
  46627. this.skinning = !1,
  46628. this.morphTargets = !1,
  46629. this.morphNormals = !1,
  46630. this.setValues(e)
  46631. }
  46632. ,
  46633. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46634. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46635. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46636. return Ci.Material.prototype.copy.call(this, e),
  46637. this.color.copy(e.color),
  46638. this.specular.copy(e.specular),
  46639. this.shininess = e.shininess,
  46640. this.map = e.map,
  46641. this.lightMap = e.lightMap,
  46642. this.lightMapIntensity = e.lightMapIntensity,
  46643. this.aoMap = e.aoMap,
  46644. this.aoMapIntensity = e.aoMapIntensity,
  46645. this.emissive.copy(e.emissive),
  46646. this.emissiveMap = e.emissiveMap,
  46647. this.emissiveIntensity = e.emissiveIntensity,
  46648. this.bumpMap = e.bumpMap,
  46649. this.bumpScale = e.bumpScale,
  46650. this.normalMap = e.normalMap,
  46651. this.normalScale.copy(e.normalScale),
  46652. this.displacementMap = e.displacementMap,
  46653. this.displacementScale = e.displacementScale,
  46654. this.displacementBias = e.displacementBias,
  46655. this.specularMap = e.specularMap,
  46656. this.alphaMap = e.alphaMap,
  46657. this.envMap = e.envMap,
  46658. this.combine = e.combine,
  46659. this.reflectivity = e.reflectivity,
  46660. this.refractionRatio = e.refractionRatio,
  46661. this.fog = e.fog,
  46662. this.shading = e.shading,
  46663. this.wireframe = e.wireframe,
  46664. this.wireframeLinewidth = e.wireframeLinewidth,
  46665. this.wireframeLinecap = e.wireframeLinecap,
  46666. this.wireframeLinejoin = e.wireframeLinejoin,
  46667. this.vertexColors = e.vertexColors,
  46668. this.skinning = e.skinning,
  46669. this.morphTargets = e.morphTargets,
  46670. this.morphNormals = e.morphNormals,
  46671. this
  46672. }
  46673. ,
  46674. Ci.MeshStandardMaterial = function(e) {
  46675. Ci.Material.call(this),
  46676. this.type = "MeshStandardMaterial",
  46677. this.color = new Ci.Color(16777215),
  46678. this.roughness = .5,
  46679. this.metalness = .5,
  46680. this.map = null,
  46681. this.lightMap = null,
  46682. this.lightMapIntensity = 1,
  46683. this.aoMap = null,
  46684. this.aoMapIntensity = 1,
  46685. this.emissive = new Ci.Color(0),
  46686. this.emissiveIntensity = 1,
  46687. this.emissiveMap = null,
  46688. this.bumpMap = null,
  46689. this.bumpScale = 1,
  46690. this.normalMap = null,
  46691. this.normalScale = new Ci.Vector2(1,1),
  46692. this.displacementMap = null,
  46693. this.displacementScale = 1,
  46694. this.displacementBias = 0,
  46695. this.roughnessMap = null,
  46696. this.metalnessMap = null,
  46697. this.alphaMap = null,
  46698. this.envMap = null,
  46699. this.envMapIntensity = 1,
  46700. this.refractionRatio = .98,
  46701. this.fog = !0,
  46702. this.shading = Ci.SmoothShading,
  46703. this.blending = Ci.NormalBlending,
  46704. this.wireframe = !1,
  46705. this.wireframeLinewidth = 1,
  46706. this.wireframeLinecap = "round",
  46707. this.wireframeLinejoin = "round",
  46708. this.vertexColors = Ci.NoColors,
  46709. this.skinning = !1,
  46710. this.morphTargets = !1,
  46711. this.morphNormals = !1,
  46712. this.setValues(e)
  46713. }
  46714. ,
  46715. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46716. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46717. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46718. return Ci.Material.prototype.copy.call(this, e),
  46719. this.color.copy(e.color),
  46720. this.roughness = e.roughness,
  46721. this.metalness = e.metalness,
  46722. this.map = e.map,
  46723. this.lightMap = e.lightMap,
  46724. this.lightMapIntensity = e.lightMapIntensity,
  46725. this.aoMap = e.aoMap,
  46726. this.aoMapIntensity = e.aoMapIntensity,
  46727. this.emissive.copy(e.emissive),
  46728. this.emissiveMap = e.emissiveMap,
  46729. this.emissiveIntensity = e.emissiveIntensity,
  46730. this.bumpMap = e.bumpMap,
  46731. this.bumpScale = e.bumpScale,
  46732. this.normalMap = e.normalMap,
  46733. this.normalScale.copy(e.normalScale),
  46734. this.displacementMap = e.displacementMap,
  46735. this.displacementScale = e.displacementScale,
  46736. this.displacementBias = e.displacementBias,
  46737. this.roughnessMap = e.roughnessMap,
  46738. this.metalnessMap = e.metalnessMap,
  46739. this.alphaMap = e.alphaMap,
  46740. this.envMap = e.envMap,
  46741. this.envMapIntensity = e.envMapIntensity,
  46742. this.refractionRatio = e.refractionRatio,
  46743. this.fog = e.fog,
  46744. this.shading = e.shading,
  46745. this.wireframe = e.wireframe,
  46746. this.wireframeLinewidth = e.wireframeLinewidth,
  46747. this.wireframeLinecap = e.wireframeLinecap,
  46748. this.wireframeLinejoin = e.wireframeLinejoin,
  46749. this.vertexColors = e.vertexColors,
  46750. this.skinning = e.skinning,
  46751. this.morphTargets = e.morphTargets,
  46752. this.morphNormals = e.morphNormals,
  46753. this
  46754. }
  46755. ,
  46756. Ci.MeshDepthMaterial = function(e) {
  46757. Ci.Material.call(this),
  46758. this.type = "MeshDepthMaterial",
  46759. this.morphTargets = !1,
  46760. this.wireframe = !1,
  46761. this.wireframeLinewidth = 1,
  46762. this.setValues(e)
  46763. }
  46764. ,
  46765. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46766. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46767. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46768. return Ci.Material.prototype.copy.call(this, e),
  46769. this.wireframe = e.wireframe,
  46770. this.wireframeLinewidth = e.wireframeLinewidth,
  46771. this
  46772. }
  46773. ,
  46774. Ci.MeshNormalMaterial = function(e) {
  46775. Ci.Material.call(this, e),
  46776. this.type = "MeshNormalMaterial",
  46777. this.wireframe = !1,
  46778. this.wireframeLinewidth = 1,
  46779. this.morphTargets = !1,
  46780. this.setValues(e)
  46781. }
  46782. ,
  46783. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46784. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46785. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46786. return Ci.Material.prototype.copy.call(this, e),
  46787. this.wireframe = e.wireframe,
  46788. this.wireframeLinewidth = e.wireframeLinewidth,
  46789. this
  46790. }
  46791. ,
  46792. Ci.MultiMaterial = function(e) {
  46793. this.uuid = Ci.Math.generateUUID(),
  46794. this.type = "MultiMaterial",
  46795. this.materials = e instanceof Array ? e : [],
  46796. this.visible = !0
  46797. }
  46798. ,
  46799. Ci.MultiMaterial.prototype = {
  46800. constructor: Ci.MultiMaterial,
  46801. toJSON: function(e) {
  46802. for (var t = {
  46803. metadata: {
  46804. version: 4.2,
  46805. type: "material",
  46806. generator: "MaterialExporter"
  46807. },
  46808. uuid: this.uuid,
  46809. type: this.type,
  46810. materials: []
  46811. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46812. var o = i[n].toJSON(e);
  46813. delete o.metadata,
  46814. t.materials.push(o)
  46815. }
  46816. return t.visible = this.visible,
  46817. t
  46818. },
  46819. clone: function() {
  46820. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46821. e.materials.push(this.materials[t].clone());
  46822. return e.visible = this.visible,
  46823. e
  46824. }
  46825. },
  46826. Ci.PointsMaterial = function(e) {
  46827. Ci.Material.call(this),
  46828. this.type = "PointsMaterial",
  46829. this.color = new Ci.Color(16777215),
  46830. this.map = null,
  46831. this.size = 1,
  46832. this.sizeAttenuation = !0,
  46833. this.blending = Ci.NormalBlending,
  46834. this.vertexColors = Ci.NoColors,
  46835. this.fog = !0,
  46836. this.setValues(e)
  46837. }
  46838. ,
  46839. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46840. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46841. Ci.PointsMaterial.prototype.copy = function(e) {
  46842. return Ci.Material.prototype.copy.call(this, e),
  46843. this.color.copy(e.color),
  46844. this.map = e.map,
  46845. this.size = e.size,
  46846. this.sizeAttenuation = e.sizeAttenuation,
  46847. this.vertexColors = e.vertexColors,
  46848. this.fog = e.fog,
  46849. this
  46850. }
  46851. ,
  46852. Ci.ShaderMaterial = function(e) {
  46853. Ci.Material.call(this),
  46854. this.type = "ShaderMaterial",
  46855. this.defines = {},
  46856. this.uniforms = {},
  46857. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46858. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46859. this.shading = Ci.SmoothShading,
  46860. this.linewidth = 1,
  46861. this.wireframe = !1,
  46862. this.wireframeLinewidth = 1,
  46863. this.fog = !1,
  46864. this.lights = !1,
  46865. this.vertexColors = Ci.NoColors,
  46866. this.skinning = !1,
  46867. this.morphTargets = !1,
  46868. this.morphNormals = !1,
  46869. this.extensions = {
  46870. derivatives: !1,
  46871. fragDepth: !1,
  46872. drawBuffers: !1,
  46873. shaderTextureLOD: !1
  46874. },
  46875. this.defaultAttributeValues = {
  46876. color: [1, 1, 1],
  46877. uv: [0, 0],
  46878. uv2: [0, 0]
  46879. },
  46880. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46881. this.setValues(e))
  46882. }
  46883. ,
  46884. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46885. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46886. Ci.ShaderMaterial.prototype.copy = function(e) {
  46887. return Ci.Material.prototype.copy.call(this, e),
  46888. this.fragmentShader = e.fragmentShader,
  46889. this.vertexShader = e.vertexShader,
  46890. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46891. this.defines = e.defines,
  46892. this.shading = e.shading,
  46893. this.wireframe = e.wireframe,
  46894. this.wireframeLinewidth = e.wireframeLinewidth,
  46895. this.fog = e.fog,
  46896. this.lights = e.lights,
  46897. this.vertexColors = e.vertexColors,
  46898. this.skinning = e.skinning,
  46899. this.morphTargets = e.morphTargets,
  46900. this.morphNormals = e.morphNormals,
  46901. this.extensions = e.extensions,
  46902. this
  46903. }
  46904. ,
  46905. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46906. var t = Ci.Material.prototype.toJSON.call(this, e);
  46907. return t.uniforms = this.uniforms,
  46908. t.vertexShader = this.vertexShader,
  46909. t.fragmentShader = this.fragmentShader,
  46910. t
  46911. }
  46912. ,
  46913. Ci.RawShaderMaterial = function(e) {
  46914. Ci.ShaderMaterial.call(this, e),
  46915. this.type = "RawShaderMaterial"
  46916. }
  46917. ,
  46918. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46919. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46920. Ci.SpriteMaterial = function(e) {
  46921. Ci.Material.call(this),
  46922. this.type = "SpriteMaterial",
  46923. this.color = new Ci.Color(16777215),
  46924. this.map = null,
  46925. this.rotation = 0,
  46926. this.fog = !1,
  46927. this.setValues(e)
  46928. }
  46929. ,
  46930. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46931. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46932. Ci.SpriteMaterial.prototype.copy = function(e) {
  46933. return Ci.Material.prototype.copy.call(this, e),
  46934. this.color.copy(e.color),
  46935. this.map = e.map,
  46936. this.rotation = e.rotation,
  46937. this.fog = e.fog,
  46938. this
  46939. }
  46940. ,
  46941. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46942. Object.defineProperty(this, "id", {
  46943. value: Ci.TextureIdCount++
  46944. }),
  46945. this.uuid = Ci.Math.generateUUID(),
  46946. this.name = "",
  46947. this.sourceFile = "",
  46948. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46949. this.mipmaps = [],
  46950. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46951. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46952. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46953. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46954. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46955. this.anisotropy = void 0 !== l ? l : 1,
  46956. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46957. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46958. this.offset = new Ci.Vector2(0,0),
  46959. this.repeat = new Ci.Vector2(1,1),
  46960. this.generateMipmaps = !0,
  46961. this.premultiplyAlpha = !1,
  46962. this.flipY = !0,
  46963. this.unpackAlignment = 4,
  46964. this.encoding = Ci.LinearEncoding,
  46965. this.version = 0,
  46966. this.onUpdate = null
  46967. }
  46968. ,
  46969. Ci.Texture.DEFAULT_IMAGE = void 0,
  46970. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46971. Ci.Texture.prototype = {
  46972. constructor: Ci.Texture,
  46973. set needsUpdate(e) {
  46974. !0 === e && this.version++
  46975. },
  46976. clone: function() {
  46977. return (new this.constructor).copy(this)
  46978. },
  46979. copy: function(e) {
  46980. return this.image = e.image,
  46981. this.mipmaps = e.mipmaps.slice(0),
  46982. this.mapping = e.mapping,
  46983. this.wrapS = e.wrapS,
  46984. this.wrapT = e.wrapT,
  46985. this.magFilter = e.magFilter,
  46986. this.minFilter = e.minFilter,
  46987. this.anisotropy = e.anisotropy,
  46988. this.format = e.format,
  46989. this.type = e.type,
  46990. this.offset.copy(e.offset),
  46991. this.repeat.copy(e.repeat),
  46992. this.generateMipmaps = e.generateMipmaps,
  46993. this.premultiplyAlpha = e.premultiplyAlpha,
  46994. this.flipY = e.flipY,
  46995. this.unpackAlignment = e.unpackAlignment,
  46996. this.encoding = e.encoding,
  46997. this
  46998. },
  46999. toJSON: function(e) {
  47000. if (void 0 !== e.textures[this.uuid])
  47001. return e.textures[this.uuid];
  47002. var t, i, n = {
  47003. metadata: {
  47004. version: 4.4,
  47005. type: "Texture",
  47006. generator: "Texture.toJSON"
  47007. },
  47008. uuid: this.uuid,
  47009. name: this.name,
  47010. mapping: this.mapping,
  47011. repeat: [this.repeat.x, this.repeat.y],
  47012. offset: [this.offset.x, this.offset.y],
  47013. wrap: [this.wrapS, this.wrapT],
  47014. minFilter: this.minFilter,
  47015. magFilter: this.magFilter,
  47016. anisotropy: this.anisotropy
  47017. };
  47018. if (void 0 !== this.image) {
  47019. var r = this.image;
  47020. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47021. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47022. uuid: r.uuid,
  47023. url: (t = r,
  47024. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47025. i.height = t.height,
  47026. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47027. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47028. }),
  47029. n.image = r.uuid
  47030. }
  47031. return e.textures[this.uuid] = n
  47032. },
  47033. dispose: function() {
  47034. this.dispatchEvent({
  47035. type: "dispose"
  47036. })
  47037. },
  47038. transformUv: function(e) {
  47039. if (this.mapping === Ci.UVMapping) {
  47040. if (e.multiply(this.repeat),
  47041. e.add(this.offset),
  47042. e.x < 0 || 1 < e.x)
  47043. switch (this.wrapS) {
  47044. case Ci.RepeatWrapping:
  47045. e.x = e.x - Math.floor(e.x);
  47046. break;
  47047. case Ci.ClampToEdgeWrapping:
  47048. e.x = e.x < 0 ? 0 : 1;
  47049. break;
  47050. case Ci.MirroredRepeatWrapping:
  47051. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47052. }
  47053. if (e.y < 0 || 1 < e.y)
  47054. switch (this.wrapT) {
  47055. case Ci.RepeatWrapping:
  47056. e.y = e.y - Math.floor(e.y);
  47057. break;
  47058. case Ci.ClampToEdgeWrapping:
  47059. e.y = e.y < 0 ? 0 : 1;
  47060. break;
  47061. case Ci.MirroredRepeatWrapping:
  47062. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47063. }
  47064. this.flipY && (e.y = 1 - e.y)
  47065. }
  47066. }
  47067. },
  47068. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47069. Ci.TextureIdCount = 0,
  47070. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47071. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47072. this.needsUpdate = !0
  47073. }
  47074. ,
  47075. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47076. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47077. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47078. e = void 0 !== e ? e : [],
  47079. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47080. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47081. this.flipY = !1
  47082. }
  47083. ,
  47084. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47085. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47086. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47087. get: function() {
  47088. return this.image
  47089. },
  47090. set: function(e) {
  47091. this.image = e
  47092. }
  47093. }),
  47094. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47095. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47096. this.image = {
  47097. width: t,
  47098. height: i
  47099. },
  47100. this.mipmaps = e,
  47101. this.flipY = !1,
  47102. this.generateMipmaps = !1
  47103. }
  47104. ,
  47105. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47106. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47107. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47108. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47109. this.image = {
  47110. data: e,
  47111. width: t,
  47112. height: i
  47113. },
  47114. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47115. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47116. this.flipY = !1,
  47117. this.generateMipmaps = !1
  47118. }
  47119. ,
  47120. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47121. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47122. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47123. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47124. this.generateMipmaps = !1;
  47125. var c = this;
  47126. !function e() {
  47127. requestAnimationFrame(e),
  47128. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47129. }()
  47130. }
  47131. ,
  47132. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47133. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47134. Ci.Group = function() {
  47135. Ci.Object3D.call(this),
  47136. this.type = "Group"
  47137. }
  47138. ,
  47139. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47140. Ci.Group.prototype.constructor = Ci.Group,
  47141. Ci.Points = function(e, t) {
  47142. Ci.Object3D.call(this),
  47143. this.type = "Points",
  47144. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47145. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47146. color: 16777215 * Math.random()
  47147. })
  47148. }
  47149. ,
  47150. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47151. Ci.Points.prototype.constructor = Ci.Points,
  47152. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47153. jt = new Ci.Ray,
  47154. Yt = new Ci.Sphere,
  47155. function(o, a) {
  47156. function e(e, t) {
  47157. var i = jt.distanceSqToPoint(e);
  47158. if (i < c) {
  47159. var n = jt.closestPointToPoint(e);
  47160. n.applyMatrix4(l);
  47161. var r = o.ray.origin.distanceTo(n);
  47162. if (r < o.near || r > o.far)
  47163. return;
  47164. a.push({
  47165. distance: r,
  47166. distanceToRay: Math.sqrt(i),
  47167. point: n.clone(),
  47168. index: t,
  47169. face: null,
  47170. object: s
  47171. })
  47172. }
  47173. }
  47174. var s = this
  47175. , t = this.geometry
  47176. , l = this.matrixWorld
  47177. , i = o.params.Points.threshold;
  47178. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47179. Yt.copy(t.boundingSphere),
  47180. Yt.applyMatrix4(l),
  47181. !1 !== o.ray.intersectsSphere(Yt)) {
  47182. Wt.getInverse(l),
  47183. jt.copy(o.ray).applyMatrix4(Wt);
  47184. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47185. , c = n * n
  47186. , r = new Ci.Vector3;
  47187. if (t instanceof Ci.BufferGeometry) {
  47188. var h = t.index
  47189. , u = t.attributes.position.array;
  47190. if (null !== h)
  47191. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47192. var g = d[p];
  47193. r.fromArray(u, 3 * g),
  47194. e(r, g)
  47195. }
  47196. else {
  47197. p = 0;
  47198. for (var m = u.length / 3; p < m; p++)
  47199. r.fromArray(u, 3 * p),
  47200. e(r, p)
  47201. }
  47202. } else {
  47203. var v = t.vertices;
  47204. for (p = 0,
  47205. m = v.length; p < m; p++)
  47206. e(v[p], p)
  47207. }
  47208. }
  47209. }
  47210. ),
  47211. Ci.Points.prototype.clone = function() {
  47212. return new this.constructor(this.geometry,this.material).copy(this)
  47213. }
  47214. ,
  47215. Ci.Line = function(e, t, i) {
  47216. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47217. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47218. this.type = "Line",
  47219. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47220. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47221. color: 16777215 * Math.random()
  47222. })))
  47223. }
  47224. ,
  47225. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47226. Ci.Line.prototype.constructor = Ci.Line,
  47227. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47228. zt = new Ci.Ray,
  47229. Gt = new Ci.Sphere,
  47230. function(e, t) {
  47231. var i = e.linePrecision
  47232. , n = i * i
  47233. , r = this.geometry
  47234. , o = this.matrixWorld;
  47235. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47236. Gt.copy(r.boundingSphere),
  47237. Gt.applyMatrix4(o),
  47238. !1 !== e.ray.intersectsSphere(Gt)) {
  47239. Ht.getInverse(o),
  47240. zt.copy(e.ray).applyMatrix4(Ht);
  47241. var a = new Ci.Vector3
  47242. , s = new Ci.Vector3
  47243. , l = new Ci.Vector3
  47244. , c = new Ci.Vector3
  47245. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47246. if (r instanceof Ci.BufferGeometry) {
  47247. var u = r.index
  47248. , d = r.attributes.position.array;
  47249. if (null !== u)
  47250. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47251. var m = p[f]
  47252. , v = p[f + 1];
  47253. a.fromArray(d, 3 * m),
  47254. s.fromArray(d, 3 * v),
  47255. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47256. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47257. distance: C,
  47258. point: l.clone().applyMatrix4(this.matrixWorld),
  47259. index: f,
  47260. face: null,
  47261. faceIndex: null,
  47262. object: this
  47263. }))
  47264. }
  47265. else
  47266. for (f = 0,
  47267. g = d.length / 3 - 1; f < g; f += h)
  47268. a.fromArray(d, 3 * f),
  47269. s.fromArray(d, 3 * f + 3),
  47270. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47271. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47272. distance: C,
  47273. point: l.clone().applyMatrix4(this.matrixWorld),
  47274. index: f,
  47275. face: null,
  47276. faceIndex: null,
  47277. object: this
  47278. }))
  47279. } else if (r instanceof Ci.Geometry) {
  47280. var y = r.vertices
  47281. , A = y.length;
  47282. for (f = 0; f < A - 1; f += h) {
  47283. var C;
  47284. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47285. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47286. distance: C,
  47287. point: l.clone().applyMatrix4(this.matrixWorld),
  47288. index: f,
  47289. face: null,
  47290. faceIndex: null,
  47291. object: this
  47292. }))
  47293. }
  47294. }
  47295. }
  47296. }
  47297. ),
  47298. Ci.Line.prototype.clone = function() {
  47299. return new this.constructor(this.geometry,this.material).copy(this)
  47300. }
  47301. ,
  47302. Ci.LineStrip = 0,
  47303. Ci.LinePieces = 1,
  47304. Ci.LineSegments = function(e, t) {
  47305. Ci.Line.call(this, e, t),
  47306. this.type = "LineSegments"
  47307. }
  47308. ,
  47309. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47310. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47311. Ci.Mesh = function(e, t) {
  47312. Ci.Object3D.call(this),
  47313. this.type = "Mesh",
  47314. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47315. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47316. color: 16777215 * Math.random()
  47317. }),
  47318. this.drawMode = Ci.TrianglesDrawMode,
  47319. this.updateMorphTargets()
  47320. }
  47321. ,
  47322. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47323. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47324. Ci.Mesh.prototype.setDrawMode = function(e) {
  47325. this.drawMode = e
  47326. }
  47327. ,
  47328. Ci.Mesh.prototype.updateMorphTargets = function() {
  47329. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47330. this.morphTargetBase = -1,
  47331. this.morphTargetInfluences = [],
  47332. this.morphTargetDictionary = {};
  47333. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47334. this.morphTargetInfluences.push(0),
  47335. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47336. }
  47337. }
  47338. ,
  47339. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47340. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47341. 0)
  47342. }
  47343. ,
  47344. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47345. xt = new Ci.Ray,
  47346. St = new Ci.Sphere,
  47347. Mt = new Ci.Vector3,
  47348. Rt = new Ci.Vector3,
  47349. Pt = new Ci.Vector3,
  47350. Ot = new Ci.Vector3,
  47351. Lt = new Ci.Vector3,
  47352. Dt = new Ci.Vector3,
  47353. Nt = new Ci.Vector2,
  47354. Ft = new Ci.Vector2,
  47355. Bt = new Ci.Vector2,
  47356. Vt = new Ci.Vector3,
  47357. kt = new Ci.Vector3,
  47358. Ut = new Ci.Vector3,
  47359. function(e, t) {
  47360. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47361. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47362. St.copy(r.boundingSphere),
  47363. St.applyMatrix4(a),
  47364. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47365. xt.copy(e.ray).applyMatrix4(Tt),
  47366. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47367. if (r instanceof Ci.BufferGeometry) {
  47368. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47369. if (void 0 !== u.uv && (i = u.uv.array),
  47370. null !== h)
  47371. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47372. s = p[f],
  47373. l = p[f + 1],
  47374. c = p[f + 2],
  47375. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47376. t.push(n));
  47377. else
  47378. for (f = 0,
  47379. g = d.length; f < g; f += 9)
  47380. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47381. t.push(n))
  47382. } else if (r instanceof Ci.Geometry) {
  47383. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47384. 0 < _.length && (i = _);
  47385. for (var b = 0, w = E.length; b < w; b++) {
  47386. var T = E[b]
  47387. , x = 1 == A ? C[T.materialIndex] : o;
  47388. if (void 0 !== x) {
  47389. if (m = I[T.a],
  47390. v = I[T.b],
  47391. y = I[T.c],
  47392. !0 === x.morphTargets) {
  47393. var S = r.morphTargets
  47394. , M = this.morphTargetInfluences;
  47395. Mt.set(0, 0, 0),
  47396. Rt.set(0, 0, 0),
  47397. Pt.set(0, 0, 0);
  47398. for (var R = 0, P = S.length; R < P; R++) {
  47399. var O = M[R];
  47400. if (0 !== O) {
  47401. var L = S[R].vertices;
  47402. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47403. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47404. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47405. }
  47406. }
  47407. Mt.add(m),
  47408. Rt.add(v),
  47409. Pt.add(y),
  47410. m = Mt,
  47411. v = Rt,
  47412. y = Pt
  47413. }
  47414. if (n = wi(this, e, xt, m, v, y, kt)) {
  47415. if (i) {
  47416. var D = i[b];
  47417. Nt.copy(D[0]),
  47418. Ft.copy(D[1]),
  47419. Bt.copy(D[2]),
  47420. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47421. }
  47422. n.face = T,
  47423. n.faceIndex = b,
  47424. t.push(n)
  47425. }
  47426. }
  47427. }
  47428. }
  47429. }
  47430. ),
  47431. Ci.Mesh.prototype.clone = function() {
  47432. return new this.constructor(this.geometry,this.material).copy(this)
  47433. }
  47434. ,
  47435. Ci.Bone = function(e) {
  47436. Ci.Object3D.call(this),
  47437. this.type = "Bone",
  47438. this.skin = e
  47439. }
  47440. ,
  47441. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47442. Ci.Bone.prototype.constructor = Ci.Bone,
  47443. Ci.Bone.prototype.copy = function(e) {
  47444. return Ci.Object3D.prototype.copy.call(this, e),
  47445. this.skin = e.skin,
  47446. this
  47447. }
  47448. ,
  47449. Ci.Skeleton = function(e, t, i) {
  47450. if (this.useVertexTexture = void 0 === i || i,
  47451. this.identityMatrix = new Ci.Matrix4,
  47452. e = e || [],
  47453. this.bones = e.slice(0),
  47454. this.useVertexTexture) {
  47455. var n = Math.sqrt(4 * this.bones.length);
  47456. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47457. n = Math.max(n, 4),
  47458. this.boneTextureWidth = n,
  47459. this.boneTextureHeight = n,
  47460. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47461. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47462. } else
  47463. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47464. if (void 0 === t)
  47465. this.calculateInverses();
  47466. else if (this.bones.length === t.length)
  47467. this.boneInverses = t.slice(0);
  47468. else {
  47469. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47470. this.boneInverses = [];
  47471. for (var r = 0, o = this.bones.length; r < o; r++)
  47472. this.boneInverses.push(new Ci.Matrix4)
  47473. }
  47474. }
  47475. ,
  47476. Ci.Skeleton.prototype.calculateInverses = function() {
  47477. this.boneInverses = [];
  47478. for (var e = 0, t = this.bones.length; e < t; e++) {
  47479. var i = new Ci.Matrix4;
  47480. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47481. this.boneInverses.push(i)
  47482. }
  47483. }
  47484. ,
  47485. Ci.Skeleton.prototype.pose = function() {
  47486. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47487. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47488. for (t = 0,
  47489. i = this.bones.length; t < i; t++)
  47490. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47491. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47492. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47493. }
  47494. ,
  47495. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47496. function() {
  47497. for (var e = 0, t = this.bones.length; e < t; e++) {
  47498. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47499. wt.multiplyMatrices(i, this.boneInverses[e]),
  47500. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47501. }
  47502. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47503. }
  47504. ),
  47505. Ci.Skeleton.prototype.clone = function() {
  47506. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47507. }
  47508. ,
  47509. Ci.SkinnedMesh = function(e, t, i) {
  47510. Ci.Mesh.call(this, e, t),
  47511. this.type = "SkinnedMesh",
  47512. this.bindMode = "attached",
  47513. this.bindMatrix = new Ci.Matrix4,
  47514. this.bindMatrixInverse = new Ci.Matrix4;
  47515. var n = [];
  47516. if (this.geometry && void 0 !== this.geometry.bones) {
  47517. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47518. o = this.geometry.bones[a],
  47519. r = new Ci.Bone(this),
  47520. n.push(r),
  47521. r.name = o.name,
  47522. r.position.fromArray(o.pos),
  47523. r.quaternion.fromArray(o.rotq),
  47524. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47525. for (a = 0,
  47526. s = this.geometry.bones.length; a < s; ++a)
  47527. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47528. }
  47529. this.normalizeSkinWeights(),
  47530. this.updateMatrixWorld(!0),
  47531. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47532. }
  47533. ,
  47534. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47535. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47536. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47537. this.skeleton = e,
  47538. void 0 === t && (this.updateMatrixWorld(!0),
  47539. this.skeleton.calculateInverses(),
  47540. t = this.matrixWorld),
  47541. this.bindMatrix.copy(t),
  47542. this.bindMatrixInverse.getInverse(t)
  47543. }
  47544. ,
  47545. Ci.SkinnedMesh.prototype.pose = function() {
  47546. this.skeleton.pose()
  47547. }
  47548. ,
  47549. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47550. if (this.geometry instanceof Ci.Geometry)
  47551. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47552. var t = this.geometry.skinWeights[e];
  47553. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47554. }
  47555. else if (this.geometry instanceof Ci.BufferGeometry) {
  47556. var i = new Ci.Vector4
  47557. , n = this.geometry.attributes.skinWeight;
  47558. for (e = 0; e < n.count; e++) {
  47559. var r;
  47560. i.x = n.getX(e),
  47561. i.y = n.getY(e),
  47562. i.z = n.getZ(e),
  47563. i.w = n.getW(e),
  47564. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47565. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47566. }
  47567. }
  47568. }
  47569. ,
  47570. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47571. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47572. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47573. }
  47574. ,
  47575. Ci.SkinnedMesh.prototype.clone = function() {
  47576. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47577. }
  47578. ,
  47579. Ci.LOD = function() {
  47580. Ci.Object3D.call(this),
  47581. this.type = "LOD",
  47582. Object.defineProperties(this, {
  47583. levels: {
  47584. enumerable: !0,
  47585. value: []
  47586. },
  47587. objects: {
  47588. get: function() {
  47589. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47590. this.levels
  47591. }
  47592. }
  47593. })
  47594. }
  47595. ,
  47596. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47597. Ci.LOD.prototype.constructor = Ci.LOD,
  47598. Ci.LOD.prototype.addLevel = function(e, t) {
  47599. void 0 === t && (t = 0),
  47600. t = Math.abs(t);
  47601. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47602. ;
  47603. i.splice(n, 0, {
  47604. distance: t,
  47605. object: e
  47606. }),
  47607. this.add(e)
  47608. }
  47609. ,
  47610. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47611. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47612. ;
  47613. return t[i - 1].object
  47614. }
  47615. ,
  47616. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47617. function(e, t) {
  47618. bt.setFromMatrixPosition(this.matrixWorld);
  47619. var i = e.ray.origin.distanceTo(bt);
  47620. this.getObjectForDistance(i).raycast(e, t)
  47621. }
  47622. ),
  47623. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47624. _t = new Ci.Vector3,
  47625. function(e) {
  47626. var t = this.levels;
  47627. if (1 < t.length) {
  47628. Et.setFromMatrixPosition(e.matrixWorld),
  47629. _t.setFromMatrixPosition(this.matrixWorld);
  47630. var i = Et.distanceTo(_t);
  47631. t[0].object.visible = !0;
  47632. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47633. t[n - 1].object.visible = !1,
  47634. t[n].object.visible = !0;
  47635. for (; n < r; n++)
  47636. t[n].object.visible = !1
  47637. }
  47638. }
  47639. ),
  47640. Ci.LOD.prototype.copy = function(e) {
  47641. Ci.Object3D.prototype.copy.call(this, e, !1);
  47642. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47643. var r = t[i];
  47644. this.addLevel(r.object.clone(), r.distance)
  47645. }
  47646. return this
  47647. }
  47648. ,
  47649. Ci.LOD.prototype.toJSON = function(e) {
  47650. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47651. t.object.levels = [];
  47652. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47653. var o = i[n];
  47654. t.object.levels.push({
  47655. object: o.object.uuid,
  47656. distance: o.distance
  47657. })
  47658. }
  47659. return t
  47660. }
  47661. ,
  47662. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47663. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47664. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47665. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47666. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47667. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47668. function(e) {
  47669. Ci.Object3D.call(this),
  47670. this.type = "Sprite",
  47671. this.geometry = It,
  47672. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47673. }
  47674. ),
  47675. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47676. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47677. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47678. function(e, t) {
  47679. vt.setFromMatrixPosition(this.matrixWorld);
  47680. var i = e.ray.distanceSqToPoint(vt);
  47681. this.scale.x * this.scale.y < i || t.push({
  47682. distance: Math.sqrt(i),
  47683. point: this.position,
  47684. face: null,
  47685. object: this
  47686. })
  47687. }
  47688. ),
  47689. Ci.Sprite.prototype.clone = function() {
  47690. return new this.constructor(this.material).copy(this)
  47691. }
  47692. ,
  47693. Ci.Particle = Ci.Sprite,
  47694. Ci.LensFlare = function(e, t, i, n, r) {
  47695. Ci.Object3D.call(this),
  47696. this.lensFlares = [],
  47697. this.positionScreen = new Ci.Vector3,
  47698. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47699. }
  47700. ,
  47701. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47702. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47703. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47704. void 0 === t && (t = -1),
  47705. void 0 === i && (i = 0),
  47706. void 0 === o && (o = 1),
  47707. void 0 === r && (r = new Ci.Color(16777215)),
  47708. void 0 === n && (n = Ci.NormalBlending),
  47709. i = Math.min(i, Math.max(0, i)),
  47710. this.lensFlares.push({
  47711. texture: e,
  47712. size: t,
  47713. distance: i,
  47714. x: 0,
  47715. y: 0,
  47716. z: 0,
  47717. scale: 1,
  47718. rotation: 0,
  47719. opacity: o,
  47720. color: r,
  47721. blending: n
  47722. })
  47723. }
  47724. ,
  47725. Ci.LensFlare.prototype.updateLensFlares = function() {
  47726. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47727. for (e = 0; e < i; e++)
  47728. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47729. t.y = this.positionScreen.y + r * t.distance,
  47730. t.wantedRotation = t.x * Math.PI * .25,
  47731. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47732. }
  47733. ,
  47734. Ci.LensFlare.prototype.copy = function(e) {
  47735. Ci.Object3D.prototype.copy.call(this, e),
  47736. this.positionScreen.copy(e.positionScreen),
  47737. this.customUpdateCallback = e.customUpdateCallback;
  47738. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47739. this.lensFlares.push(e.lensFlares[t]);
  47740. return this
  47741. }
  47742. ,
  47743. Ci.Scene = function() {
  47744. Ci.Object3D.call(this),
  47745. this.type = "Scene",
  47746. this.fog = null,
  47747. this.overrideMaterial = null,
  47748. this.autoUpdate = !0
  47749. }
  47750. ,
  47751. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47752. Ci.Scene.prototype.constructor = Ci.Scene,
  47753. Ci.Scene.prototype.copy = function(e, t) {
  47754. return Ci.Object3D.prototype.copy.call(this, e, t),
  47755. null !== e.fog && (this.fog = e.fog.clone()),
  47756. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47757. this.autoUpdate = e.autoUpdate,
  47758. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47759. this
  47760. }
  47761. ,
  47762. Ci.Fog = function(e, t, i) {
  47763. this.name = "",
  47764. this.color = new Ci.Color(e),
  47765. this.near = void 0 !== t ? t : 1,
  47766. this.far = void 0 !== i ? i : 1e3
  47767. }
  47768. ,
  47769. Ci.Fog.prototype.clone = function() {
  47770. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47771. }
  47772. ,
  47773. Ci.FogExp2 = function(e, t) {
  47774. this.name = "",
  47775. this.color = new Ci.Color(e),
  47776. this.density = void 0 !== t ? t : 25e-5
  47777. }
  47778. ,
  47779. Ci.FogExp2.prototype.clone = function() {
  47780. return new Ci.FogExp2(this.color.getHex(),this.density)
  47781. }
  47782. ,
  47783. Ci.ShaderChunk = {},
  47784. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47785. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47786. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47787. 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",
  47788. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47789. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47790. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47791. 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",
  47792. 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",
  47793. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47794. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47795. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47796. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47797. 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",
  47798. 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",
  47799. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47800. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47801. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47802. 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",
  47803. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47804. 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",
  47805. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47806. 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",
  47807. 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",
  47808. 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",
  47809. 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",
  47810. 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",
  47811. 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",
  47812. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47813. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47814. 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",
  47815. 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",
  47816. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47817. 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",
  47818. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47819. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47820. 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",
  47821. 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",
  47822. 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",
  47823. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47824. 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",
  47825. 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",
  47826. 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",
  47827. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47828. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47829. 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",
  47830. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47831. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47832. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47833. 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",
  47834. 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",
  47835. 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",
  47836. 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",
  47837. 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",
  47838. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47839. 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",
  47840. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47841. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47842. 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",
  47843. 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",
  47844. 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",
  47845. 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",
  47846. 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",
  47847. 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",
  47848. 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",
  47849. 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",
  47850. 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",
  47851. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47852. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47853. 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",
  47854. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47855. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47856. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47857. 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",
  47858. 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",
  47859. 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",
  47860. 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",
  47861. Ci.UniformsUtils = {
  47862. merge: function(e) {
  47863. for (var t = {}, i = 0; i < e.length; i++) {
  47864. var n = this.clone(e[i]);
  47865. for (var r in n)
  47866. t[r] = n[r]
  47867. }
  47868. return t
  47869. },
  47870. clone: function(e) {
  47871. var t = {};
  47872. for (var i in e)
  47873. for (var n in t[i] = {},
  47874. e[i]) {
  47875. var r = e[i][n];
  47876. 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
  47877. }
  47878. return t
  47879. }
  47880. },
  47881. Ci.UniformsLib = {
  47882. common: {
  47883. diffuse: {
  47884. type: "c",
  47885. value: new Ci.Color(15658734)
  47886. },
  47887. opacity: {
  47888. type: "f",
  47889. value: 1
  47890. },
  47891. map: {
  47892. type: "t",
  47893. value: null
  47894. },
  47895. offsetRepeat: {
  47896. type: "v4",
  47897. value: new Ci.Vector4(0,0,1,1)
  47898. },
  47899. specularMap: {
  47900. type: "t",
  47901. value: null
  47902. },
  47903. alphaMap: {
  47904. type: "t",
  47905. value: null
  47906. },
  47907. envMap: {
  47908. type: "t",
  47909. value: null
  47910. },
  47911. flipEnvMap: {
  47912. type: "f",
  47913. value: -1
  47914. },
  47915. reflectivity: {
  47916. type: "f",
  47917. value: 1
  47918. },
  47919. refractionRatio: {
  47920. type: "f",
  47921. value: .98
  47922. }
  47923. },
  47924. aomap: {
  47925. aoMap: {
  47926. type: "t",
  47927. value: null
  47928. },
  47929. aoMapIntensity: {
  47930. type: "f",
  47931. value: 1
  47932. }
  47933. },
  47934. lightmap: {
  47935. lightMap: {
  47936. type: "t",
  47937. value: null
  47938. },
  47939. lightMapIntensity: {
  47940. type: "f",
  47941. value: 1
  47942. }
  47943. },
  47944. emissivemap: {
  47945. emissiveMap: {
  47946. type: "t",
  47947. value: null
  47948. }
  47949. },
  47950. bumpmap: {
  47951. bumpMap: {
  47952. type: "t",
  47953. value: null
  47954. },
  47955. bumpScale: {
  47956. type: "f",
  47957. value: 1
  47958. }
  47959. },
  47960. normalmap: {
  47961. normalMap: {
  47962. type: "t",
  47963. value: null
  47964. },
  47965. normalScale: {
  47966. type: "v2",
  47967. value: new Ci.Vector2(1,1)
  47968. }
  47969. },
  47970. displacementmap: {
  47971. displacementMap: {
  47972. type: "t",
  47973. value: null
  47974. },
  47975. displacementScale: {
  47976. type: "f",
  47977. value: 1
  47978. },
  47979. displacementBias: {
  47980. type: "f",
  47981. value: 0
  47982. }
  47983. },
  47984. roughnessmap: {
  47985. roughnessMap: {
  47986. type: "t",
  47987. value: null
  47988. }
  47989. },
  47990. metalnessmap: {
  47991. metalnessMap: {
  47992. type: "t",
  47993. value: null
  47994. }
  47995. },
  47996. fog: {
  47997. fogDensity: {
  47998. type: "f",
  47999. value: 25e-5
  48000. },
  48001. fogNear: {
  48002. type: "f",
  48003. value: 1
  48004. },
  48005. fogFar: {
  48006. type: "f",
  48007. value: 2e3
  48008. },
  48009. fogColor: {
  48010. type: "c",
  48011. value: new Ci.Color(16777215)
  48012. }
  48013. },
  48014. lights: {
  48015. ambientLightColor: {
  48016. type: "fv",
  48017. value: []
  48018. },
  48019. directionalLights: {
  48020. type: "sa",
  48021. value: [],
  48022. properties: {
  48023. direction: {
  48024. type: "v3"
  48025. },
  48026. color: {
  48027. type: "c"
  48028. },
  48029. shadow: {
  48030. type: "i"
  48031. },
  48032. shadowBias: {
  48033. type: "f"
  48034. },
  48035. shadowRadius: {
  48036. type: "f"
  48037. },
  48038. shadowMapSize: {
  48039. type: "v2"
  48040. }
  48041. }
  48042. },
  48043. directionalShadowMap: {
  48044. type: "tv",
  48045. value: []
  48046. },
  48047. directionalShadowMatrix: {
  48048. type: "m4v",
  48049. value: []
  48050. },
  48051. spotLights: {
  48052. type: "sa",
  48053. value: [],
  48054. properties: {
  48055. color: {
  48056. type: "c"
  48057. },
  48058. position: {
  48059. type: "v3"
  48060. },
  48061. direction: {
  48062. type: "v3"
  48063. },
  48064. distance: {
  48065. type: "f"
  48066. },
  48067. coneCos: {
  48068. type: "f"
  48069. },
  48070. penumbraCos: {
  48071. type: "f"
  48072. },
  48073. decay: {
  48074. type: "f"
  48075. },
  48076. shadow: {
  48077. type: "i"
  48078. },
  48079. shadowBias: {
  48080. type: "f"
  48081. },
  48082. shadowRadius: {
  48083. type: "f"
  48084. },
  48085. shadowMapSize: {
  48086. type: "v2"
  48087. }
  48088. }
  48089. },
  48090. spotShadowMap: {
  48091. type: "tv",
  48092. value: []
  48093. },
  48094. spotShadowMatrix: {
  48095. type: "m4v",
  48096. value: []
  48097. },
  48098. pointLights: {
  48099. type: "sa",
  48100. value: [],
  48101. properties: {
  48102. color: {
  48103. type: "c"
  48104. },
  48105. position: {
  48106. type: "v3"
  48107. },
  48108. decay: {
  48109. type: "f"
  48110. },
  48111. distance: {
  48112. type: "f"
  48113. },
  48114. shadow: {
  48115. type: "i"
  48116. },
  48117. shadowBias: {
  48118. type: "f"
  48119. },
  48120. shadowRadius: {
  48121. type: "f"
  48122. },
  48123. shadowMapSize: {
  48124. type: "v2"
  48125. }
  48126. }
  48127. },
  48128. pointShadowMap: {
  48129. type: "tv",
  48130. value: []
  48131. },
  48132. pointShadowMatrix: {
  48133. type: "m4v",
  48134. value: []
  48135. },
  48136. hemisphereLights: {
  48137. type: "sa",
  48138. value: [],
  48139. properties: {
  48140. direction: {
  48141. type: "v3"
  48142. },
  48143. skyColor: {
  48144. type: "c"
  48145. },
  48146. groundColor: {
  48147. type: "c"
  48148. }
  48149. }
  48150. }
  48151. },
  48152. points: {
  48153. diffuse: {
  48154. type: "c",
  48155. value: new Ci.Color(15658734)
  48156. },
  48157. opacity: {
  48158. type: "f",
  48159. value: 1
  48160. },
  48161. size: {
  48162. type: "f",
  48163. value: 1
  48164. },
  48165. scale: {
  48166. type: "f",
  48167. value: 1
  48168. },
  48169. map: {
  48170. type: "t",
  48171. value: null
  48172. },
  48173. offsetRepeat: {
  48174. type: "v4",
  48175. value: new Ci.Vector4(0,0,1,1)
  48176. }
  48177. }
  48178. },
  48179. 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",
  48180. 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",
  48181. 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",
  48182. 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",
  48183. 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",
  48184. 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",
  48185. 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",
  48186. 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",
  48187. 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",
  48188. 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",
  48189. 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",
  48190. 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",
  48191. 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",
  48192. 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",
  48193. 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",
  48194. 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",
  48195. 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",
  48196. 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",
  48197. 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",
  48198. 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",
  48199. 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",
  48200. 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",
  48201. 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",
  48202. 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",
  48203. Ci.ShaderLib = {
  48204. basic: {
  48205. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48206. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48207. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48208. },
  48209. lambert: {
  48210. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48211. emissive: {
  48212. type: "c",
  48213. value: new Ci.Color(0)
  48214. }
  48215. }]),
  48216. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48217. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48218. },
  48219. phong: {
  48220. 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, {
  48221. emissive: {
  48222. type: "c",
  48223. value: new Ci.Color(0)
  48224. },
  48225. specular: {
  48226. type: "c",
  48227. value: new Ci.Color(1118481)
  48228. },
  48229. shininess: {
  48230. type: "f",
  48231. value: 30
  48232. }
  48233. }]),
  48234. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48235. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48236. },
  48237. standard: {
  48238. 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, {
  48239. emissive: {
  48240. type: "c",
  48241. value: new Ci.Color(0)
  48242. },
  48243. roughness: {
  48244. type: "f",
  48245. value: .5
  48246. },
  48247. metalness: {
  48248. type: "f",
  48249. value: 0
  48250. },
  48251. envMapIntensity: {
  48252. type: "f",
  48253. value: 1
  48254. }
  48255. }]),
  48256. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48257. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48258. },
  48259. points: {
  48260. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48261. vertexShader: Ci.ShaderChunk.points_vert,
  48262. fragmentShader: Ci.ShaderChunk.points_frag
  48263. },
  48264. dashed: {
  48265. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48266. scale: {
  48267. type: "f",
  48268. value: 1
  48269. },
  48270. dashSize: {
  48271. type: "f",
  48272. value: 1
  48273. },
  48274. totalSize: {
  48275. type: "f",
  48276. value: 2
  48277. }
  48278. }]),
  48279. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48280. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48281. },
  48282. depth: {
  48283. uniforms: {
  48284. mNear: {
  48285. type: "f",
  48286. value: 1
  48287. },
  48288. mFar: {
  48289. type: "f",
  48290. value: 2e3
  48291. },
  48292. opacity: {
  48293. type: "f",
  48294. value: 1
  48295. }
  48296. },
  48297. vertexShader: Ci.ShaderChunk.depth_vert,
  48298. fragmentShader: Ci.ShaderChunk.depth_frag
  48299. },
  48300. normal: {
  48301. uniforms: {
  48302. opacity: {
  48303. type: "f",
  48304. value: 1
  48305. }
  48306. },
  48307. vertexShader: Ci.ShaderChunk.normal_vert,
  48308. fragmentShader: Ci.ShaderChunk.normal_frag
  48309. },
  48310. cube: {
  48311. uniforms: {
  48312. tCube: {
  48313. type: "t",
  48314. value: null
  48315. },
  48316. tFlip: {
  48317. type: "f",
  48318. value: -1
  48319. }
  48320. },
  48321. vertexShader: Ci.ShaderChunk.cube_vert,
  48322. fragmentShader: Ci.ShaderChunk.cube_frag
  48323. },
  48324. equirect: {
  48325. uniforms: {
  48326. tEquirect: {
  48327. type: "t",
  48328. value: null
  48329. },
  48330. tFlip: {
  48331. type: "f",
  48332. value: -1
  48333. }
  48334. },
  48335. vertexShader: Ci.ShaderChunk.equirect_vert,
  48336. fragmentShader: Ci.ShaderChunk.equirect_frag
  48337. },
  48338. depthRGBA: {
  48339. uniforms: {},
  48340. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48341. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48342. },
  48343. distanceRGBA: {
  48344. uniforms: {
  48345. lightPos: {
  48346. type: "v3",
  48347. value: new Ci.Vector3(0,0,0)
  48348. }
  48349. },
  48350. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48351. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48352. }
  48353. },
  48354. Ci.WebGLRenderer = function(e) {
  48355. function S() {
  48356. return null === Q ? he : 1
  48357. }
  48358. function i(e, t, i, n) {
  48359. !0 === V && (e *= n,
  48360. t *= n,
  48361. i *= n),
  48362. _e.clearColor(e, t, i, n)
  48363. }
  48364. function t() {
  48365. _e.init(),
  48366. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48367. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48368. i(ae.r, ae.g, ae.b, se)
  48369. }
  48370. function n() {
  48371. te = K = null,
  48372. ee = "",
  48373. $ = -1,
  48374. _e.reset()
  48375. }
  48376. function r(e) {
  48377. e.preventDefault(),
  48378. n(),
  48379. t(),
  48380. be.clear()
  48381. }
  48382. function f(e) {
  48383. var t = e.target;
  48384. t.removeEventListener("dispose", f),
  48385. function(e) {
  48386. var t = be.get(e);
  48387. if (e.image && t.__image__webglTextureCube)
  48388. X.deleteTexture(t.__image__webglTextureCube);
  48389. else {
  48390. if (void 0 === t.__webglInit)
  48391. return;
  48392. X.deleteTexture(t.__webglTexture)
  48393. }
  48394. be.delete(e)
  48395. }(t),
  48396. ye.textures--
  48397. }
  48398. function a(e) {
  48399. var t = e.target;
  48400. t.removeEventListener("dispose", a),
  48401. function(e) {
  48402. var t = be.get(e)
  48403. , i = be.get(e.texture);
  48404. if (e && void 0 !== i.__webglTexture) {
  48405. if (X.deleteTexture(i.__webglTexture),
  48406. e instanceof Ci.WebGLRenderTargetCube)
  48407. for (var n = 0; n < 6; n++)
  48408. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48409. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48410. else
  48411. X.deleteFramebuffer(t.__webglFramebuffer),
  48412. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48413. be.delete(e.texture),
  48414. be.delete(e)
  48415. }
  48416. }(t),
  48417. ye.textures--
  48418. }
  48419. function v(e) {
  48420. var t = e.target;
  48421. t.removeEventListener("dispose", v),
  48422. function(e) {
  48423. y(e),
  48424. be.delete(e)
  48425. }(t)
  48426. }
  48427. function y(e) {
  48428. var t = be.get(e).program;
  48429. (e.program = void 0) !== t && Te.releaseProgram(t)
  48430. }
  48431. function M(e, t) {
  48432. return Math.abs(t[0]) - Math.abs(e[0])
  48433. }
  48434. function s(e, t) {
  48435. 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
  48436. }
  48437. function l(e, t) {
  48438. 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
  48439. }
  48440. function d(e, t, i, n, r) {
  48441. var o, a;
  48442. a = i.transparent ? (o = G,
  48443. ++W) : (o = H,
  48444. ++z);
  48445. var s = o[a];
  48446. void 0 !== s ? (s.id = e.id,
  48447. s.object = e,
  48448. s.geometry = t,
  48449. s.material = i,
  48450. s.z = me.z,
  48451. s.group = r) : (s = {
  48452. id: e.id,
  48453. object: e,
  48454. geometry: t,
  48455. material: i,
  48456. z: me.z,
  48457. group: r
  48458. },
  48459. o.push(s))
  48460. }
  48461. function c(e, t, i, n) {
  48462. for (var r = 0, o = e.length; r < o; r++) {
  48463. var a = e[r]
  48464. , s = a.object
  48465. , l = a.geometry
  48466. , c = void 0 === n ? a.material : n
  48467. , h = a.group;
  48468. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48469. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48470. s instanceof Ci.ImmediateRenderObject) {
  48471. R(c);
  48472. var u = P(t, i, c, s);
  48473. ee = "",
  48474. s.render(function(e) {
  48475. Z.renderBufferImmediate(e, u, c)
  48476. })
  48477. } else
  48478. Z.renderBufferDirect(t, i, l, c, s, h)
  48479. }
  48480. }
  48481. function R(e) {
  48482. (function(e) {
  48483. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48484. _e.setFlipSided(e.side === Ci.BackSide)
  48485. }
  48486. )(e),
  48487. !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),
  48488. _e.setDepthFunc(e.depthFunc),
  48489. _e.setDepthTest(e.depthTest),
  48490. _e.setDepthWrite(e.depthWrite),
  48491. _e.setColorWrite(e.colorWrite),
  48492. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48493. }
  48494. function P(e, t, i, n) {
  48495. oe = 0;
  48496. var r = be.get(i);
  48497. void 0 === r.program && (i.needsUpdate = !0),
  48498. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48499. i.needsUpdate && (function(e, t, i) {
  48500. var n = be.get(e)
  48501. , r = Te.getParameters(e, ve, t, i)
  48502. , o = Te.getProgramCode(e, r)
  48503. , a = n.program
  48504. , s = !0;
  48505. if (void 0 === a)
  48506. e.addEventListener("dispose", v);
  48507. else if (a.code !== o)
  48508. y(e);
  48509. else {
  48510. if (void 0 !== r.shaderID)
  48511. return;
  48512. s = !1
  48513. }
  48514. if (s) {
  48515. if (r.shaderID) {
  48516. var l = Ci.ShaderLib[r.shaderID];
  48517. n.__webglShader = {
  48518. name: e.type,
  48519. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48520. vertexShader: l.vertexShader,
  48521. fragmentShader: l.fragmentShader
  48522. }
  48523. } else
  48524. n.__webglShader = {
  48525. name: e.type,
  48526. uniforms: e.uniforms,
  48527. vertexShader: e.vertexShader,
  48528. fragmentShader: e.fragmentShader
  48529. };
  48530. e.__webglShader = n.__webglShader,
  48531. a = Te.acquireProgram(e, r, o),
  48532. n.program = a,
  48533. e.program = a
  48534. }
  48535. var c = a.getAttributes();
  48536. if (e.morphTargets)
  48537. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48538. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48539. if (e.morphNormals)
  48540. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48541. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48542. n.uniformsList = [];
  48543. var u = n.__webglShader.uniforms
  48544. , d = n.program.getUniforms();
  48545. for (var p in u) {
  48546. var f = d[p];
  48547. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48548. }
  48549. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48550. u.ambientLightColor.value = ve.ambient,
  48551. u.directionalLights.value = ve.directional,
  48552. u.spotLights.value = ve.spot,
  48553. u.pointLights.value = ve.point,
  48554. u.hemisphereLights.value = ve.hemi,
  48555. u.directionalShadowMap.value = ve.directionalShadowMap,
  48556. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48557. u.spotShadowMap.value = ve.spotShadowMap,
  48558. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48559. u.pointShadowMap.value = ve.pointShadowMap,
  48560. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48561. n.hasDynamicUniforms = !1;
  48562. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48563. if (!0 === n.uniformsList[g][0].dynamic) {
  48564. n.hasDynamicUniforms = !0;
  48565. break
  48566. }
  48567. }
  48568. }(i, t, n),
  48569. i.needsUpdate = !1);
  48570. var o = !1
  48571. , a = !1
  48572. , s = !1
  48573. , l = r.program
  48574. , c = l.getUniforms()
  48575. , h = r.__webglShader.uniforms;
  48576. if (l.id !== K && (X.useProgram(l.program),
  48577. K = l.id,
  48578. s = a = o = !0),
  48579. i.id !== $ && ($ = i.id,
  48580. a = !0),
  48581. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48582. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48583. e !== te && (te = e,
  48584. s = a = !0),
  48585. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48586. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48587. (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),
  48588. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48589. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48590. i.skinning)
  48591. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48592. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48593. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48594. if (void 0 !== c.boneTexture) {
  48595. var u = A();
  48596. X.uniform1i(c.boneTexture, u),
  48597. Z.setTexture(n.skeleton.boneTexture, u)
  48598. }
  48599. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48600. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48601. } else
  48602. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48603. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48604. e.ambientLightColor.needsUpdate = t,
  48605. e.directionalLights.needsUpdate = t,
  48606. e.pointLights.needsUpdate = t,
  48607. e.spotLights.needsUpdate = t,
  48608. e.hemisphereLights.needsUpdate = t
  48609. }(h, s),
  48610. t && i.fog && function(e, t) {
  48611. e.fogColor.value = t.color,
  48612. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48613. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48614. }(h, t),
  48615. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48616. var i;
  48617. if (e.opacity.value = t.opacity,
  48618. e.diffuse.value = t.color,
  48619. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48620. e.map.value = t.map,
  48621. e.specularMap.value = t.specularMap,
  48622. e.alphaMap.value = t.alphaMap,
  48623. t.aoMap && (e.aoMap.value = t.aoMap,
  48624. e.aoMapIntensity.value = t.aoMapIntensity),
  48625. 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),
  48626. void 0 !== i) {
  48627. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48628. var n = i.offset
  48629. , r = i.repeat;
  48630. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48631. }
  48632. e.envMap.value = t.envMap,
  48633. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48634. e.reflectivity.value = t.reflectivity,
  48635. e.refractionRatio.value = t.refractionRatio
  48636. }(h, i),
  48637. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48638. function(e, t) {
  48639. e.dashSize.value = t.dashSize,
  48640. e.totalSize.value = t.dashSize + t.gapSize,
  48641. e.scale.value = t.scale
  48642. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48643. if (e.diffuse.value = t.color,
  48644. e.opacity.value = t.opacity,
  48645. e.size.value = t.size * he,
  48646. e.scale.value = O.clientHeight / 2,
  48647. e.map.value = t.map,
  48648. null !== t.map) {
  48649. var i = t.map.offset
  48650. , n = t.map.repeat;
  48651. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48652. }
  48653. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48654. t.lightMap && (e.lightMap.value = t.lightMap,
  48655. e.lightMapIntensity.value = t.lightMapIntensity),
  48656. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48657. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48658. e.specular.value = t.specular,
  48659. e.shininess.value = Math.max(t.shininess, 1e-4),
  48660. t.lightMap && (e.lightMap.value = t.lightMap,
  48661. e.lightMapIntensity.value = t.lightMapIntensity),
  48662. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48663. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48664. e.bumpScale.value = t.bumpScale),
  48665. t.normalMap && (e.normalMap.value = t.normalMap,
  48666. e.normalScale.value.copy(t.normalScale)),
  48667. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48668. e.displacementScale.value = t.displacementScale,
  48669. e.displacementBias.value = t.displacementBias)
  48670. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48671. e.roughness.value = t.roughness,
  48672. e.metalness.value = t.metalness,
  48673. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48674. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48675. t.lightMap && (e.lightMap.value = t.lightMap,
  48676. e.lightMapIntensity.value = t.lightMapIntensity),
  48677. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48678. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48679. e.bumpScale.value = t.bumpScale),
  48680. t.normalMap && (e.normalMap.value = t.normalMap,
  48681. e.normalScale.value.copy(t.normalScale)),
  48682. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48683. e.displacementScale.value = t.displacementScale,
  48684. e.displacementBias.value = t.displacementBias),
  48685. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48686. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48687. h.mFar.value = e.far,
  48688. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48689. g(r.uniformsList)),
  48690. function(e, t) {
  48691. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48692. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48693. }(c, n),
  48694. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48695. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48696. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48697. var a = e[r][0]
  48698. , s = a.onUpdateCallback;
  48699. void 0 !== s && (s.bind(a)(t, i),
  48700. n.push(e[r]))
  48701. }
  48702. g(n)
  48703. }(r.uniformsList, n, e),
  48704. l
  48705. }
  48706. function p(e, t) {
  48707. e.diffuse.value = t.color,
  48708. e.opacity.value = t.opacity
  48709. }
  48710. function A() {
  48711. var e = oe;
  48712. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48713. oe += 1,
  48714. e
  48715. }
  48716. function C(e, t, i, n) {
  48717. var r, o;
  48718. if ("1i" === t)
  48719. X.uniform1i(i, n);
  48720. else if ("1f" === t)
  48721. X.uniform1f(i, n);
  48722. else if ("2f" === t)
  48723. X.uniform2f(i, n[0], n[1]);
  48724. else if ("3f" === t)
  48725. X.uniform3f(i, n[0], n[1], n[2]);
  48726. else if ("4f" === t)
  48727. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48728. else if ("1iv" === t)
  48729. X.uniform1iv(i, n);
  48730. else if ("3iv" === t)
  48731. X.uniform3iv(i, n);
  48732. else if ("1fv" === t)
  48733. X.uniform1fv(i, n);
  48734. else if ("2fv" === t)
  48735. X.uniform2fv(i, n);
  48736. else if ("3fv" === t)
  48737. X.uniform3fv(i, n);
  48738. else if ("4fv" === t)
  48739. X.uniform4fv(i, n);
  48740. else if ("Matrix2fv" === t)
  48741. X.uniformMatrix2fv(i, !1, n);
  48742. else if ("Matrix3fv" === t)
  48743. X.uniformMatrix3fv(i, !1, n);
  48744. else if ("Matrix4fv" === t)
  48745. X.uniformMatrix4fv(i, !1, n);
  48746. else if ("i" === t)
  48747. X.uniform1i(i, n);
  48748. else if ("f" === t)
  48749. X.uniform1f(i, n);
  48750. else if ("v2" === t)
  48751. X.uniform2f(i, n.x, n.y);
  48752. else if ("v3" === t)
  48753. X.uniform3f(i, n.x, n.y, n.z);
  48754. else if ("v4" === t)
  48755. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48756. else if ("c" === t)
  48757. X.uniform3f(i, n.r, n.g, n.b);
  48758. else if ("s" === t) {
  48759. var a = e.properties;
  48760. for (var s in a) {
  48761. var l = a[s]
  48762. , c = i[s]
  48763. , h = n[s];
  48764. C(l, l.type, c, h)
  48765. }
  48766. } else if ("sa" === t) {
  48767. a = e.properties;
  48768. for (var u = 0, d = n.length; u < d; u++)
  48769. for (var s in a) {
  48770. l = a[s],
  48771. c = i[u][s],
  48772. h = n[u][s];
  48773. C(l, l.type, c, h)
  48774. }
  48775. } else if ("iv1" === t)
  48776. X.uniform1iv(i, n);
  48777. else if ("iv" === t)
  48778. X.uniform3iv(i, n);
  48779. else if ("fv1" === t)
  48780. X.uniform1fv(i, n);
  48781. else if ("fv" === t)
  48782. X.uniform3fv(i, n);
  48783. else if ("v2v" === t) {
  48784. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48785. u = 0;
  48786. for (var p = 0, f = n.length; u < f; u++,
  48787. p += 2)
  48788. e._array[p + 0] = n[u].x,
  48789. e._array[p + 1] = n[u].y;
  48790. X.uniform2fv(i, e._array)
  48791. } else if ("v3v" === t) {
  48792. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48793. u = 0;
  48794. var g = 0;
  48795. for (f = n.length; u < f; u++,
  48796. g += 3)
  48797. e._array[g + 0] = n[u].x,
  48798. e._array[g + 1] = n[u].y,
  48799. e._array[g + 2] = n[u].z;
  48800. X.uniform3fv(i, e._array)
  48801. } else if ("v4v" === t) {
  48802. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48803. u = 0;
  48804. var m = 0;
  48805. for (f = n.length; u < f; u++,
  48806. m += 4)
  48807. e._array[m + 0] = n[u].x,
  48808. e._array[m + 1] = n[u].y,
  48809. e._array[m + 2] = n[u].z,
  48810. e._array[m + 3] = n[u].w;
  48811. X.uniform4fv(i, e._array)
  48812. } else if ("m2" === t)
  48813. X.uniformMatrix2fv(i, !1, n.elements);
  48814. else if ("m3" === t)
  48815. X.uniformMatrix3fv(i, !1, n.elements);
  48816. else if ("m3v" === t) {
  48817. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48818. for (u = 0,
  48819. f = n.length; u < f; u++)
  48820. n[u].flattenToArrayOffset(e._array, 9 * u);
  48821. X.uniformMatrix3fv(i, !1, e._array)
  48822. } else if ("m4" === t)
  48823. X.uniformMatrix4fv(i, !1, n.elements);
  48824. else if ("m4v" === t) {
  48825. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48826. for (u = 0,
  48827. f = n.length; u < f; u++)
  48828. n[u].flattenToArrayOffset(e._array, 16 * u);
  48829. X.uniformMatrix4fv(i, !1, e._array)
  48830. } else if ("t" === t) {
  48831. if (r = n,
  48832. o = A(),
  48833. X.uniform1i(i, o),
  48834. !r)
  48835. return;
  48836. 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)
  48837. } else if ("tv" === t) {
  48838. void 0 === e._array && (e._array = []);
  48839. for (u = 0,
  48840. f = e.value.length; u < f; u++)
  48841. e._array[u] = A();
  48842. X.uniform1iv(i, e._array);
  48843. for (u = 0,
  48844. f = e.value.length; u < f; u++)
  48845. r = e.value[u],
  48846. o = e._array[u],
  48847. 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))
  48848. } else
  48849. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48850. }
  48851. function g(e) {
  48852. for (var t = 0, i = e.length; t < i; t++) {
  48853. var n = e[t][0];
  48854. if (!1 !== n.needsUpdate)
  48855. C(n, n.type, e[t][1], n.value)
  48856. }
  48857. }
  48858. function m(e, t, i) {
  48859. var n;
  48860. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48861. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48862. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48863. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48864. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48865. 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),
  48866. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48867. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48868. 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)),
  48869. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48870. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48871. return;
  48872. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48873. return;
  48874. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48875. be.get(t).__currentAnisotropy = t.anisotropy)
  48876. }
  48877. }
  48878. function o(e, t, i) {
  48879. void 0 === e.__webglInit && (e.__webglInit = !0,
  48880. t.addEventListener("dispose", f),
  48881. e.__webglTexture = X.createTexture(),
  48882. ye.textures++),
  48883. _e.activeTexture(X.TEXTURE0 + i),
  48884. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48885. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48886. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48887. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48888. var n = I(t.image, Ee.maxTextureSize);
  48889. !function(e) {
  48890. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48891. }(t) || !1 !== E(n) || (n = function(e) {
  48892. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48893. var t = document.createElement("canvas");
  48894. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48895. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48896. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48897. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48898. t
  48899. }
  48900. return e
  48901. }(n));
  48902. var r = E(n)
  48903. , o = x(t.format)
  48904. , a = x(t.type);
  48905. m(X.TEXTURE_2D, t, r);
  48906. var s, l = t.mipmaps;
  48907. if (t instanceof Ci.DataTexture)
  48908. if (0 < l.length && r) {
  48909. for (var c = 0, h = l.length; c < h; c++)
  48910. s = l[c],
  48911. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48912. t.generateMipmaps = !1
  48913. } else
  48914. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48915. else if (t instanceof Ci.CompressedTexture)
  48916. for (c = 0,
  48917. h = l.length; c < h; c++)
  48918. s = l[c],
  48919. 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);
  48920. else if (0 < l.length && r) {
  48921. for (c = 0,
  48922. h = l.length; c < h; c++)
  48923. s = l[c],
  48924. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48925. t.generateMipmaps = !1
  48926. } else
  48927. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48928. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48929. e.__version = t.version,
  48930. t.onUpdate && t.onUpdate(t)
  48931. }
  48932. function I(e, t) {
  48933. if (e.width > t || e.height > t) {
  48934. var i = t / Math.max(e.width, e.height)
  48935. , n = document.createElement("canvas");
  48936. return n.width = Math.floor(e.width * i),
  48937. n.height = Math.floor(e.height * i),
  48938. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48939. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48940. n
  48941. }
  48942. return e
  48943. }
  48944. function E(e) {
  48945. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48946. }
  48947. function _(e, t) {
  48948. var i = be.get(e);
  48949. if (6 === e.image.length)
  48950. if (0 < e.version && i.__version !== e.version) {
  48951. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48952. i.__image__webglTextureCube = X.createTexture(),
  48953. ye.textures++),
  48954. _e.activeTexture(X.TEXTURE0 + t),
  48955. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48956. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48957. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48958. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48959. var s = E(o[0])
  48960. , l = x(e.format)
  48961. , c = x(e.type);
  48962. m(X.TEXTURE_CUBE_MAP, e, s);
  48963. for (a = 0; a < 6; a++)
  48964. if (n)
  48965. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48966. h = u[d],
  48967. 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);
  48968. else
  48969. 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]);
  48970. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48971. i.__version = e.version,
  48972. e.onUpdate && e.onUpdate(e)
  48973. } else
  48974. _e.activeTexture(X.TEXTURE0 + t),
  48975. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48976. }
  48977. function b(e, t) {
  48978. _e.activeTexture(X.TEXTURE0 + t),
  48979. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48980. }
  48981. function h(e, t, i, n) {
  48982. var r = x(t.texture.format)
  48983. , o = x(t.texture.type);
  48984. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48985. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48986. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48987. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48988. }
  48989. function u(e, t) {
  48990. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48991. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48992. 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),
  48993. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48994. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48995. }
  48996. function w(e) {
  48997. var t = be.get(e)
  48998. , i = be.get(e.texture);
  48999. e.addEventListener("dispose", a),
  49000. i.__webglTexture = X.createTexture(),
  49001. ye.textures++;
  49002. var n = e instanceof Ci.WebGLRenderTargetCube
  49003. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49004. if (n) {
  49005. t.__webglFramebuffer = [];
  49006. for (var o = 0; o < 6; o++)
  49007. t.__webglFramebuffer[o] = X.createFramebuffer()
  49008. } else
  49009. t.__webglFramebuffer = X.createFramebuffer();
  49010. if (n) {
  49011. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49012. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49013. for (o = 0; o < 6; o++)
  49014. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49015. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49016. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49017. } else
  49018. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49019. m(X.TEXTURE_2D, e.texture, r),
  49020. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49021. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49022. _e.bindTexture(X.TEXTURE_2D, null);
  49023. e.depthBuffer && function(e) {
  49024. var t = be.get(e);
  49025. if (e instanceof Ci.WebGLRenderTargetCube) {
  49026. t.__webglDepthbuffer = [];
  49027. for (var i = 0; i < 6; i++)
  49028. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49029. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49030. u(t.__webglDepthbuffer[i], e)
  49031. } else
  49032. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49033. t.__webglDepthbuffer = X.createRenderbuffer(),
  49034. u(t.__webglDepthbuffer, e);
  49035. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49036. }(e)
  49037. }
  49038. function T(e) {
  49039. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49040. }
  49041. function x(e) {
  49042. var t;
  49043. if (e === Ci.RepeatWrapping)
  49044. return X.REPEAT;
  49045. if (e === Ci.ClampToEdgeWrapping)
  49046. return X.CLAMP_TO_EDGE;
  49047. if (e === Ci.MirroredRepeatWrapping)
  49048. return X.MIRRORED_REPEAT;
  49049. if (e === Ci.NearestFilter)
  49050. return X.NEAREST;
  49051. if (e === Ci.NearestMipMapNearestFilter)
  49052. return X.NEAREST_MIPMAP_NEAREST;
  49053. if (e === Ci.NearestMipMapLinearFilter)
  49054. return X.NEAREST_MIPMAP_LINEAR;
  49055. if (e === Ci.LinearFilter)
  49056. return X.LINEAR;
  49057. if (e === Ci.LinearMipMapNearestFilter)
  49058. return X.LINEAR_MIPMAP_NEAREST;
  49059. if (e === Ci.LinearMipMapLinearFilter)
  49060. return X.LINEAR_MIPMAP_LINEAR;
  49061. if (e === Ci.UnsignedByteType)
  49062. return X.UNSIGNED_BYTE;
  49063. if (e === Ci.UnsignedShort4444Type)
  49064. return X.UNSIGNED_SHORT_4_4_4_4;
  49065. if (e === Ci.UnsignedShort5551Type)
  49066. return X.UNSIGNED_SHORT_5_5_5_1;
  49067. if (e === Ci.UnsignedShort565Type)
  49068. return X.UNSIGNED_SHORT_5_6_5;
  49069. if (e === Ci.ByteType)
  49070. return X.BYTE;
  49071. if (e === Ci.ShortType)
  49072. return X.SHORT;
  49073. if (e === Ci.UnsignedShortType)
  49074. return X.UNSIGNED_SHORT;
  49075. if (e === Ci.IntType)
  49076. return X.INT;
  49077. if (e === Ci.UnsignedIntType)
  49078. return X.UNSIGNED_INT;
  49079. if (e === Ci.FloatType)
  49080. return X.FLOAT;
  49081. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49082. return t.HALF_FLOAT_OES;
  49083. if (e === Ci.AlphaFormat)
  49084. return X.ALPHA;
  49085. if (e === Ci.RGBFormat)
  49086. return X.RGB;
  49087. if (e === Ci.RGBAFormat)
  49088. return X.RGBA;
  49089. if (e === Ci.LuminanceFormat)
  49090. return X.LUMINANCE;
  49091. if (e === Ci.LuminanceAlphaFormat)
  49092. return X.LUMINANCE_ALPHA;
  49093. if (e === Ci.AddEquation)
  49094. return X.FUNC_ADD;
  49095. if (e === Ci.SubtractEquation)
  49096. return X.FUNC_SUBTRACT;
  49097. if (e === Ci.ReverseSubtractEquation)
  49098. return X.FUNC_REVERSE_SUBTRACT;
  49099. if (e === Ci.ZeroFactor)
  49100. return X.ZERO;
  49101. if (e === Ci.OneFactor)
  49102. return X.ONE;
  49103. if (e === Ci.SrcColorFactor)
  49104. return X.SRC_COLOR;
  49105. if (e === Ci.OneMinusSrcColorFactor)
  49106. return X.ONE_MINUS_SRC_COLOR;
  49107. if (e === Ci.SrcAlphaFactor)
  49108. return X.SRC_ALPHA;
  49109. if (e === Ci.OneMinusSrcAlphaFactor)
  49110. return X.ONE_MINUS_SRC_ALPHA;
  49111. if (e === Ci.DstAlphaFactor)
  49112. return X.DST_ALPHA;
  49113. if (e === Ci.OneMinusDstAlphaFactor)
  49114. return X.ONE_MINUS_DST_ALPHA;
  49115. if (e === Ci.DstColorFactor)
  49116. return X.DST_COLOR;
  49117. if (e === Ci.OneMinusDstColorFactor)
  49118. return X.ONE_MINUS_DST_COLOR;
  49119. if (e === Ci.SrcAlphaSaturateFactor)
  49120. return X.SRC_ALPHA_SATURATE;
  49121. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49122. if (e === Ci.RGB_S3TC_DXT1_Format)
  49123. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49124. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49125. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49126. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49127. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49128. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49129. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49130. }
  49131. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49132. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49133. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49134. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49135. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49136. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49137. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49138. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49139. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49140. }
  49141. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49142. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49143. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49144. if (e === Ci.MinEquation)
  49145. return t.MIN_EXT;
  49146. if (e === Ci.MaxEquation)
  49147. return t.MAX_EXT
  49148. }
  49149. return 0
  49150. }
  49151. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49152. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49153. , L = void 0 !== e.context ? e.context : null
  49154. , D = void 0 !== e.alpha && e.alpha
  49155. , N = void 0 === e.depth || e.depth
  49156. , F = void 0 === e.stencil || e.stencil
  49157. , B = void 0 !== e.antialias && e.antialias
  49158. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49159. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49160. , U = []
  49161. , H = []
  49162. , z = -1
  49163. , G = []
  49164. , W = -1
  49165. , j = new Float32Array(8)
  49166. , Y = []
  49167. , q = [];
  49168. this.domElement = O,
  49169. this.context = null,
  49170. this.autoClear = !0,
  49171. this.autoClearColor = !0,
  49172. this.autoClearDepth = !0,
  49173. this.autoClearStencil = !0,
  49174. this.sortObjects = !0,
  49175. this.gammaFactor = 2,
  49176. this.gammaInput = !1,
  49177. this.gammaOutput = !1,
  49178. this.physicallyCorrectLights = !1,
  49179. this.toneMapping = Ci.LinearToneMapping,
  49180. this.toneMappingExposure = 1,
  49181. this.toneMappingWhitePoint = 1,
  49182. this.maxMorphTargets = 8,
  49183. this.maxMorphNormals = 4,
  49184. this.autoScaleCubemaps = !0;
  49185. 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 = {
  49186. hash: "",
  49187. ambient: [0, 0, 0],
  49188. directional: [],
  49189. directionalShadowMap: [],
  49190. directionalShadowMatrix: [],
  49191. spot: [],
  49192. spotShadowMap: [],
  49193. spotShadowMatrix: [],
  49194. point: [],
  49195. pointShadowMap: [],
  49196. pointShadowMatrix: [],
  49197. hemi: [],
  49198. shadows: [],
  49199. shadowsPointLight: 0
  49200. }, ye = {
  49201. geometries: 0,
  49202. textures: 0
  49203. }, Ae = {
  49204. calls: 0,
  49205. vertices: 0,
  49206. faces: 0,
  49207. points: 0
  49208. };
  49209. this.info = {
  49210. render: Ae,
  49211. memory: ye,
  49212. programs: null
  49213. };
  49214. try {
  49215. var Ce = {
  49216. alpha: D,
  49217. depth: N,
  49218. stencil: F,
  49219. antialias: B,
  49220. premultipliedAlpha: V,
  49221. preserveDrawingBuffer: k
  49222. };
  49223. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49224. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49225. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49226. return {
  49227. rangeMin: 1,
  49228. rangeMax: 1,
  49229. precision: 1
  49230. }
  49231. }
  49232. ),
  49233. O.addEventListener("webglcontextlost", r, !1)
  49234. } catch (e) {
  49235. console.error("THREE.WebGLRenderer: " + e)
  49236. }
  49237. var Ie = new Ci.WebGLExtensions(X);
  49238. Ie.get("OES_texture_float"),
  49239. Ie.get("OES_texture_float_linear"),
  49240. Ie.get("OES_texture_half_float"),
  49241. Ie.get("OES_texture_half_float_linear"),
  49242. Ie.get("OES_standard_derivatives"),
  49243. Ie.get("ANGLE_instanced_arrays"),
  49244. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49245. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49246. , _e = new Ci.WebGLState(X,Ie,x)
  49247. , be = new Ci.WebGLProperties
  49248. , we = new Ci.WebGLObjects(X,be,this.info)
  49249. , Te = new Ci.WebGLPrograms(this,Ee)
  49250. , xe = new Ci.WebGLLights;
  49251. this.info.programs = Te.programs;
  49252. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49253. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49254. t(),
  49255. this.context = X,
  49256. this.capabilities = Ee,
  49257. this.extensions = Ie,
  49258. this.properties = be,
  49259. this.state = _e;
  49260. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49261. this.shadowMap = Re;
  49262. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49263. this.getContext = function() {
  49264. return X
  49265. }
  49266. ,
  49267. this.getContextAttributes = function() {
  49268. return X.getContextAttributes()
  49269. }
  49270. ,
  49271. this.forceContextLoss = function() {
  49272. Ie.get("WEBGL_lose_context").loseContext()
  49273. }
  49274. ,
  49275. this.getMaxAnisotropy = function() {
  49276. if (void 0 !== Pe)
  49277. return Pe;
  49278. var e = Ie.get("EXT_texture_filter_anisotropic");
  49279. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49280. }
  49281. ,
  49282. this.getPrecision = function() {
  49283. return Ee.precision
  49284. }
  49285. ,
  49286. this.getPixelRatio = function() {
  49287. return he
  49288. }
  49289. ,
  49290. this.setPixelRatio = function(e) {
  49291. void 0 !== e && (he = e,
  49292. this.setSize(pe.z, pe.w, !1))
  49293. }
  49294. ,
  49295. this.getSize = function() {
  49296. return {
  49297. width: le,
  49298. height: ce
  49299. }
  49300. }
  49301. ,
  49302. this.setSize = function(e, t, i, n) {
  49303. null != n && (he = n),
  49304. le = e,
  49305. ce = t,
  49306. O.width = e * he,
  49307. O.height = t * he,
  49308. !1 !== i && (O.style.width = e + "px",
  49309. O.style.height = t + "px"),
  49310. this.setViewport(0, 0, e, t)
  49311. }
  49312. ,
  49313. this.setViewport = function(e, t, i, n) {
  49314. _e.viewport(pe.set(e, t, i, n))
  49315. }
  49316. ,
  49317. this.setScissor = function(e, t, i, n) {
  49318. _e.scissor(ue.set(e, t, i, n))
  49319. }
  49320. ,
  49321. this.setScissorTest = function(e) {
  49322. _e.setScissorTest(de = e)
  49323. }
  49324. ,
  49325. this.getClearColor = function() {
  49326. return ae
  49327. }
  49328. ,
  49329. this.setClearColor = function(e, t) {
  49330. ae.set(e),
  49331. se = void 0 !== t ? t : 1,
  49332. i(ae.r, ae.g, ae.b, se)
  49333. }
  49334. ,
  49335. this.getClearAlpha = function() {
  49336. return se
  49337. }
  49338. ,
  49339. this.setClearAlpha = function(e) {
  49340. se = e,
  49341. i(ae.r, ae.g, ae.b, se)
  49342. }
  49343. ,
  49344. this.clear = function(e, t, i) {
  49345. var n = 0;
  49346. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49347. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49348. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49349. X.clear(n)
  49350. }
  49351. ,
  49352. this.clearColor = function() {
  49353. this.clear(!0, !1, !1)
  49354. }
  49355. ,
  49356. this.clearDepth = function() {
  49357. this.clear(!1, !0, !1)
  49358. }
  49359. ,
  49360. this.clearStencil = function() {
  49361. this.clear(!1, !1, !0)
  49362. }
  49363. ,
  49364. this.clearTarget = function(e, t, i, n) {
  49365. this.setRenderTarget(e),
  49366. this.clear(t, i, n)
  49367. }
  49368. ,
  49369. this.resetGLState = n,
  49370. this.dispose = function() {
  49371. O.removeEventListener("webglcontextlost", r, !1)
  49372. }
  49373. ,
  49374. this.renderBufferImmediate = function(e, t, i) {
  49375. _e.initAttributes();
  49376. var n = be.get(e);
  49377. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49378. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49379. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49380. e.hasColors && !n.color && (n.color = X.createBuffer());
  49381. var r = t.getAttributes();
  49382. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49383. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49384. _e.enableAttribute(r.position),
  49385. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49386. e.hasNormals) {
  49387. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49388. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49389. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49390. var s = e.normalArray
  49391. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49392. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49393. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49394. s[o + 0] = l,
  49395. s[o + 1] = c,
  49396. s[o + 2] = h,
  49397. s[o + 3] = l,
  49398. s[o + 4] = c,
  49399. s[o + 5] = h,
  49400. s[o + 6] = l,
  49401. s[o + 7] = c,
  49402. s[o + 8] = h
  49403. }
  49404. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49405. _e.enableAttribute(r.normal),
  49406. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49407. }
  49408. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49409. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49410. _e.enableAttribute(r.uv),
  49411. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49412. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49413. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49414. _e.enableAttribute(r.color),
  49415. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49416. _e.disableUnusedAttributes(),
  49417. X.drawArrays(X.TRIANGLES, 0, e.count),
  49418. e.count = 0
  49419. }
  49420. ,
  49421. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49422. R(n);
  49423. var a = P(e, t, n, r)
  49424. , s = !1
  49425. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49426. l !== ee && (ee = l,
  49427. s = !0);
  49428. var c = r.morphTargetInfluences;
  49429. if (void 0 !== c) {
  49430. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49431. var p = c[u];
  49432. h.push([p, u])
  49433. }
  49434. h.sort(M),
  49435. 8 < h.length && (h.length = 8);
  49436. var f = i.morphAttributes;
  49437. for (u = 0,
  49438. d = h.length; u < d; u++) {
  49439. p = h[u];
  49440. if (j[u] = p[0],
  49441. 0 !== p[0]) {
  49442. var g = p[1];
  49443. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49444. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49445. } else
  49446. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49447. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49448. }
  49449. var m = a.getUniforms();
  49450. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49451. s = !0
  49452. }
  49453. g = i.index;
  49454. var v, y = i.attributes.position;
  49455. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49456. null !== g ? (v = Me).setIndex(g) : v = Se,
  49457. s && (function(e, t, i, n) {
  49458. var r;
  49459. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49460. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49461. else {
  49462. void 0 === n && (n = 0),
  49463. _e.initAttributes();
  49464. var o = i.attributes
  49465. , a = t.getAttributes()
  49466. , s = e.defaultAttributeValues;
  49467. for (var l in a) {
  49468. var c = a[l];
  49469. if (0 <= c) {
  49470. var h = o[l];
  49471. if (void 0 !== h) {
  49472. var u = h.itemSize
  49473. , d = we.getAttributeBuffer(h);
  49474. if (h instanceof Ci.InterleavedBufferAttribute) {
  49475. var p = h.data
  49476. , f = p.stride
  49477. , g = h.offset;
  49478. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49479. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49480. X.bindBuffer(X.ARRAY_BUFFER, d),
  49481. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49482. } else
  49483. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49484. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49485. X.bindBuffer(X.ARRAY_BUFFER, d),
  49486. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49487. } else if (void 0 !== s) {
  49488. var m = s[l];
  49489. if (void 0 !== m)
  49490. switch (m.length) {
  49491. case 2:
  49492. X.vertexAttrib2fv(c, m);
  49493. break;
  49494. case 3:
  49495. X.vertexAttrib3fv(c, m);
  49496. break;
  49497. case 4:
  49498. X.vertexAttrib4fv(c, m);
  49499. break;
  49500. default:
  49501. X.vertexAttrib1fv(c, m)
  49502. }
  49503. }
  49504. }
  49505. }
  49506. _e.disableUnusedAttributes()
  49507. }
  49508. }(n, a, i),
  49509. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49510. var A = 1 / 0;
  49511. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49512. var C = i.drawRange.start
  49513. , I = i.drawRange.count
  49514. , E = null !== o ? o.start : 0
  49515. , _ = null !== o ? o.count : 1 / 0
  49516. , b = Math.max(0, C, E)
  49517. , w = Math.min(0 + A, C + I, E + _) - 1
  49518. , T = Math.max(0, w - b + 1);
  49519. if (r instanceof Ci.Mesh)
  49520. if (!0 === n.wireframe)
  49521. _e.setLineWidth(n.wireframeLinewidth * S()),
  49522. v.setMode(X.LINES);
  49523. else
  49524. switch (r.drawMode) {
  49525. case Ci.TrianglesDrawMode:
  49526. v.setMode(X.TRIANGLES);
  49527. break;
  49528. case Ci.TriangleStripDrawMode:
  49529. v.setMode(X.TRIANGLE_STRIP);
  49530. break;
  49531. case Ci.TriangleFanDrawMode:
  49532. v.setMode(X.TRIANGLE_FAN)
  49533. }
  49534. else if (r instanceof Ci.Line) {
  49535. var x = n.linewidth;
  49536. void 0 === x && (x = 1),
  49537. _e.setLineWidth(x * S()),
  49538. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49539. } else
  49540. r instanceof Ci.Points && v.setMode(X.POINTS);
  49541. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49542. }
  49543. ,
  49544. this.render = function(e, t, i, n) {
  49545. if (t instanceof Ci.Camera != 0) {
  49546. var r = e.fog;
  49547. if (ee = "",
  49548. $ = -1,
  49549. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49550. null === t.parent && t.updateMatrixWorld(),
  49551. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49552. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49553. fe.setFromMatrix(ge),
  49554. U.length = 0,
  49555. W = z = -1,
  49556. Y.length = 0,
  49557. q.length = 0,
  49558. function e(t, i) {
  49559. if (!1 !== t.visible) {
  49560. if (t.layers.test(i.layers))
  49561. if (t instanceof Ci.Light)
  49562. U.push(t);
  49563. else if (t instanceof Ci.Sprite)
  49564. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49565. else if (t instanceof Ci.LensFlare)
  49566. q.push(t);
  49567. else if (t instanceof Ci.ImmediateRenderObject)
  49568. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49569. me.applyProjection(ge)),
  49570. d(t, null, t.material, me.z, null);
  49571. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49572. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49573. var n = t.material;
  49574. if (!0 === n.visible) {
  49575. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49576. me.applyProjection(ge));
  49577. var r = we.update(t);
  49578. if (n instanceof Ci.MultiMaterial)
  49579. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49580. var c = o[s]
  49581. , h = a[c.materialIndex];
  49582. !0 === h.visible && d(t, r, h, me.z, c)
  49583. }
  49584. else
  49585. d(t, r, n, me.z, null)
  49586. }
  49587. }
  49588. var u = t.children;
  49589. for (s = 0,
  49590. l = u.length; s < l; s++)
  49591. e(u[s], i)
  49592. }
  49593. }(e, t),
  49594. H.length = z + 1,
  49595. G.length = W + 1,
  49596. !0 === Z.sortObjects && (H.sort(s),
  49597. G.sort(l)),
  49598. function(e, t) {
  49599. 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;
  49600. for (i = ve.shadowsPointLight = 0,
  49601. n = e.length; i < n; i++)
  49602. if (o = (r = e[i]).color,
  49603. a = r.intensity,
  49604. s = r.distance,
  49605. r instanceof Ci.AmbientLight)
  49606. l += o.r * a,
  49607. c += o.g * a,
  49608. h += o.b * a;
  49609. else if (r instanceof Ci.DirectionalLight) {
  49610. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49611. v.direction.setFromMatrixPosition(r.matrixWorld),
  49612. me.setFromMatrixPosition(r.target.matrixWorld),
  49613. v.direction.sub(me),
  49614. v.direction.transformDirection(u),
  49615. v.shadow = r.castShadow,
  49616. r.castShadow && (v.shadowBias = r.shadow.bias,
  49617. v.shadowRadius = r.shadow.radius,
  49618. v.shadowMapSize = r.shadow.mapSize,
  49619. ve.shadows[m++] = r),
  49620. ve.directionalShadowMap[d] = r.shadow.map,
  49621. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49622. ve.directional[d++] = v
  49623. } else if (r instanceof Ci.SpotLight) {
  49624. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49625. v.position.applyMatrix4(u),
  49626. v.color.copy(o).multiplyScalar(a),
  49627. v.distance = s,
  49628. v.direction.setFromMatrixPosition(r.matrixWorld),
  49629. me.setFromMatrixPosition(r.target.matrixWorld),
  49630. v.direction.sub(me),
  49631. v.direction.transformDirection(u),
  49632. v.coneCos = Math.cos(r.angle),
  49633. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49634. v.decay = 0 === r.distance ? 0 : r.decay,
  49635. v.shadow = r.castShadow,
  49636. r.castShadow && (v.shadowBias = r.shadow.bias,
  49637. v.shadowRadius = r.shadow.radius,
  49638. v.shadowMapSize = r.shadow.mapSize,
  49639. ve.shadows[m++] = r),
  49640. ve.spotShadowMap[f] = r.shadow.map,
  49641. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49642. ve.spot[f++] = v
  49643. } else if (r instanceof Ci.PointLight) {
  49644. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49645. v.position.applyMatrix4(u),
  49646. v.color.copy(r.color).multiplyScalar(r.intensity),
  49647. v.distance = r.distance,
  49648. v.decay = 0 === r.distance ? 0 : r.decay,
  49649. v.shadow = r.castShadow,
  49650. r.castShadow && (v.shadowBias = r.shadow.bias,
  49651. v.shadowRadius = r.shadow.radius,
  49652. v.shadowMapSize = r.shadow.mapSize,
  49653. ve.shadows[m++] = r),
  49654. ve.pointShadowMap[p] = r.shadow.map,
  49655. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49656. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49657. ve.pointShadowMatrix[p].identity().setPosition(me),
  49658. ve.point[p++] = v
  49659. } else if (r instanceof Ci.HemisphereLight) {
  49660. var v;
  49661. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49662. v.direction.transformDirection(u),
  49663. v.direction.normalize(),
  49664. v.skyColor.copy(r.color).multiplyScalar(a),
  49665. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49666. ve.hemi[g++] = v
  49667. }
  49668. ve.ambient[0] = l,
  49669. ve.ambient[1] = c,
  49670. ve.ambient[2] = h,
  49671. ve.directional.length = d,
  49672. ve.spot.length = f,
  49673. ve.point.length = p,
  49674. ve.hemi.length = g,
  49675. ve.shadows.length = m,
  49676. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49677. }(U, t),
  49678. Re.render(e, t),
  49679. Ae.calls = 0,
  49680. Ae.vertices = 0,
  49681. Ae.faces = 0,
  49682. void (Ae.points = 0) === i && (i = null),
  49683. this.setRenderTarget(i),
  49684. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49685. e.overrideMaterial) {
  49686. var o = e.overrideMaterial;
  49687. c(H, t, r, o),
  49688. c(G, t, r, o)
  49689. } else
  49690. _e.setBlending(Ci.NoBlending),
  49691. c(H, t, r),
  49692. c(G, t, r);
  49693. if (Oe.render(e, t),
  49694. Le.render(e, t, re),
  49695. i) {
  49696. var a = i.texture;
  49697. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49698. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49699. , i = be.get(e.texture).__webglTexture;
  49700. _e.bindTexture(t, i),
  49701. X.generateMipmap(t),
  49702. _e.bindTexture(t, null)
  49703. }(i)
  49704. }
  49705. _e.setDepthTest(!0),
  49706. _e.setDepthWrite(!0),
  49707. _e.setColorWrite(!0)
  49708. } else
  49709. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49710. }
  49711. ,
  49712. this.setFaceCulling = function(e, t) {
  49713. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49714. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49715. _e.enable(X.CULL_FACE))
  49716. }
  49717. ,
  49718. this.setTexture = function(e, t) {
  49719. var i = be.get(e);
  49720. if (0 < e.version && i.__version !== e.version) {
  49721. var n = e.image;
  49722. 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)
  49723. }
  49724. _e.activeTexture(X.TEXTURE0 + t),
  49725. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49726. }
  49727. ,
  49728. this.getCurrentRenderTarget = function() {
  49729. return Q
  49730. }
  49731. ,
  49732. this.setRenderTarget = function(e) {
  49733. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49734. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49735. if (e) {
  49736. var n = be.get(e);
  49737. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49738. ie.copy(e.scissor),
  49739. ne = e.scissorTest,
  49740. re.copy(e.viewport)
  49741. } else
  49742. t = null,
  49743. ie.copy(ue).multiplyScalar(he),
  49744. ne = de,
  49745. re.copy(pe).multiplyScalar(he);
  49746. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49747. J = t),
  49748. _e.scissor(ie),
  49749. _e.setScissorTest(ne),
  49750. _e.viewport(re),
  49751. i) {
  49752. var r = be.get(e.texture);
  49753. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49754. }
  49755. }
  49756. ,
  49757. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49758. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49759. var a = be.get(e).__webglFramebuffer;
  49760. if (a) {
  49761. var s = !1;
  49762. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49763. s = !0);
  49764. try {
  49765. var l = e.texture;
  49766. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49767. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49768. 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")))
  49769. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49770. 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.")
  49771. } finally {
  49772. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49773. }
  49774. }
  49775. } else
  49776. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49777. }
  49778. }
  49779. ,
  49780. Ci.WebGLRenderTarget = function(e, t, i) {
  49781. this.uuid = Ci.Math.generateUUID(),
  49782. this.width = e,
  49783. this.height = t,
  49784. this.scissor = new Ci.Vector4(0,0,e,t),
  49785. this.scissorTest = !1,
  49786. this.viewport = new Ci.Vector4(0,0,e,t),
  49787. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49788. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49789. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49790. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49791. }
  49792. ,
  49793. Ci.WebGLRenderTarget.prototype = {
  49794. constructor: Ci.WebGLRenderTarget,
  49795. setSize: function(e, t) {
  49796. this.width === e && this.height === t || (this.width = e,
  49797. this.height = t,
  49798. this.dispose()),
  49799. this.viewport.set(0, 0, e, t),
  49800. this.scissor.set(0, 0, e, t)
  49801. },
  49802. clone: function() {
  49803. return (new this.constructor).copy(this)
  49804. },
  49805. copy: function(e) {
  49806. return this.width = e.width,
  49807. this.height = e.height,
  49808. this.viewport.copy(e.viewport),
  49809. this.texture = e.texture.clone(),
  49810. this.depthBuffer = e.depthBuffer,
  49811. this.stencilBuffer = e.stencilBuffer,
  49812. this
  49813. },
  49814. dispose: function() {
  49815. this.dispatchEvent({
  49816. type: "dispose"
  49817. })
  49818. }
  49819. },
  49820. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49821. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49822. Ci.WebGLRenderTarget.call(this, e, t, i),
  49823. this.activeCubeFace = 0,
  49824. this.activeMipMapLevel = 0
  49825. }
  49826. ,
  49827. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49828. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49829. Ci.WebGLBufferRenderer = function(r, o, a) {
  49830. var s;
  49831. this.setMode = function(e) {
  49832. s = e
  49833. }
  49834. ,
  49835. this.render = function(e, t) {
  49836. r.drawArrays(s, e, t),
  49837. a.calls++,
  49838. a.vertices += t,
  49839. s === r.TRIANGLES && (a.faces += t / 3)
  49840. }
  49841. ,
  49842. this.renderInstances = function(e) {
  49843. var t = o.get("ANGLE_instanced_arrays");
  49844. if (null !== t) {
  49845. var i = e.attributes.position
  49846. , n = 0;
  49847. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49848. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49849. a.calls++,
  49850. a.vertices += n * e.maxInstancedCount,
  49851. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49852. } else
  49853. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49854. }
  49855. }
  49856. ,
  49857. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49858. var s, l, c;
  49859. this.setMode = function(e) {
  49860. s = e
  49861. }
  49862. ,
  49863. this.setIndex = function(e) {
  49864. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49865. 4) : (l = r.UNSIGNED_SHORT,
  49866. 2)
  49867. }
  49868. ,
  49869. this.render = function(e, t) {
  49870. r.drawElements(s, t, l, e * c),
  49871. a.calls++,
  49872. a.vertices += t,
  49873. s === r.TRIANGLES && (a.faces += t / 3)
  49874. }
  49875. ,
  49876. this.renderInstances = function(e, t, i) {
  49877. var n = o.get("ANGLE_instanced_arrays");
  49878. 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),
  49879. a.calls++,
  49880. a.vertices += i * e.maxInstancedCount,
  49881. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49882. }
  49883. }
  49884. ,
  49885. Ci.WebGLExtensions = function(i) {
  49886. var n = {};
  49887. this.get = function(e) {
  49888. if (void 0 !== n[e])
  49889. return n[e];
  49890. var t;
  49891. switch (e) {
  49892. case "EXT_texture_filter_anisotropic":
  49893. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49894. break;
  49895. case "WEBGL_compressed_texture_s3tc":
  49896. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49897. break;
  49898. case "WEBGL_compressed_texture_pvrtc":
  49899. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49900. break;
  49901. case "WEBGL_compressed_texture_etc1":
  49902. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49903. break;
  49904. default:
  49905. t = i.getExtension(e)
  49906. }
  49907. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49908. n[e] = t
  49909. }
  49910. }
  49911. ,
  49912. Ci.WebGLCapabilities = function(t, e, i) {
  49913. function n(e) {
  49914. if ("highp" === e) {
  49915. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49916. return "highp";
  49917. e = "mediump"
  49918. }
  49919. 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"
  49920. }
  49921. this.getMaxPrecision = n,
  49922. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49923. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49924. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49925. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49926. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49927. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49928. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49929. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49930. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49931. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49932. this.vertexTextures = 0 < this.maxVertexTextures,
  49933. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49934. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49935. var r = n(this.precision);
  49936. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49937. this.precision = r),
  49938. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49939. }
  49940. ,
  49941. Ci.WebGLGeometries = function(i, o, a) {
  49942. function s(e) {
  49943. var t = e.target
  49944. , i = c[t.id];
  49945. null !== i.index && l(i.index),
  49946. function(e) {
  49947. for (var t in e)
  49948. l(e[t])
  49949. }(i.attributes),
  49950. t.removeEventListener("dispose", s),
  49951. delete c[t.id];
  49952. var n = o.get(t);
  49953. n.wireframe && l(n.wireframe),
  49954. o.delete(t);
  49955. var r = o.get(i);
  49956. r.wireframe && l(r.wireframe),
  49957. o.delete(i),
  49958. a.memory.geometries--
  49959. }
  49960. function l(e) {
  49961. var t = function(e) {
  49962. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49963. }(e);
  49964. void 0 !== t && (i.deleteBuffer(t),
  49965. function(e) {
  49966. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49967. }(e))
  49968. }
  49969. var c = {};
  49970. this.get = function(e) {
  49971. var t, i = e.geometry;
  49972. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49973. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49974. t = i._bufferGeometry),
  49975. c[i.id] = t,
  49976. a.memory.geometries++,
  49977. t)
  49978. }
  49979. }
  49980. ,
  49981. Ci.WebGLLights = function() {
  49982. var i = {};
  49983. this.get = function(e) {
  49984. if (void 0 !== i[e.id])
  49985. return i[e.id];
  49986. var t;
  49987. switch (e.type) {
  49988. case "DirectionalLight":
  49989. t = {
  49990. direction: new Ci.Vector3,
  49991. color: new Ci.Color,
  49992. shadow: !1,
  49993. shadowBias: 0,
  49994. shadowRadius: 1,
  49995. shadowMapSize: new Ci.Vector2
  49996. };
  49997. break;
  49998. case "SpotLight":
  49999. t = {
  50000. position: new Ci.Vector3,
  50001. direction: new Ci.Vector3,
  50002. color: new Ci.Color,
  50003. distance: 0,
  50004. coneCos: 0,
  50005. penumbraCos: 0,
  50006. decay: 0,
  50007. shadow: !1,
  50008. shadowBias: 0,
  50009. shadowRadius: 1,
  50010. shadowMapSize: new Ci.Vector2
  50011. };
  50012. break;
  50013. case "PointLight":
  50014. t = {
  50015. position: new Ci.Vector3,
  50016. color: new Ci.Color,
  50017. distance: 0,
  50018. decay: 0,
  50019. shadow: !1,
  50020. shadowBias: 0,
  50021. shadowRadius: 1,
  50022. shadowMapSize: new Ci.Vector2
  50023. };
  50024. break;
  50025. case "HemisphereLight":
  50026. t = {
  50027. direction: new Ci.Vector3,
  50028. skyColor: new Ci.Color,
  50029. groundColor: new Ci.Color
  50030. }
  50031. }
  50032. return i[e.id] = t
  50033. }
  50034. }
  50035. ,
  50036. Ci.WebGLObjects = function(g, m, e) {
  50037. function v(e, t) {
  50038. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50039. , n = m.get(i);
  50040. void 0 === n.__webglBuffer ? function(e, t, i) {
  50041. e.__webglBuffer = g.createBuffer(),
  50042. g.bindBuffer(i, e.__webglBuffer);
  50043. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50044. g.bufferData(i, t.array, n),
  50045. e.version = t.version
  50046. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50047. g.bindBuffer(i, e.__webglBuffer),
  50048. !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)),
  50049. t.updateRange.count = 0),
  50050. e.version = t.version
  50051. }(n, i, t)
  50052. }
  50053. function y(e, t, i) {
  50054. if (i < t) {
  50055. var n = t;
  50056. t = i,
  50057. i = n
  50058. }
  50059. var r = e[t];
  50060. return void 0 === r ? (e[t] = [i],
  50061. !0) : -1 === r.indexOf(i) && (r.push(i),
  50062. !0)
  50063. }
  50064. var c = new Ci.WebGLGeometries(g,m,e);
  50065. this.getAttributeBuffer = function(e) {
  50066. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50067. }
  50068. ,
  50069. this.getWireframeAttribute = function(e) {
  50070. var t = m.get(e);
  50071. if (void 0 !== t.wireframe)
  50072. return t.wireframe;
  50073. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50074. if (null !== r)
  50075. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50076. var h = i[l + 0]
  50077. , u = i[l + 1]
  50078. , d = i[l + 2];
  50079. y(s, h, u) && n.push(h, u),
  50080. y(s, u, d) && n.push(u, d),
  50081. y(s, d, h) && n.push(d, h)
  50082. }
  50083. else
  50084. for (l = 0,
  50085. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50086. h = l + 0,
  50087. u = l + 1,
  50088. d = l + 2;
  50089. n.push(h, u, u, d, d, h)
  50090. }
  50091. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50092. , f = new Ci.BufferAttribute(new p(n),1);
  50093. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50094. t.wireframe = f
  50095. }
  50096. ,
  50097. this.update = function(e) {
  50098. var t = c.get(e);
  50099. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50100. var i = t.index
  50101. , n = t.attributes;
  50102. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50103. n)
  50104. v(n[r], g.ARRAY_BUFFER);
  50105. var o = t.morphAttributes;
  50106. for (var r in o)
  50107. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50108. v(a[s], g.ARRAY_BUFFER);
  50109. return t
  50110. }
  50111. }
  50112. ,
  50113. Ci.WebGLProgram = (Qt = 0,
  50114. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50115. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50116. ei = /^([\w\d_]+)\[0\]$/,
  50117. function(e, t, i, n) {
  50118. var r = e.context
  50119. , o = i.extensions
  50120. , a = i.defines
  50121. , s = i.__webglShader.vertexShader
  50122. , l = i.__webglShader.fragmentShader
  50123. , c = "SHADOWMAP_TYPE_BASIC";
  50124. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50125. var h = "ENVMAP_TYPE_CUBE"
  50126. , u = "ENVMAP_MODE_REFLECTION"
  50127. , d = "ENVMAP_BLENDING_MULTIPLY";
  50128. if (n.envMap) {
  50129. switch (i.envMap.mapping) {
  50130. case Ci.CubeReflectionMapping:
  50131. case Ci.CubeRefractionMapping:
  50132. h = "ENVMAP_TYPE_CUBE";
  50133. break;
  50134. case Ci.CubeUVReflectionMapping:
  50135. case Ci.CubeUVRefractionMapping:
  50136. h = "ENVMAP_TYPE_CUBE_UV";
  50137. break;
  50138. case Ci.EquirectangularReflectionMapping:
  50139. case Ci.EquirectangularRefractionMapping:
  50140. h = "ENVMAP_TYPE_EQUIREC";
  50141. break;
  50142. case Ci.SphericalReflectionMapping:
  50143. h = "ENVMAP_TYPE_SPHERE"
  50144. }
  50145. switch (i.envMap.mapping) {
  50146. case Ci.CubeRefractionMapping:
  50147. case Ci.EquirectangularRefractionMapping:
  50148. u = "ENVMAP_MODE_REFRACTION"
  50149. }
  50150. switch (i.combine) {
  50151. case Ci.MultiplyOperation:
  50152. d = "ENVMAP_BLENDING_MULTIPLY";
  50153. break;
  50154. case Ci.MixOperation:
  50155. d = "ENVMAP_BLENDING_MIX";
  50156. break;
  50157. case Ci.AddOperation:
  50158. d = "ENVMAP_BLENDING_ADD"
  50159. }
  50160. }
  50161. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50162. 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")
  50163. }(o, n, e.extensions), v = function(e) {
  50164. var t = [];
  50165. for (var i in e) {
  50166. var n = e[i];
  50167. !1 !== n && t.push("#define " + i + " " + n)
  50168. }
  50169. return t.join("\n")
  50170. }(a), y = r.createProgram();
  50171. 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"),
  50172. [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) {
  50173. var i;
  50174. switch (t) {
  50175. case Ci.LinearToneMapping:
  50176. i = "Linear";
  50177. break;
  50178. case Ci.ReinhardToneMapping:
  50179. i = "Reinhard";
  50180. break;
  50181. case Ci.Uncharted2ToneMapping:
  50182. i = "Uncharted2";
  50183. break;
  50184. case Ci.CineonToneMapping:
  50185. i = "OptimizedCineon";
  50186. break;
  50187. default:
  50188. throw new Error("unsupported toneMapping: " + t)
  50189. }
  50190. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50191. }("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) {
  50192. var i = Mi(t);
  50193. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50194. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50195. s = Oi(s = Li(s), n),
  50196. l = Oi(l = Li(l), n),
  50197. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50198. l = Di(l));
  50199. var A = p + s
  50200. , C = f + l
  50201. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50202. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50203. r.attachShader(y, I),
  50204. r.attachShader(y, E),
  50205. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50206. r.linkProgram(y);
  50207. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50208. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50209. 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),
  50210. M && (this.diagnostics = {
  50211. runnable: S,
  50212. material: i,
  50213. programLog: w,
  50214. vertexShader: {
  50215. log: T,
  50216. prefix: p
  50217. },
  50218. fragmentShader: {
  50219. log: x,
  50220. prefix: f
  50221. }
  50222. }),
  50223. r.deleteShader(I),
  50224. r.deleteShader(E),
  50225. this.getUniforms = function() {
  50226. return void 0 === _ && (_ = function(e, t) {
  50227. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50228. var o = e.getActiveUniform(t, r).name
  50229. , a = e.getUniformLocation(t, o)
  50230. , s = Jt.exec(o);
  50231. if (s) {
  50232. var l = s[1]
  50233. , c = s[2]
  50234. , h = i[l];
  50235. (h = h || (i[l] = {}))[c] = a
  50236. } else if (s = $t.exec(o)) {
  50237. var u = s[1]
  50238. , d = s[2]
  50239. , p = s[3]
  50240. , f = i[u]
  50241. , g = (f = f || (i[u] = []))[d];
  50242. (g = g || (f[d] = {}))[p] = a
  50243. } else
  50244. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50245. }
  50246. return i
  50247. }(r, y)),
  50248. _
  50249. }
  50250. ,
  50251. this.getAttributes = function() {
  50252. return void 0 === b && (b = function(e, t) {
  50253. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50254. var o = e.getActiveAttrib(t, r).name;
  50255. i[o] = e.getAttribLocation(t, o)
  50256. }
  50257. return i
  50258. }(r, y)),
  50259. b
  50260. }
  50261. ,
  50262. this.destroy = function() {
  50263. r.deleteProgram(y),
  50264. this.program = void 0
  50265. }
  50266. ,
  50267. Object.defineProperties(this, {
  50268. uniforms: {
  50269. get: function() {
  50270. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50271. this.getUniforms()
  50272. }
  50273. },
  50274. attributes: {
  50275. get: function() {
  50276. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50277. this.getAttributes()
  50278. }
  50279. }
  50280. }),
  50281. this.id = Qt++,
  50282. this.code = t,
  50283. this.usedTimes = 1,
  50284. this.program = y,
  50285. this.vertexShader = I,
  50286. this.fragmentShader = E,
  50287. this
  50288. }
  50289. ),
  50290. Ci.WebGLPrograms = function(s, l) {
  50291. function c(e, t) {
  50292. var i;
  50293. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50294. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50295. i
  50296. }
  50297. var h = []
  50298. , u = {
  50299. MeshDepthMaterial: "depth",
  50300. MeshNormalMaterial: "normal",
  50301. MeshBasicMaterial: "basic",
  50302. MeshLambertMaterial: "lambert",
  50303. MeshPhongMaterial: "phong",
  50304. MeshStandardMaterial: "standard",
  50305. LineBasicMaterial: "basic",
  50306. LineDashedMaterial: "dashed",
  50307. PointsMaterial: "points"
  50308. }
  50309. , 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"];
  50310. this.getParameters = function(e, t, i, n) {
  50311. var r = u[e.type]
  50312. , o = function(e) {
  50313. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50314. return 1024;
  50315. var t = l.maxVertexUniforms
  50316. , i = Math.floor((t - 20) / 4);
  50317. 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)")),
  50318. i
  50319. }(n)
  50320. , a = s.getPrecision();
  50321. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50322. {
  50323. shaderID: r,
  50324. precision: a,
  50325. supportsVertexTextures: l.vertexTextures,
  50326. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50327. map: !!e.map,
  50328. mapEncoding: c(e.map, s.gammaInput),
  50329. envMap: !!e.envMap,
  50330. envMapMode: e.envMap && e.envMap.mapping,
  50331. envMapEncoding: c(e.envMap, s.gammaInput),
  50332. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50333. lightMap: !!e.lightMap,
  50334. aoMap: !!e.aoMap,
  50335. emissiveMap: !!e.emissiveMap,
  50336. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50337. bumpMap: !!e.bumpMap,
  50338. normalMap: !!e.normalMap,
  50339. displacementMap: !!e.displacementMap,
  50340. roughnessMap: !!e.roughnessMap,
  50341. metalnessMap: !!e.metalnessMap,
  50342. specularMap: !!e.specularMap,
  50343. alphaMap: !!e.alphaMap,
  50344. combine: e.combine,
  50345. vertexColors: e.vertexColors,
  50346. fog: i,
  50347. useFog: e.fog,
  50348. fogExp: i instanceof Ci.FogExp2,
  50349. flatShading: e.shading === Ci.FlatShading,
  50350. sizeAttenuation: e.sizeAttenuation,
  50351. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50352. skinning: e.skinning,
  50353. maxBones: o,
  50354. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50355. morphTargets: e.morphTargets,
  50356. morphNormals: e.morphNormals,
  50357. maxMorphTargets: s.maxMorphTargets,
  50358. maxMorphNormals: s.maxMorphNormals,
  50359. numDirLights: t.directional.length,
  50360. numPointLights: t.point.length,
  50361. numSpotLights: t.spot.length,
  50362. numHemiLights: t.hemi.length,
  50363. pointLightShadows: t.shadowsPointLight,
  50364. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50365. shadowMapType: s.shadowMap.type,
  50366. toneMapping: s.toneMapping,
  50367. physicallyCorrectLights: s.physicallyCorrectLights,
  50368. premultipliedAlpha: e.premultipliedAlpha,
  50369. alphaTest: e.alphaTest,
  50370. doubleSided: e.side === Ci.DoubleSide,
  50371. flipSided: e.side === Ci.BackSide
  50372. }
  50373. }
  50374. ,
  50375. this.getProgramCode = function(e, t) {
  50376. var i = [];
  50377. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50378. i.push(e.vertexShader)),
  50379. void 0 !== e.defines)
  50380. for (var n in e.defines)
  50381. i.push(n),
  50382. i.push(e.defines[n]);
  50383. for (var r = 0; r < a.length; r++) {
  50384. var o = a[r];
  50385. i.push(o),
  50386. i.push(t[o])
  50387. }
  50388. return i.join()
  50389. }
  50390. ,
  50391. this.acquireProgram = function(e, t, i) {
  50392. for (var n, r = 0, o = h.length; r < o; r++) {
  50393. var a = h[r];
  50394. if (a.code === i) {
  50395. ++(n = a).usedTimes;
  50396. break
  50397. }
  50398. }
  50399. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50400. h.push(n)),
  50401. n
  50402. }
  50403. ,
  50404. this.releaseProgram = function(e) {
  50405. if (0 == --e.usedTimes) {
  50406. var t = h.indexOf(e);
  50407. h[t] = h[h.length - 1],
  50408. h.pop(),
  50409. e.destroy()
  50410. }
  50411. }
  50412. ,
  50413. this.programs = h
  50414. }
  50415. ,
  50416. Ci.WebGLProperties = function() {
  50417. var n = {};
  50418. this.get = function(e) {
  50419. var t = e.uuid
  50420. , i = n[t];
  50421. return void 0 === i && (i = {},
  50422. n[t] = i),
  50423. i
  50424. }
  50425. ,
  50426. this.delete = function(e) {
  50427. delete n[e.uuid]
  50428. }
  50429. ,
  50430. this.clear = function() {
  50431. n = {}
  50432. }
  50433. }
  50434. ,
  50435. Ci.WebGLShader = function(e, t, i) {
  50436. var n = e.createShader(t);
  50437. return e.shaderSource(n, i),
  50438. e.compileShader(n),
  50439. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50440. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50441. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50442. t[i] = i + 1 + ": " + t[i];
  50443. return t.join("\n")
  50444. }(i)),
  50445. n
  50446. }
  50447. ,
  50448. Ci.WebGLShadowMap = function(P, O, L) {
  50449. function D(e, t, i, n) {
  50450. var r = e.geometry
  50451. , o = null
  50452. , a = p
  50453. , s = e.customDepthMaterial;
  50454. if (i && (a = f,
  50455. s = e.customDistanceMaterial),
  50456. s)
  50457. o = s;
  50458. else {
  50459. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50460. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50461. , h = 0;
  50462. l && (h |= u),
  50463. c && (h |= d),
  50464. o = a[h]
  50465. }
  50466. return o.visible = t.visible,
  50467. o.wireframe = t.wireframe,
  50468. o.wireframeLinewidth = t.wireframeLinewidth,
  50469. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50470. o
  50471. }
  50472. function N(e, t, i) {
  50473. if (!1 !== e.visible) {
  50474. 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)))
  50475. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50476. G.push(e));
  50477. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50478. N(n[r], t, i)
  50479. }
  50480. }
  50481. 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) {
  50482. var a = 0 != (o & u)
  50483. , s = 0 != (o & d)
  50484. , l = new Ci.ShaderMaterial({
  50485. uniforms: i,
  50486. vertexShader: t.vertexShader,
  50487. fragmentShader: t.fragmentShader,
  50488. morphTargets: a,
  50489. skinning: s
  50490. });
  50491. p[o] = l;
  50492. var c = new Ci.ShaderMaterial({
  50493. defines: {
  50494. USE_SHADOWMAP: ""
  50495. },
  50496. uniforms: r,
  50497. vertexShader: n.vertexShader,
  50498. fragmentShader: n.fragmentShader,
  50499. morphTargets: a,
  50500. skinning: s
  50501. });
  50502. f[o] = c
  50503. }
  50504. var q = this;
  50505. this.enabled = !1,
  50506. this.autoUpdate = !0,
  50507. this.needsUpdate = !1,
  50508. this.type = Ci.PCFShadowMap,
  50509. this.cullFace = Ci.CullFaceFront,
  50510. this.render = function(e, t) {
  50511. var i, n, r = O.shadows;
  50512. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50513. B.clearColor(1, 1, 1, 1),
  50514. B.disable(F.BLEND),
  50515. B.enable(F.CULL_FACE),
  50516. F.frontFace(F.CCW),
  50517. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50518. B.setDepthTest(!0),
  50519. B.setScissorTest(!1);
  50520. for (var o = 0, a = r.length; o < a; o++) {
  50521. var s = r[o]
  50522. , l = s.shadow
  50523. , c = l.camera;
  50524. if (U.copy(l.mapSize),
  50525. s instanceof Ci.PointLight) {
  50526. i = 6,
  50527. n = !0;
  50528. var h = U.x
  50529. , u = U.y;
  50530. Y[0].set(2 * h, u, h, u),
  50531. Y[1].set(0, u, h, u),
  50532. Y[2].set(3 * h, u, h, u),
  50533. Y[3].set(h, u, h, u),
  50534. Y[4].set(3 * h, 0, h, u),
  50535. Y[5].set(h, 0, h, u),
  50536. U.x *= 4,
  50537. U.y *= 2
  50538. } else
  50539. n = !(i = 1);
  50540. if (null === l.map) {
  50541. var d = {
  50542. minFilter: Ci.NearestFilter,
  50543. magFilter: Ci.NearestFilter,
  50544. format: Ci.RGBAFormat
  50545. };
  50546. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50547. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50548. c.updateProjectionMatrix()
  50549. }
  50550. var p = l.map
  50551. , f = l.matrix;
  50552. z.setFromMatrixPosition(s.matrixWorld),
  50553. c.position.copy(z),
  50554. P.setRenderTarget(p),
  50555. P.clear();
  50556. for (var g = 0; g < i; g++) {
  50557. if (n) {
  50558. H.copy(c.position),
  50559. H.add(W[g]),
  50560. c.up.copy(j[g]),
  50561. c.lookAt(H);
  50562. var m = Y[g];
  50563. B.viewport(m)
  50564. } else
  50565. H.setFromMatrixPosition(s.target.matrixWorld),
  50566. c.lookAt(H);
  50567. c.updateMatrixWorld(),
  50568. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50569. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50570. f.multiply(c.projectionMatrix),
  50571. f.multiply(c.matrixWorldInverse),
  50572. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50573. V.setFromMatrix(k),
  50574. G.length = 0,
  50575. N(e, t, c);
  50576. for (var v = 0, y = G.length; v < y; v++) {
  50577. var A = G[v]
  50578. , C = L.update(A)
  50579. , I = A.material;
  50580. if (I instanceof Ci.MultiMaterial)
  50581. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50582. var T = E[b]
  50583. , x = _[T.materialIndex];
  50584. if (!0 === x.visible) {
  50585. var S = D(A, x, n, z);
  50586. P.renderBufferDirect(c, null, C, S, A, T)
  50587. }
  50588. }
  50589. else {
  50590. S = D(A, I, n, z);
  50591. P.renderBufferDirect(c, null, C, S, A, null)
  50592. }
  50593. }
  50594. }
  50595. }
  50596. var M = P.getClearColor()
  50597. , R = P.getClearAlpha();
  50598. P.setClearColor(M, R),
  50599. B.enable(F.BLEND),
  50600. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50601. q.needsUpdate = !1
  50602. }
  50603. }
  50604. }
  50605. ,
  50606. Ci.WebGLState = function(l, i, c) {
  50607. var n = this
  50608. , r = new Ci.Vector4
  50609. , o = new Uint8Array(16)
  50610. , a = new Uint8Array(16)
  50611. , s = new Uint8Array(16)
  50612. , t = {}
  50613. , h = null
  50614. , u = null
  50615. , d = null
  50616. , p = null
  50617. , f = null
  50618. , g = null
  50619. , m = null
  50620. , v = null
  50621. , y = !1
  50622. , A = null
  50623. , C = null
  50624. , I = null
  50625. , E = null
  50626. , _ = null
  50627. , b = null
  50628. , w = null
  50629. , T = null
  50630. , x = null
  50631. , S = null
  50632. , M = null
  50633. , R = null
  50634. , P = null
  50635. , O = null
  50636. , L = null
  50637. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50638. , N = void 0
  50639. , F = {}
  50640. , B = new Ci.Vector4
  50641. , V = null
  50642. , k = null
  50643. , U = new Ci.Vector4
  50644. , H = new Ci.Vector4
  50645. , z = l.createTexture();
  50646. l.bindTexture(l.TEXTURE_2D, z),
  50647. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50648. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50649. this.init = function() {
  50650. this.clearColor(0, 0, 0, 1),
  50651. this.clearDepth(1),
  50652. this.clearStencil(0),
  50653. this.enable(l.DEPTH_TEST),
  50654. l.depthFunc(l.LEQUAL),
  50655. l.frontFace(l.CCW),
  50656. l.cullFace(l.BACK),
  50657. this.enable(l.CULL_FACE),
  50658. this.enable(l.BLEND),
  50659. l.blendEquation(l.FUNC_ADD),
  50660. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50661. }
  50662. ,
  50663. this.initAttributes = function() {
  50664. for (var e = 0, t = o.length; e < t; e++)
  50665. o[e] = 0
  50666. }
  50667. ,
  50668. this.enableAttribute = function(e) {
  50669. o[e] = 1,
  50670. 0 === a[e] && (l.enableVertexAttribArray(e),
  50671. a[e] = 1),
  50672. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50673. s[e] = 0)
  50674. }
  50675. ,
  50676. this.enableAttributeAndDivisor = function(e, t, i) {
  50677. o[e] = 1,
  50678. 0 === a[e] && (l.enableVertexAttribArray(e),
  50679. a[e] = 1),
  50680. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50681. s[e] = t)
  50682. }
  50683. ,
  50684. this.disableUnusedAttributes = function() {
  50685. for (var e = 0, t = a.length; e < t; e++)
  50686. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50687. a[e] = 0)
  50688. }
  50689. ,
  50690. this.enable = function(e) {
  50691. !0 !== t[e] && (l.enable(e),
  50692. t[e] = !0)
  50693. }
  50694. ,
  50695. this.disable = function(e) {
  50696. !1 !== t[e] && (l.disable(e),
  50697. t[e] = !1)
  50698. }
  50699. ,
  50700. this.getCompressedTextureFormats = function() {
  50701. if (null === h && (h = [],
  50702. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50703. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50704. h.push(e[t]);
  50705. return h
  50706. }
  50707. ,
  50708. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50709. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50710. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50711. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50712. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50713. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50714. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50715. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50716. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50717. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50718. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50719. u = e,
  50720. y = s),
  50721. e === Ci.CustomBlending ? (r = r || t,
  50722. o = o || i,
  50723. a = a || n,
  50724. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50725. d = t,
  50726. g = r),
  50727. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50728. p = i,
  50729. f = n,
  50730. m = o,
  50731. v = a)) : v = m = g = f = p = d = null
  50732. }
  50733. ,
  50734. this.setDepthFunc = function(e) {
  50735. if (A !== e) {
  50736. if (e)
  50737. switch (e) {
  50738. case Ci.NeverDepth:
  50739. l.depthFunc(l.NEVER);
  50740. break;
  50741. case Ci.AlwaysDepth:
  50742. l.depthFunc(l.ALWAYS);
  50743. break;
  50744. case Ci.LessDepth:
  50745. l.depthFunc(l.LESS);
  50746. break;
  50747. case Ci.LessEqualDepth:
  50748. l.depthFunc(l.LEQUAL);
  50749. break;
  50750. case Ci.EqualDepth:
  50751. l.depthFunc(l.EQUAL);
  50752. break;
  50753. case Ci.GreaterEqualDepth:
  50754. l.depthFunc(l.GEQUAL);
  50755. break;
  50756. case Ci.GreaterDepth:
  50757. l.depthFunc(l.GREATER);
  50758. break;
  50759. case Ci.NotEqualDepth:
  50760. l.depthFunc(l.NOTEQUAL);
  50761. break;
  50762. default:
  50763. l.depthFunc(l.LEQUAL)
  50764. }
  50765. else
  50766. l.depthFunc(l.LEQUAL);
  50767. A = e
  50768. }
  50769. }
  50770. ,
  50771. this.setDepthTest = function(e) {
  50772. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50773. }
  50774. ,
  50775. this.setDepthWrite = function(e) {
  50776. C !== e && (l.depthMask(e),
  50777. C = e)
  50778. }
  50779. ,
  50780. this.setColorWrite = function(e) {
  50781. I !== e && (l.colorMask(e, e, e, e),
  50782. I = e)
  50783. }
  50784. ,
  50785. this.setStencilFunc = function(e, t, i) {
  50786. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50787. _ = e,
  50788. b = t,
  50789. w = i)
  50790. }
  50791. ,
  50792. this.setStencilOp = function(e, t, i) {
  50793. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50794. T = e,
  50795. x = t,
  50796. S = i)
  50797. }
  50798. ,
  50799. this.setStencilTest = function(e) {
  50800. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50801. }
  50802. ,
  50803. this.setStencilWrite = function(e) {
  50804. E !== e && (l.stencilMask(e),
  50805. E = e)
  50806. }
  50807. ,
  50808. this.setFlipSided = function(e) {
  50809. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50810. M = e)
  50811. }
  50812. ,
  50813. this.setLineWidth = function(e) {
  50814. e !== R && (l.lineWidth(e),
  50815. R = e)
  50816. }
  50817. ,
  50818. this.setPolygonOffset = function(e, t, i) {
  50819. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50820. !e || P === t && O === i || (l.polygonOffset(t, i),
  50821. P = t,
  50822. O = i)
  50823. }
  50824. ,
  50825. this.getScissorTest = function() {
  50826. return L
  50827. }
  50828. ,
  50829. this.setScissorTest = function(e) {
  50830. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50831. }
  50832. ,
  50833. this.activeTexture = function(e) {
  50834. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50835. N !== e && (l.activeTexture(e),
  50836. N = e)
  50837. }
  50838. ,
  50839. this.bindTexture = function(e, t) {
  50840. void 0 === N && n.activeTexture();
  50841. var i = F[N];
  50842. void 0 === i && (i = {
  50843. type: void 0,
  50844. texture: void 0
  50845. },
  50846. F[N] = i),
  50847. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50848. i.type = e,
  50849. i.texture = t)
  50850. }
  50851. ,
  50852. this.compressedTexImage2D = function() {
  50853. try {
  50854. l.compressedTexImage2D.apply(l, arguments)
  50855. } catch (e) {
  50856. console.error(e)
  50857. }
  50858. }
  50859. ,
  50860. this.texImage2D = function() {
  50861. try {
  50862. l.texImage2D.apply(l, arguments)
  50863. } catch (e) {
  50864. console.error(e)
  50865. }
  50866. }
  50867. ,
  50868. this.clearColor = function(e, t, i, n) {
  50869. r.set(e, t, i, n),
  50870. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50871. B.copy(r))
  50872. }
  50873. ,
  50874. this.clearDepth = function(e) {
  50875. V !== e && (l.clearDepth(e),
  50876. V = e)
  50877. }
  50878. ,
  50879. this.clearStencil = function(e) {
  50880. k !== e && (l.clearStencil(e),
  50881. k = e)
  50882. }
  50883. ,
  50884. this.scissor = function(e) {
  50885. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50886. U.copy(e))
  50887. }
  50888. ,
  50889. this.viewport = function(e) {
  50890. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50891. H.copy(e))
  50892. }
  50893. ,
  50894. this.reset = function() {
  50895. for (var e = 0; e < a.length; e++)
  50896. 1 === a[e] && (l.disableVertexAttribArray(e),
  50897. a[e] = 0);
  50898. t = {},
  50899. N = void 0,
  50900. F = {},
  50901. M = E = C = I = u = h = null
  50902. }
  50903. }
  50904. ,
  50905. Ci.LensFlarePlugin = function(v, y) {
  50906. function A() {
  50907. 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]);
  50908. C = S.createBuffer(),
  50909. I = S.createBuffer(),
  50910. S.bindBuffer(S.ARRAY_BUFFER, C),
  50911. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50912. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50913. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50914. T = S.createTexture(),
  50915. x = S.createTexture(),
  50916. M.bindTexture(S.TEXTURE_2D, T),
  50917. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50918. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50919. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50920. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50921. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50922. M.bindTexture(S.TEXTURE_2D, x),
  50923. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50924. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50925. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50926. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50927. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50928. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50929. 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"),
  50930. 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")
  50931. } : {
  50932. 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"),
  50933. 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")
  50934. },
  50935. E = function(e) {
  50936. var t = S.createProgram()
  50937. , i = S.createShader(S.FRAGMENT_SHADER)
  50938. , n = S.createShader(S.VERTEX_SHADER)
  50939. , r = "precision " + v.getPrecision() + " float;\n";
  50940. return S.shaderSource(i, r + e.fragmentShader),
  50941. S.shaderSource(n, r + e.vertexShader),
  50942. S.compileShader(i),
  50943. S.compileShader(n),
  50944. S.attachShader(t, i),
  50945. S.attachShader(t, n),
  50946. S.linkProgram(t),
  50947. t
  50948. }(e),
  50949. _ = {
  50950. vertex: S.getAttribLocation(E, "position"),
  50951. uv: S.getAttribLocation(E, "uv")
  50952. },
  50953. b = {
  50954. renderType: S.getUniformLocation(E, "renderType"),
  50955. map: S.getUniformLocation(E, "map"),
  50956. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50957. opacity: S.getUniformLocation(E, "opacity"),
  50958. color: S.getUniformLocation(E, "color"),
  50959. scale: S.getUniformLocation(E, "scale"),
  50960. rotation: S.getUniformLocation(E, "rotation"),
  50961. screenPosition: S.getUniformLocation(E, "screenPosition")
  50962. }
  50963. }
  50964. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50965. this.render = function(e, t, i) {
  50966. if (0 !== y.length) {
  50967. var n = new Ci.Vector3
  50968. , r = i.w / i.z
  50969. , o = .5 * i.z
  50970. , a = .5 * i.w
  50971. , s = 16 / i.w
  50972. , l = new Ci.Vector2(s * r,s)
  50973. , c = new Ci.Vector3(1,1,0)
  50974. , h = new Ci.Vector2(1,1);
  50975. void 0 === E && A(),
  50976. S.useProgram(E),
  50977. M.initAttributes(),
  50978. M.enableAttribute(_.vertex),
  50979. M.enableAttribute(_.uv),
  50980. M.disableUnusedAttributes(),
  50981. S.uniform1i(b.occlusionMap, 0),
  50982. S.uniform1i(b.map, 1),
  50983. S.bindBuffer(S.ARRAY_BUFFER, C),
  50984. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50985. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50986. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50987. M.disable(S.CULL_FACE),
  50988. M.setDepthWrite(!1);
  50989. for (var u = 0, d = y.length; u < d; u++) {
  50990. s = 16 / i.w,
  50991. l.set(s * r, s);
  50992. var p = y[u];
  50993. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50994. n.applyMatrix4(t.matrixWorldInverse),
  50995. n.applyProjection(t.projectionMatrix),
  50996. c.copy(n),
  50997. h.x = c.x * o + o,
  50998. h.y = c.y * a + a,
  50999. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51000. M.activeTexture(S.TEXTURE0),
  51001. M.bindTexture(S.TEXTURE_2D, null),
  51002. M.activeTexture(S.TEXTURE1),
  51003. M.bindTexture(S.TEXTURE_2D, T),
  51004. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51005. S.uniform1i(b.renderType, 0),
  51006. S.uniform2f(b.scale, l.x, l.y),
  51007. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51008. M.disable(S.BLEND),
  51009. M.enable(S.DEPTH_TEST),
  51010. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51011. M.activeTexture(S.TEXTURE0),
  51012. M.bindTexture(S.TEXTURE_2D, x),
  51013. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51014. S.uniform1i(b.renderType, 1),
  51015. M.disable(S.DEPTH_TEST),
  51016. M.activeTexture(S.TEXTURE1),
  51017. M.bindTexture(S.TEXTURE_2D, T),
  51018. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51019. p.positionScreen.copy(c),
  51020. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51021. S.uniform1i(b.renderType, 2),
  51022. M.enable(S.BLEND);
  51023. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51024. var m = p.lensFlares[f];
  51025. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51026. c.y = m.y,
  51027. c.z = m.z,
  51028. s = m.size * m.scale / i.w,
  51029. l.x = s * r,
  51030. l.y = s,
  51031. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51032. S.uniform2f(b.scale, l.x, l.y),
  51033. S.uniform1f(b.rotation, m.rotation),
  51034. S.uniform1f(b.opacity, m.opacity),
  51035. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51036. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51037. v.setTexture(m.texture, 1),
  51038. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51039. }
  51040. }
  51041. }
  51042. M.enable(S.CULL_FACE),
  51043. M.enable(S.DEPTH_TEST),
  51044. M.setDepthWrite(!0),
  51045. v.resetGLState()
  51046. }
  51047. }
  51048. }
  51049. ,
  51050. Ci.SpritePlugin = function(u, d) {
  51051. function p() {
  51052. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51053. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51054. g = I.createBuffer(),
  51055. m = I.createBuffer(),
  51056. I.bindBuffer(I.ARRAY_BUFFER, g),
  51057. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51058. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51059. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51060. v = function() {
  51061. var e = I.createProgram()
  51062. , t = I.createShader(I.VERTEX_SHADER)
  51063. , i = I.createShader(I.FRAGMENT_SHADER);
  51064. 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")),
  51065. 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")),
  51066. I.compileShader(t),
  51067. I.compileShader(i),
  51068. I.attachShader(e, t),
  51069. I.attachShader(e, i),
  51070. I.linkProgram(e),
  51071. e
  51072. }(),
  51073. y = {
  51074. position: I.getAttribLocation(v, "position"),
  51075. uv: I.getAttribLocation(v, "uv")
  51076. },
  51077. A = {
  51078. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51079. uvScale: I.getUniformLocation(v, "uvScale"),
  51080. rotation: I.getUniformLocation(v, "rotation"),
  51081. scale: I.getUniformLocation(v, "scale"),
  51082. color: I.getUniformLocation(v, "color"),
  51083. map: I.getUniformLocation(v, "map"),
  51084. opacity: I.getUniformLocation(v, "opacity"),
  51085. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51086. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51087. fogType: I.getUniformLocation(v, "fogType"),
  51088. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51089. fogNear: I.getUniformLocation(v, "fogNear"),
  51090. fogFar: I.getUniformLocation(v, "fogFar"),
  51091. fogColor: I.getUniformLocation(v, "fogColor"),
  51092. alphaTest: I.getUniformLocation(v, "alphaTest")
  51093. };
  51094. var i = document.createElement("canvas");
  51095. i.width = 8,
  51096. i.height = 8;
  51097. var n = i.getContext("2d");
  51098. n.fillStyle = "white",
  51099. n.fillRect(0, 0, 8, 8),
  51100. (C = new Ci.Texture(i)).needsUpdate = !0
  51101. }
  51102. function f(e, t) {
  51103. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51104. }
  51105. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51106. this.render = function(e, t) {
  51107. if (0 !== d.length) {
  51108. void 0 === v && p(),
  51109. I.useProgram(v),
  51110. E.initAttributes(),
  51111. E.enableAttribute(y.position),
  51112. E.enableAttribute(y.uv),
  51113. E.disableUnusedAttributes(),
  51114. E.disable(I.CULL_FACE),
  51115. E.enable(I.BLEND),
  51116. I.bindBuffer(I.ARRAY_BUFFER, g),
  51117. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51118. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51119. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51120. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51121. E.activeTexture(I.TEXTURE0),
  51122. I.uniform1i(A.map, 0);
  51123. var i = 0
  51124. , n = 0
  51125. , r = e.fog;
  51126. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51127. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51128. I.uniform1f(A.fogFar, r.far),
  51129. I.uniform1i(A.fogType, 1),
  51130. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51131. I.uniform1i(A.fogType, 2),
  51132. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51133. n = i = 0);
  51134. for (var o = 0, a = d.length; o < a; o++) {
  51135. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51136. l.z = -l.modelViewMatrix.elements[14]
  51137. }
  51138. d.sort(f);
  51139. var s = [];
  51140. for (o = 0,
  51141. a = d.length; o < a; o++) {
  51142. var l, c = (l = d[o]).material;
  51143. I.uniform1f(A.alphaTest, c.alphaTest),
  51144. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51145. l.matrixWorld.decompose(_, b, w),
  51146. s[0] = w.x,
  51147. s[1] = w.y;
  51148. var h = 0;
  51149. e.fog && c.fog && (h = n),
  51150. i !== h && (I.uniform1i(A.fogType, h),
  51151. i = h),
  51152. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51153. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51154. I.uniform2f(A.uvScale, 1, 1)),
  51155. I.uniform1f(A.opacity, c.opacity),
  51156. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51157. I.uniform1f(A.rotation, c.rotation),
  51158. I.uniform2fv(A.scale, s),
  51159. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51160. E.setDepthTest(c.depthTest),
  51161. E.setDepthWrite(c.depthWrite),
  51162. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51163. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51164. }
  51165. E.enable(I.CULL_FACE),
  51166. u.resetGLState()
  51167. }
  51168. }
  51169. }
  51170. ,
  51171. Object.defineProperties(Ci.Box2.prototype, {
  51172. empty: {
  51173. value: function() {
  51174. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51175. this.isEmpty()
  51176. }
  51177. },
  51178. isIntersectionBox: {
  51179. value: function(e) {
  51180. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51181. this.intersectsBox(e)
  51182. }
  51183. }
  51184. }),
  51185. Object.defineProperties(Ci.Box3.prototype, {
  51186. empty: {
  51187. value: function() {
  51188. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51189. this.isEmpty()
  51190. }
  51191. },
  51192. isIntersectionBox: {
  51193. value: function(e) {
  51194. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51195. this.intersectsBox(e)
  51196. }
  51197. },
  51198. isIntersectionSphere: {
  51199. value: function(e) {
  51200. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51201. this.intersectsSphere(e)
  51202. }
  51203. }
  51204. }),
  51205. Object.defineProperties(Ci.Matrix3.prototype, {
  51206. multiplyVector3: {
  51207. value: function(e) {
  51208. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51209. e.applyMatrix3(this)
  51210. }
  51211. },
  51212. multiplyVector3Array: {
  51213. value: function(e) {
  51214. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51215. this.applyToVector3Array(e)
  51216. }
  51217. }
  51218. }),
  51219. Object.defineProperties(Ci.Matrix4.prototype, {
  51220. extractPosition: {
  51221. value: function(e) {
  51222. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51223. this.copyPosition(e)
  51224. }
  51225. },
  51226. setRotationFromQuaternion: {
  51227. value: function(e) {
  51228. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51229. this.makeRotationFromQuaternion(e)
  51230. }
  51231. },
  51232. multiplyVector3: {
  51233. value: function(e) {
  51234. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51235. e.applyProjection(this)
  51236. }
  51237. },
  51238. multiplyVector4: {
  51239. value: function(e) {
  51240. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51241. e.applyMatrix4(this)
  51242. }
  51243. },
  51244. multiplyVector3Array: {
  51245. value: function(e) {
  51246. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51247. this.applyToVector3Array(e)
  51248. }
  51249. },
  51250. rotateAxis: {
  51251. value: function(e) {
  51252. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51253. e.transformDirection(this)
  51254. }
  51255. },
  51256. crossVector: {
  51257. value: function(e) {
  51258. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51259. e.applyMatrix4(this)
  51260. }
  51261. },
  51262. translate: {
  51263. value: function(e) {
  51264. console.error("THREE.Matrix4: .translate() has been removed.")
  51265. }
  51266. },
  51267. rotateX: {
  51268. value: function(e) {
  51269. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51270. }
  51271. },
  51272. rotateY: {
  51273. value: function(e) {
  51274. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51275. }
  51276. },
  51277. rotateZ: {
  51278. value: function(e) {
  51279. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51280. }
  51281. },
  51282. rotateByAxis: {
  51283. value: function(e, t) {
  51284. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51285. }
  51286. }
  51287. }),
  51288. Object.defineProperties(Ci.Plane.prototype, {
  51289. isIntersectionLine: {
  51290. value: function(e) {
  51291. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51292. this.intersectsLine(e)
  51293. }
  51294. }
  51295. }),
  51296. Object.defineProperties(Ci.Quaternion.prototype, {
  51297. multiplyVector3: {
  51298. value: function(e) {
  51299. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51300. e.applyQuaternion(this)
  51301. }
  51302. }
  51303. }),
  51304. Object.defineProperties(Ci.Ray.prototype, {
  51305. isIntersectionBox: {
  51306. value: function(e) {
  51307. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51308. this.intersectsBox(e)
  51309. }
  51310. },
  51311. isIntersectionPlane: {
  51312. value: function(e) {
  51313. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51314. this.intersectsPlane(e)
  51315. }
  51316. },
  51317. isIntersectionSphere: {
  51318. value: function(e) {
  51319. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51320. this.intersectsSphere(e)
  51321. }
  51322. }
  51323. }),
  51324. Object.defineProperties(Ci.Vector3.prototype, {
  51325. setEulerFromRotationMatrix: {
  51326. value: function() {
  51327. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51328. }
  51329. },
  51330. setEulerFromQuaternion: {
  51331. value: function() {
  51332. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51333. }
  51334. },
  51335. getPositionFromMatrix: {
  51336. value: function(e) {
  51337. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51338. this.setFromMatrixPosition(e)
  51339. }
  51340. },
  51341. getScaleFromMatrix: {
  51342. value: function(e) {
  51343. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51344. this.setFromMatrixScale(e)
  51345. }
  51346. },
  51347. getColumnFromMatrix: {
  51348. value: function(e, t) {
  51349. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51350. this.setFromMatrixColumn(e, t)
  51351. }
  51352. }
  51353. }),
  51354. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51355. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51356. new Ci.Face3(e,t,i,r,o,a)
  51357. }
  51358. ,
  51359. Ci.Vertex = function(e, t, i) {
  51360. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51361. new Ci.Vector3(e,t,i)
  51362. }
  51363. ,
  51364. Object.defineProperties(Ci.Object3D.prototype, {
  51365. eulerOrder: {
  51366. get: function() {
  51367. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51368. this.rotation.order
  51369. },
  51370. set: function(e) {
  51371. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51372. this.rotation.order = e
  51373. }
  51374. },
  51375. getChildByName: {
  51376. value: function(e) {
  51377. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51378. this.getObjectByName(e)
  51379. }
  51380. },
  51381. renderDepth: {
  51382. set: function(e) {
  51383. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51384. }
  51385. },
  51386. translate: {
  51387. value: function(e, t) {
  51388. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51389. this.translateOnAxis(t, e)
  51390. }
  51391. },
  51392. useQuaternion: {
  51393. get: function() {
  51394. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51395. },
  51396. set: function(e) {
  51397. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51398. }
  51399. }
  51400. }),
  51401. Object.defineProperties(Ci, {
  51402. PointCloud: {
  51403. value: function(e, t) {
  51404. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51405. new Ci.Points(e,t)
  51406. }
  51407. },
  51408. ParticleSystem: {
  51409. value: function(e, t) {
  51410. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51411. new Ci.Points(e,t)
  51412. }
  51413. }
  51414. }),
  51415. Object.defineProperties(Ci.Light.prototype, {
  51416. onlyShadow: {
  51417. set: function(e) {
  51418. console.warn("THREE.Light: .onlyShadow has been removed.")
  51419. }
  51420. },
  51421. shadowCameraFov: {
  51422. set: function(e) {
  51423. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51424. this.shadow.camera.fov = e
  51425. }
  51426. },
  51427. shadowCameraLeft: {
  51428. set: function(e) {
  51429. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51430. this.shadow.camera.left = e
  51431. }
  51432. },
  51433. shadowCameraRight: {
  51434. set: function(e) {
  51435. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51436. this.shadow.camera.right = e
  51437. }
  51438. },
  51439. shadowCameraTop: {
  51440. set: function(e) {
  51441. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51442. this.shadow.camera.top = e
  51443. }
  51444. },
  51445. shadowCameraBottom: {
  51446. set: function(e) {
  51447. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51448. this.shadow.camera.bottom = e
  51449. }
  51450. },
  51451. shadowCameraNear: {
  51452. set: function(e) {
  51453. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51454. this.shadow.camera.near = e
  51455. }
  51456. },
  51457. shadowCameraFar: {
  51458. set: function(e) {
  51459. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51460. this.shadow.camera.far = e
  51461. }
  51462. },
  51463. shadowCameraVisible: {
  51464. set: function(e) {
  51465. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51466. }
  51467. },
  51468. shadowBias: {
  51469. set: function(e) {
  51470. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51471. this.shadow.bias = e
  51472. }
  51473. },
  51474. shadowDarkness: {
  51475. set: function(e) {
  51476. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51477. }
  51478. },
  51479. shadowMapWidth: {
  51480. set: function(e) {
  51481. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51482. this.shadow.mapSize.width = e
  51483. }
  51484. },
  51485. shadowMapHeight: {
  51486. set: function(e) {
  51487. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51488. this.shadow.mapSize.height = e
  51489. }
  51490. }
  51491. }),
  51492. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51493. length: {
  51494. get: function() {
  51495. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51496. this.array.length
  51497. }
  51498. }
  51499. }),
  51500. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51501. drawcalls: {
  51502. get: function() {
  51503. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51504. this.groups
  51505. }
  51506. },
  51507. offsets: {
  51508. get: function() {
  51509. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51510. this.groups
  51511. }
  51512. },
  51513. addIndex: {
  51514. value: function(e) {
  51515. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51516. this.setIndex(e)
  51517. }
  51518. },
  51519. addDrawCall: {
  51520. value: function(e, t, i) {
  51521. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51522. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51523. this.addGroup(e, t)
  51524. }
  51525. },
  51526. clearDrawCalls: {
  51527. value: function() {
  51528. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51529. this.clearGroups()
  51530. }
  51531. },
  51532. computeTangents: {
  51533. value: function() {
  51534. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51535. }
  51536. },
  51537. computeOffsets: {
  51538. value: function() {
  51539. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51540. }
  51541. }
  51542. }),
  51543. Object.defineProperties(Ci.Material.prototype, {
  51544. wrapAround: {
  51545. get: function() {
  51546. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51547. },
  51548. set: function(e) {
  51549. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51550. }
  51551. },
  51552. wrapRGB: {
  51553. get: function() {
  51554. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51555. new Ci.Color
  51556. }
  51557. }
  51558. }),
  51559. Object.defineProperties(Ci, {
  51560. PointCloudMaterial: {
  51561. value: function(e) {
  51562. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51563. new Ci.PointsMaterial(e)
  51564. }
  51565. },
  51566. ParticleBasicMaterial: {
  51567. value: function(e) {
  51568. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51569. new Ci.PointsMaterial(e)
  51570. }
  51571. },
  51572. ParticleSystemMaterial: {
  51573. value: function(e) {
  51574. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51575. new Ci.PointsMaterial(e)
  51576. }
  51577. }
  51578. }),
  51579. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51580. metal: {
  51581. get: function() {
  51582. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51583. !1
  51584. },
  51585. set: function(e) {
  51586. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51587. }
  51588. }
  51589. }),
  51590. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51591. derivatives: {
  51592. get: function() {
  51593. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51594. this.extensions.derivatives
  51595. },
  51596. set: function(e) {
  51597. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51598. this.extensions.derivatives = e
  51599. }
  51600. }
  51601. }),
  51602. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51603. supportsFloatTextures: {
  51604. value: function() {
  51605. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51606. this.extensions.get("OES_texture_float")
  51607. }
  51608. },
  51609. supportsHalfFloatTextures: {
  51610. value: function() {
  51611. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51612. this.extensions.get("OES_texture_half_float")
  51613. }
  51614. },
  51615. supportsStandardDerivatives: {
  51616. value: function() {
  51617. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51618. this.extensions.get("OES_standard_derivatives")
  51619. }
  51620. },
  51621. supportsCompressedTextureS3TC: {
  51622. value: function() {
  51623. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51624. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51625. }
  51626. },
  51627. supportsCompressedTexturePVRTC: {
  51628. value: function() {
  51629. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51630. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51631. }
  51632. },
  51633. supportsBlendMinMax: {
  51634. value: function() {
  51635. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51636. this.extensions.get("EXT_blend_minmax")
  51637. }
  51638. },
  51639. supportsVertexTextures: {
  51640. value: function() {
  51641. return this.capabilities.vertexTextures
  51642. }
  51643. },
  51644. supportsInstancedArrays: {
  51645. value: function() {
  51646. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51647. this.extensions.get("ANGLE_instanced_arrays")
  51648. }
  51649. },
  51650. enableScissorTest: {
  51651. value: function(e) {
  51652. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51653. this.setScissorTest(e)
  51654. }
  51655. },
  51656. initMaterial: {
  51657. value: function() {
  51658. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51659. }
  51660. },
  51661. addPrePlugin: {
  51662. value: function() {
  51663. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51664. }
  51665. },
  51666. addPostPlugin: {
  51667. value: function() {
  51668. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51669. }
  51670. },
  51671. updateShadowMap: {
  51672. value: function() {
  51673. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51674. }
  51675. },
  51676. shadowMapEnabled: {
  51677. get: function() {
  51678. return this.shadowMap.enabled
  51679. },
  51680. set: function(e) {
  51681. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51682. this.shadowMap.enabled = e
  51683. }
  51684. },
  51685. shadowMapType: {
  51686. get: function() {
  51687. return this.shadowMap.type
  51688. },
  51689. set: function(e) {
  51690. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51691. this.shadowMap.type = e
  51692. }
  51693. },
  51694. shadowMapCullFace: {
  51695. get: function() {
  51696. return this.shadowMap.cullFace
  51697. },
  51698. set: function(e) {
  51699. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51700. this.shadowMap.cullFace = e
  51701. }
  51702. }
  51703. }),
  51704. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51705. wrapS: {
  51706. get: function() {
  51707. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51708. this.texture.wrapS
  51709. },
  51710. set: function(e) {
  51711. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51712. this.texture.wrapS = e
  51713. }
  51714. },
  51715. wrapT: {
  51716. get: function() {
  51717. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51718. this.texture.wrapT
  51719. },
  51720. set: function(e) {
  51721. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51722. this.texture.wrapT = e
  51723. }
  51724. },
  51725. magFilter: {
  51726. get: function() {
  51727. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51728. this.texture.magFilter
  51729. },
  51730. set: function(e) {
  51731. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51732. this.texture.magFilter = e
  51733. }
  51734. },
  51735. minFilter: {
  51736. get: function() {
  51737. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51738. this.texture.minFilter
  51739. },
  51740. set: function(e) {
  51741. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51742. this.texture.minFilter = e
  51743. }
  51744. },
  51745. anisotropy: {
  51746. get: function() {
  51747. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51748. this.texture.anisotropy
  51749. },
  51750. set: function(e) {
  51751. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51752. this.texture.anisotropy = e
  51753. }
  51754. },
  51755. offset: {
  51756. get: function() {
  51757. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51758. this.texture.offset
  51759. },
  51760. set: function(e) {
  51761. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51762. this.texture.offset = e
  51763. }
  51764. },
  51765. repeat: {
  51766. get: function() {
  51767. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51768. this.texture.repeat
  51769. },
  51770. set: function(e) {
  51771. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51772. this.texture.repeat = e
  51773. }
  51774. },
  51775. format: {
  51776. get: function() {
  51777. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51778. this.texture.format
  51779. },
  51780. set: function(e) {
  51781. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51782. this.texture.format = e
  51783. }
  51784. },
  51785. type: {
  51786. get: function() {
  51787. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51788. this.texture.type
  51789. },
  51790. set: function(e) {
  51791. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51792. this.texture.type = e
  51793. }
  51794. },
  51795. generateMipmaps: {
  51796. get: function() {
  51797. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51798. this.texture.generateMipmaps
  51799. },
  51800. set: function(e) {
  51801. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51802. this.texture.generateMipmaps = e
  51803. }
  51804. }
  51805. }),
  51806. Ci.GeometryUtils = {
  51807. merge: function(e, t, i) {
  51808. var n;
  51809. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51810. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51811. n = t.matrix,
  51812. t = t.geometry),
  51813. e.merge(t, n, i)
  51814. },
  51815. center: function(e) {
  51816. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51817. e.center()
  51818. }
  51819. },
  51820. Ci.ImageUtils = {
  51821. crossOrigin: void 0,
  51822. loadTexture: function(e, t, i, n) {
  51823. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51824. var r = new Ci.TextureLoader;
  51825. r.setCrossOrigin(this.crossOrigin);
  51826. var o = r.load(e, i, void 0, n);
  51827. return t && (o.mapping = t),
  51828. o
  51829. },
  51830. loadTextureCube: function(e, t, i, n) {
  51831. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51832. var r = new Ci.CubeTextureLoader;
  51833. r.setCrossOrigin(this.crossOrigin);
  51834. var o = r.load(e, i, void 0, n);
  51835. return t && (o.mapping = t),
  51836. o
  51837. },
  51838. loadCompressedTexture: function() {
  51839. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51840. },
  51841. loadCompressedTextureCube: function() {
  51842. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51843. }
  51844. },
  51845. Ci.Projector = function() {
  51846. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51847. this.projectVector = function(e, t) {
  51848. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51849. e.project(t)
  51850. }
  51851. ,
  51852. this.unprojectVector = function(e, t) {
  51853. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51854. e.unproject(t)
  51855. }
  51856. ,
  51857. this.pickingRay = function(e, t) {
  51858. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51859. }
  51860. }
  51861. ,
  51862. Ci.CanvasRenderer = function() {
  51863. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51864. this.domElement = document.createElement("canvas"),
  51865. this.clear = function() {}
  51866. ,
  51867. this.render = function() {}
  51868. ,
  51869. this.setClearColor = function() {}
  51870. ,
  51871. this.setSize = function() {}
  51872. }
  51873. ,
  51874. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51875. Ci.CurveUtils = {
  51876. tangentQuadraticBezier: function(e, t, i, n) {
  51877. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51878. },
  51879. tangentCubicBezier: function(e, t, i, n, r) {
  51880. 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
  51881. },
  51882. tangentSpline: function(e, t, i, n, r) {
  51883. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51884. },
  51885. interpolate: function(e, t, i, n, r) {
  51886. var o = .5 * (i - e)
  51887. , a = .5 * (n - t)
  51888. , s = r * r;
  51889. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51890. }
  51891. },
  51892. Ci.SceneUtils = {
  51893. createMultiMaterialObject: function(e, t) {
  51894. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51895. i.add(new Ci.Mesh(e,t[n]));
  51896. return i
  51897. },
  51898. detach: function(e, t, i) {
  51899. e.applyMatrix(t.matrixWorld),
  51900. t.remove(e),
  51901. i.add(e)
  51902. },
  51903. attach: function(e, t, i) {
  51904. var n = new Ci.Matrix4;
  51905. n.getInverse(i.matrixWorld),
  51906. e.applyMatrix(n),
  51907. t.remove(e),
  51908. i.add(e)
  51909. }
  51910. },
  51911. Ci.ShapeUtils = {
  51912. area: function(e) {
  51913. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51914. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51915. return .5 * i
  51916. },
  51917. triangulate: function(e, t) {
  51918. var i = e.length;
  51919. if (i < 3)
  51920. return null;
  51921. var n, r, o, a = [], s = [], l = [];
  51922. if (0 < Ci.ShapeUtils.area(e))
  51923. for (r = 0; r < i; r++)
  51924. s[r] = r;
  51925. else
  51926. for (r = 0; r < i; r++)
  51927. s[r] = i - 1 - r;
  51928. var c = i
  51929. , h = 2 * c;
  51930. for (r = c - 1; 2 < c; ) {
  51931. if (h-- <= 0)
  51932. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51933. t ? l : a;
  51934. if (c <= (n = r) && (n = 0),
  51935. c <= (r = n + 1) && (r = 0),
  51936. c <= (o = r + 1) && (o = 0),
  51937. Si(e, n, r, o, c, s)) {
  51938. var u, d, p, f, g;
  51939. for (u = s[n],
  51940. d = s[r],
  51941. p = s[o],
  51942. a.push([e[u], e[d], e[p]]),
  51943. l.push([s[n], s[r], s[o]]),
  51944. g = (f = r) + 1; g < c; f++,
  51945. g++)
  51946. s[f] = s[g];
  51947. h = 2 * --c
  51948. }
  51949. }
  51950. return t ? l : a
  51951. },
  51952. triangulateShape: function(e, t) {
  51953. function w(e, t, i) {
  51954. 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
  51955. }
  51956. function b(e, t, i, n, r) {
  51957. var o = t.x - e.x
  51958. , a = t.y - e.y
  51959. , s = n.x - i.x
  51960. , l = n.y - i.y
  51961. , c = e.x - i.x
  51962. , h = e.y - i.y
  51963. , u = a * s - o * l
  51964. , d = a * c - o * h;
  51965. if (Math.abs(u) > Number.EPSILON) {
  51966. var p;
  51967. if (0 < u) {
  51968. if (d < 0 || u < d)
  51969. return [];
  51970. if ((p = l * c - s * h) < 0 || u < p)
  51971. return []
  51972. } else {
  51973. if (0 < d || d < u)
  51974. return [];
  51975. if (0 < (p = l * c - s * h) || p < u)
  51976. return []
  51977. }
  51978. if (0 === p)
  51979. return !r || 0 != d && d != u ? [e] : [];
  51980. if (p === u)
  51981. return !r || 0 != d && d != u ? [t] : [];
  51982. if (0 == d)
  51983. return [i];
  51984. if (d == u)
  51985. return [n];
  51986. var f = p / u;
  51987. return [{
  51988. x: e.x + f * o,
  51989. y: e.y + f * a
  51990. }]
  51991. }
  51992. if (0 != d || l * c != s * h)
  51993. return [];
  51994. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51995. 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,
  51996. (m = t).x) : (v = (g = t).x,
  51997. (m = e).x),
  51998. i.x < n.x ? (I = (A = i).x,
  51999. (C = n).x) : (I = (A = n).x,
  52000. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52001. (m = t).y) : (v = (g = t).y,
  52002. (m = e).y),
  52003. i.y < n.y ? (I = (A = i).y,
  52004. (C = n).y) : (I = (A = n).y,
  52005. (C = i).y)),
  52006. 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])
  52007. }
  52008. function T(e, t, i, n) {
  52009. var r = t.x - e.x
  52010. , o = t.y - e.y
  52011. , a = i.x - e.x
  52012. , s = i.y - e.y
  52013. , l = n.x - e.x
  52014. , c = n.y - e.y
  52015. , h = r * s - o * a
  52016. , u = r * c - o * l;
  52017. if (Math.abs(h) > Number.EPSILON) {
  52018. var d = l * s - c * a;
  52019. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52020. }
  52021. return 0 < u
  52022. }
  52023. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52024. Array.prototype.push.apply(c, t[h]);
  52025. for (i = 0,
  52026. n = c.length; i < n; i++)
  52027. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52028. l[a] = i;
  52029. var d = function(e, a) {
  52030. function t(e, t) {
  52031. var i = m.length - 1
  52032. , n = e - 1;
  52033. n < 0 && (n = i);
  52034. var r = e + 1;
  52035. i < r && (r = 0);
  52036. var o = T(m[e], m[n], m[r], c[t]);
  52037. if (!o)
  52038. return !1;
  52039. var a = c.length - 1
  52040. , s = t - 1;
  52041. s < 0 && (s = a);
  52042. var l = t + 1;
  52043. return a < l && (l = 0),
  52044. !!(o = T(c[t], c[s], c[l], m[e]))
  52045. }
  52046. function i(e, t) {
  52047. var i, n;
  52048. for (i = 0; i < m.length; i++)
  52049. if (n = i + 1,
  52050. n %= m.length,
  52051. 0 < b(e, t, m[i], m[n], !0).length)
  52052. return !0;
  52053. return !1
  52054. }
  52055. function n(e, t) {
  52056. var i, n, r, o;
  52057. for (i = 0; i < v.length; i++)
  52058. for (n = a[v[i]],
  52059. r = 0; r < n.length; r++)
  52060. if (o = r + 1,
  52061. o %= n.length,
  52062. 0 < b(e, t, n[r], n[o], !0).length)
  52063. return !0;
  52064. return !1
  52065. }
  52066. 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++)
  52067. v.push(A);
  52068. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52069. if (--E < 0) {
  52070. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52071. break
  52072. }
  52073. for (o = I; o < m.length; o++) {
  52074. s = m[o],
  52075. r = -1;
  52076. for (A = 0; A < v.length; A++)
  52077. if (h = v[A],
  52078. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52079. c = a[h];
  52080. for (var _ = 0; _ < c.length; _++)
  52081. if (l = c[_],
  52082. t(o, _) && !i(s, l) && !n(s, l)) {
  52083. r = _,
  52084. v.splice(A, 1),
  52085. d = m.slice(0, o + 1),
  52086. p = m.slice(o),
  52087. f = c.slice(r),
  52088. g = c.slice(0, r + 1),
  52089. m = d.concat(f).concat(g).concat(p),
  52090. I = o;
  52091. break
  52092. }
  52093. if (0 <= r)
  52094. break;
  52095. y[u] = !0
  52096. }
  52097. if (0 <= r)
  52098. break
  52099. }
  52100. }
  52101. return m
  52102. }(e, t)
  52103. , p = Ci.ShapeUtils.triangulate(d, !1);
  52104. for (i = 0,
  52105. n = p.length; i < n; i++)
  52106. for (o = p[i],
  52107. r = 0; r < 3; r++)
  52108. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52109. return p.concat()
  52110. },
  52111. isClockWise: function(e) {
  52112. return Ci.ShapeUtils.area(e) < 0
  52113. },
  52114. b2: function(e, t, i, n) {
  52115. return function(e, t) {
  52116. var i = 1 - e;
  52117. return i * i * t
  52118. }(e, t) + function(e, t) {
  52119. return 2 * (1 - e) * e * t
  52120. }(e, i) + function(e, t) {
  52121. return e * e * t
  52122. }(e, n)
  52123. },
  52124. b3: function(e, t, i, n, r) {
  52125. return function(e, t) {
  52126. var i = 1 - e;
  52127. return i * i * i * t
  52128. }(e, t) + function(e, t) {
  52129. var i = 1 - e;
  52130. return 3 * i * i * e * t
  52131. }(e, i) + function(e, t) {
  52132. return 3 * (1 - e) * e * e * t
  52133. }(e, n) + function(e, t) {
  52134. return e * e * e * t
  52135. }(e, r)
  52136. }
  52137. },
  52138. Ci.Curve = function() {}
  52139. ,
  52140. Ci.Curve.prototype = {
  52141. constructor: Ci.Curve,
  52142. getPoint: function(e) {
  52143. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52144. null
  52145. },
  52146. getPointAt: function(e) {
  52147. var t = this.getUtoTmapping(e);
  52148. return this.getPoint(t)
  52149. },
  52150. getPoints: function(e) {
  52151. e = e || 5;
  52152. var t, i = [];
  52153. for (t = 0; t <= e; t++)
  52154. i.push(this.getPoint(t / e));
  52155. return i
  52156. },
  52157. getSpacedPoints: function(e) {
  52158. e = e || 5;
  52159. var t, i = [];
  52160. for (t = 0; t <= e; t++)
  52161. i.push(this.getPointAt(t / e));
  52162. return i
  52163. },
  52164. getLength: function() {
  52165. var e = this.getLengths();
  52166. return e[e.length - 1]
  52167. },
  52168. getLengths: function(e) {
  52169. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52170. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52171. return this.cacheArcLengths;
  52172. this.needsUpdate = !1;
  52173. var t, i, n = [], r = this.getPoint(0), o = 0;
  52174. for (n.push(0),
  52175. i = 1; i <= e; i++)
  52176. o += (t = this.getPoint(i / e)).distanceTo(r),
  52177. n.push(o),
  52178. r = t;
  52179. return this.cacheArcLengths = n
  52180. },
  52181. updateArcLengths: function() {
  52182. this.needsUpdate = !0,
  52183. this.getLengths()
  52184. },
  52185. getUtoTmapping: function(e, t) {
  52186. var i, n = this.getLengths(), r = 0, o = n.length;
  52187. i = t || e * n[o - 1];
  52188. for (var a, s = 0, l = o - 1; s <= l; )
  52189. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52190. s = r + 1;
  52191. else {
  52192. if (!(0 < a)) {
  52193. l = r;
  52194. break
  52195. }
  52196. l = r - 1
  52197. }
  52198. if (n[r = l] === i)
  52199. return r / (o - 1);
  52200. var c = n[r];
  52201. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52202. },
  52203. getTangent: function(e) {
  52204. var t = e - 1e-4
  52205. , i = e + 1e-4;
  52206. t < 0 && (t = 0),
  52207. 1 < i && (i = 1);
  52208. var n = this.getPoint(t);
  52209. return this.getPoint(i).clone().sub(n).normalize()
  52210. },
  52211. getTangentAt: function(e) {
  52212. var t = this.getUtoTmapping(e);
  52213. return this.getTangent(t)
  52214. }
  52215. },
  52216. Ci.Curve.create = function(e, t) {
  52217. return e.prototype = Object.create(Ci.Curve.prototype),
  52218. (e.prototype.constructor = e).prototype.getPoint = t,
  52219. e
  52220. }
  52221. ,
  52222. Ci.CurvePath = function() {
  52223. this.curves = [],
  52224. this.autoClose = !1
  52225. }
  52226. ,
  52227. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52228. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52229. Ci.CurvePath.prototype.add = function(e) {
  52230. this.curves.push(e)
  52231. }
  52232. ,
  52233. Ci.CurvePath.prototype.closePath = function() {
  52234. var e = this.curves[0].getPoint(0)
  52235. , t = this.curves[this.curves.length - 1].getPoint(1);
  52236. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52237. }
  52238. ,
  52239. Ci.CurvePath.prototype.getPoint = function(e) {
  52240. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52241. if (i[n] >= t) {
  52242. var r = i[n] - t
  52243. , o = this.curves[n]
  52244. , a = 1 - r / o.getLength();
  52245. return o.getPointAt(a)
  52246. }
  52247. n++
  52248. }
  52249. return null
  52250. }
  52251. ,
  52252. Ci.CurvePath.prototype.getLength = function() {
  52253. var e = this.getCurveLengths();
  52254. return e[e.length - 1]
  52255. }
  52256. ,
  52257. Ci.CurvePath.prototype.getCurveLengths = function() {
  52258. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52259. return this.cacheLengths;
  52260. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52261. t += this.curves[i].getLength(),
  52262. e.push(t);
  52263. return this.cacheLengths = e
  52264. }
  52265. ,
  52266. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52267. var t = this.getPoints(e);
  52268. return this.createGeometry(t)
  52269. }
  52270. ,
  52271. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52272. var t = this.getSpacedPoints(e);
  52273. return this.createGeometry(t)
  52274. }
  52275. ,
  52276. Ci.CurvePath.prototype.createGeometry = function(e) {
  52277. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52278. var r = e[i];
  52279. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52280. }
  52281. return t
  52282. }
  52283. ,
  52284. Ci.Font = function(e) {
  52285. this.data = e
  52286. }
  52287. ,
  52288. Ci.Font.prototype = {
  52289. constructor: Ci.Font,
  52290. generateShapes: function(e, s, b) {
  52291. function l(e, t, i) {
  52292. var n = w.glyphs[e] || w.glyphs["?"];
  52293. if (n) {
  52294. 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;
  52295. if (n.o)
  52296. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52297. switch (A[C++]) {
  52298. case "m":
  52299. r = A[C++] * t + i,
  52300. o = A[C++] * t,
  52301. g.moveTo(r, o);
  52302. break;
  52303. case "l":
  52304. r = A[C++] * t + i,
  52305. o = A[C++] * t,
  52306. g.lineTo(r, o);
  52307. break;
  52308. case "q":
  52309. if (a = A[C++] * t + i,
  52310. s = A[C++] * t,
  52311. h = A[C++] * t + i,
  52312. u = A[C++] * t,
  52313. g.quadraticCurveTo(h, u, a, s),
  52314. f = m[m.length - 1]) {
  52315. l = f.x,
  52316. c = f.y;
  52317. for (var E = 1; E <= b; E++) {
  52318. v(_ = E / b, l, h, a),
  52319. v(_, c, u, s)
  52320. }
  52321. }
  52322. break;
  52323. case "b":
  52324. if (a = A[C++] * t + i,
  52325. s = A[C++] * t,
  52326. h = A[C++] * t + i,
  52327. u = A[C++] * t,
  52328. d = A[C++] * t + i,
  52329. p = A[C++] * t,
  52330. g.bezierCurveTo(h, u, d, p, a, s),
  52331. f = m[m.length - 1]) {
  52332. l = f.x,
  52333. c = f.y;
  52334. for (E = 1; E <= b; E++) {
  52335. var _;
  52336. y(_ = E / b, l, h, d, a),
  52337. y(_, c, u, p, s)
  52338. }
  52339. }
  52340. }
  52341. }
  52342. return {
  52343. offset: n.ha * t,
  52344. path: g
  52345. }
  52346. }
  52347. }
  52348. void 0 === s && (s = 100),
  52349. void 0 === b && (b = 4);
  52350. for (var w = this.data, t = function(e) {
  52351. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52352. var a = l(t[o], i, n);
  52353. n += a.offset,
  52354. r.push(a.path)
  52355. }
  52356. return r
  52357. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52358. Array.prototype.push.apply(i, t[n].toShapes());
  52359. return i
  52360. }
  52361. },
  52362. Ci.Path = function(e) {
  52363. Ci.CurvePath.call(this),
  52364. this.actions = [],
  52365. e && this.fromPoints(e)
  52366. }
  52367. ,
  52368. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52369. Ci.Path.prototype.constructor = Ci.Path,
  52370. Ci.Path.prototype.fromPoints = function(e) {
  52371. this.moveTo(e[0].x, e[0].y);
  52372. for (var t = 1, i = e.length; t < i; t++)
  52373. this.lineTo(e[t].x, e[t].y)
  52374. }
  52375. ,
  52376. Ci.Path.prototype.moveTo = function(e, t) {
  52377. this.actions.push({
  52378. action: "moveTo",
  52379. args: [e, t]
  52380. })
  52381. }
  52382. ,
  52383. Ci.Path.prototype.lineTo = function(e, t) {
  52384. var i = this.actions[this.actions.length - 1].args
  52385. , n = i[i.length - 2]
  52386. , r = i[i.length - 1]
  52387. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52388. this.curves.push(o),
  52389. this.actions.push({
  52390. action: "lineTo",
  52391. args: [e, t]
  52392. })
  52393. }
  52394. ,
  52395. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52396. var r = this.actions[this.actions.length - 1].args
  52397. , o = r[r.length - 2]
  52398. , a = r[r.length - 1]
  52399. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52400. this.curves.push(s),
  52401. this.actions.push({
  52402. action: "quadraticCurveTo",
  52403. args: [e, t, i, n]
  52404. })
  52405. }
  52406. ,
  52407. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52408. var a = this.actions[this.actions.length - 1].args
  52409. , s = a[a.length - 2]
  52410. , l = a[a.length - 1]
  52411. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52412. this.curves.push(c),
  52413. this.actions.push({
  52414. action: "bezierCurveTo",
  52415. args: [e, t, i, n, r, o]
  52416. })
  52417. }
  52418. ,
  52419. Ci.Path.prototype.splineThru = function(e) {
  52420. var t = Array.prototype.slice.call(arguments)
  52421. , i = this.actions[this.actions.length - 1].args
  52422. , n = i[i.length - 2]
  52423. , r = i[i.length - 1]
  52424. , o = [new Ci.Vector2(n,r)];
  52425. Array.prototype.push.apply(o, e);
  52426. var a = new Ci.SplineCurve(o);
  52427. this.curves.push(a),
  52428. this.actions.push({
  52429. action: "splineThru",
  52430. args: t
  52431. })
  52432. }
  52433. ,
  52434. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52435. var a = this.actions[this.actions.length - 1].args
  52436. , s = a[a.length - 2]
  52437. , l = a[a.length - 1];
  52438. this.absarc(e + s, t + l, i, n, r, o)
  52439. }
  52440. ,
  52441. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52442. this.absellipse(e, t, i, i, n, r, o)
  52443. }
  52444. ,
  52445. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52446. var l = this.actions[this.actions.length - 1].args
  52447. , c = l[l.length - 2]
  52448. , h = l[l.length - 1];
  52449. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52450. }
  52451. ,
  52452. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52453. var l = [e, t, i, n, r, o, a, s || 0]
  52454. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52455. this.curves.push(c);
  52456. var h = c.getPoint(1);
  52457. l.push(h.x),
  52458. l.push(h.y),
  52459. this.actions.push({
  52460. action: "ellipse",
  52461. args: l
  52462. })
  52463. }
  52464. ,
  52465. Ci.Path.prototype.getSpacedPoints = function(e) {
  52466. e = e || 40;
  52467. for (var t = [], i = 0; i < e; i++)
  52468. t.push(this.getPoint(i / e));
  52469. return this.autoClose && t.push(t[0]),
  52470. t
  52471. }
  52472. ,
  52473. Ci.Path.prototype.getPoints = function(e) {
  52474. e = e || 12;
  52475. 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++) {
  52476. var v = this.actions[g]
  52477. , y = v.action
  52478. , A = v.args;
  52479. switch (y) {
  52480. case "moveTo":
  52481. case "lineTo":
  52482. f.push(new Ci.Vector2(A[0],A[1]));
  52483. break;
  52484. case "quadraticCurveTo":
  52485. t = A[2],
  52486. i = A[3],
  52487. o = A[0],
  52488. a = A[1],
  52489. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52490. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52491. c[c.length - 1]);
  52492. for (var C = 1; C <= e; C++) {
  52493. h = d(O = C / e, s, o, t),
  52494. u = d(O, l, a, i),
  52495. f.push(new Ci.Vector2(h,u))
  52496. }
  52497. break;
  52498. case "bezierCurveTo":
  52499. t = A[4],
  52500. i = A[5],
  52501. o = A[0],
  52502. a = A[1],
  52503. n = A[2],
  52504. r = A[3],
  52505. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52506. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52507. c[c.length - 1]);
  52508. for (C = 1; C <= e; C++) {
  52509. h = p(O = C / e, s, o, n, t),
  52510. u = p(O, l, a, r, i),
  52511. f.push(new Ci.Vector2(h,u))
  52512. }
  52513. break;
  52514. case "splineThru":
  52515. c = this.actions[g - 1].args;
  52516. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52517. , E = e * A[0].length;
  52518. I = I.concat(A[0]);
  52519. var _ = new Ci.SplineCurve(I);
  52520. for (C = 1; C <= E; C++)
  52521. f.push(_.getPointAt(C / E));
  52522. break;
  52523. case "arc":
  52524. var b = A[0]
  52525. , w = A[1]
  52526. , T = A[2]
  52527. , x = A[3]
  52528. , S = A[4]
  52529. , M = !!A[5]
  52530. , R = S - x
  52531. , P = 2 * e;
  52532. for (C = 1; C <= P; C++) {
  52533. var O = C / P;
  52534. M || (O = 1 - O),
  52535. L = x + O * R,
  52536. h = b + T * Math.cos(L),
  52537. u = w + T * Math.sin(L),
  52538. f.push(new Ci.Vector2(h,u))
  52539. }
  52540. break;
  52541. case "ellipse":
  52542. b = A[0],
  52543. w = A[1];
  52544. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52545. S = A[5],
  52546. M = !!A[6],
  52547. A[7]);
  52548. R = S - x,
  52549. P = 2 * e;
  52550. 0 !== V && (D = Math.cos(V),
  52551. N = Math.sin(V));
  52552. for (C = 1; C <= P; C++) {
  52553. O = C / P;
  52554. if (M || (O = 1 - O),
  52555. L = x + O * R,
  52556. h = b + F * Math.cos(L),
  52557. u = w + B * Math.sin(L),
  52558. 0 !== V) {
  52559. var k = h;
  52560. h = (k - b) * D - (u - w) * N + b,
  52561. u = (k - b) * N + (u - w) * D + w
  52562. }
  52563. f.push(new Ci.Vector2(h,u))
  52564. }
  52565. }
  52566. }
  52567. var U = f[f.length - 1];
  52568. 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),
  52569. this.autoClose && f.push(f[0]),
  52570. f
  52571. }
  52572. ,
  52573. Ci.Path.prototype.toShapes = function(e, t) {
  52574. function i(e) {
  52575. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52576. var r = e[i]
  52577. , o = new Ci.Shape;
  52578. o.actions = r.actions,
  52579. o.curves = r.curves,
  52580. t.push(o)
  52581. }
  52582. return t
  52583. }
  52584. function n(e, t) {
  52585. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52586. var a = t[r]
  52587. , s = t[o]
  52588. , l = s.x - a.x
  52589. , c = s.y - a.y;
  52590. if (Math.abs(c) > Number.EPSILON) {
  52591. if (c < 0 && (a = t[o],
  52592. l = -l,
  52593. s = t[r],
  52594. c = -c),
  52595. e.y < a.y || e.y > s.y)
  52596. continue;
  52597. if (e.y === a.y) {
  52598. if (e.x === a.x)
  52599. return !0
  52600. } else {
  52601. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52602. if (0 == h)
  52603. return !0;
  52604. if (h < 0)
  52605. continue;
  52606. n = !n
  52607. }
  52608. } else {
  52609. if (e.y !== a.y)
  52610. continue;
  52611. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52612. return !0
  52613. }
  52614. }
  52615. return n
  52616. }
  52617. var r = Ci.ShapeUtils.isClockWise
  52618. , o = function(e) {
  52619. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52620. var o = e[n]
  52621. , a = o.args
  52622. , s = o.action;
  52623. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52624. i = new Ci.Path),
  52625. i[s].apply(i, a)
  52626. }
  52627. return 0 !== i.actions.length && t.push(i),
  52628. t
  52629. }(this.actions);
  52630. if (0 === o.length)
  52631. return [];
  52632. if (!0 === t)
  52633. return i(o);
  52634. var a, s, l, c = [];
  52635. if (1 === o.length)
  52636. return s = o[0],
  52637. (l = new Ci.Shape).actions = s.actions,
  52638. l.curves = s.curves,
  52639. c.push(l),
  52640. c;
  52641. var h = !r(o[0].getPoints());
  52642. h = e ? !h : h;
  52643. var u, d = [], p = [], f = [], g = 0;
  52644. p[g] = void 0,
  52645. f[g] = [];
  52646. for (var m = 0, v = o.length; m < v; m++)
  52647. a = r(u = (s = o[m]).getPoints()),
  52648. (a = e ? !a : a) ? (!h && p[g] && g++,
  52649. p[g] = {
  52650. s: new Ci.Shape,
  52651. p: u
  52652. },
  52653. p[g].s.actions = s.actions,
  52654. p[g].s.curves = s.curves,
  52655. h && g++,
  52656. f[g] = []) : f[g].push({
  52657. h: s,
  52658. p: u[0]
  52659. });
  52660. if (!p[0])
  52661. return i(o);
  52662. if (1 < p.length) {
  52663. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52664. d[C] = [];
  52665. for (C = 0,
  52666. I = p.length; C < I; C++)
  52667. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52668. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52669. n(b.p, p[T].p) && (C !== T && A.push({
  52670. froms: C,
  52671. tos: T,
  52672. hole: _
  52673. }),
  52674. w ? (w = !1,
  52675. d[T].push(b)) : y = !0);
  52676. w && d[C].push(b)
  52677. }
  52678. 0 < A.length && (y || (f = d))
  52679. }
  52680. m = 0;
  52681. for (var x, S = p.length; m < S; m++) {
  52682. l = p[m].s,
  52683. c.push(l);
  52684. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52685. l.holes.push(x[M].h)
  52686. }
  52687. return c
  52688. }
  52689. ,
  52690. Ci.Shape = function() {
  52691. Ci.Path.apply(this, arguments),
  52692. this.holes = []
  52693. }
  52694. ,
  52695. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52696. Ci.Shape.prototype.constructor = Ci.Shape,
  52697. Ci.Shape.prototype.extrude = function(e) {
  52698. return new Ci.ExtrudeGeometry(this,e)
  52699. }
  52700. ,
  52701. Ci.Shape.prototype.makeGeometry = function(e) {
  52702. return new Ci.ShapeGeometry(this,e)
  52703. }
  52704. ,
  52705. Ci.Shape.prototype.getPointsHoles = function(e) {
  52706. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52707. t[i] = this.holes[i].getPoints(e);
  52708. return t
  52709. }
  52710. ,
  52711. Ci.Shape.prototype.extractAllPoints = function(e) {
  52712. return {
  52713. shape: this.getPoints(e),
  52714. holes: this.getPointsHoles(e)
  52715. }
  52716. }
  52717. ,
  52718. Ci.Shape.prototype.extractPoints = function(e) {
  52719. return this.extractAllPoints(e)
  52720. }
  52721. ,
  52722. Ci.LineCurve = function(e, t) {
  52723. this.v1 = e,
  52724. this.v2 = t
  52725. }
  52726. ,
  52727. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52728. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52729. Ci.LineCurve.prototype.getPoint = function(e) {
  52730. var t = this.v2.clone().sub(this.v1);
  52731. return t.multiplyScalar(e).add(this.v1),
  52732. t
  52733. }
  52734. ,
  52735. Ci.LineCurve.prototype.getPointAt = function(e) {
  52736. return this.getPoint(e)
  52737. }
  52738. ,
  52739. Ci.LineCurve.prototype.getTangent = function(e) {
  52740. return this.v2.clone().sub(this.v1).normalize()
  52741. }
  52742. ,
  52743. Ci.QuadraticBezierCurve = function(e, t, i) {
  52744. this.v0 = e,
  52745. this.v1 = t,
  52746. this.v2 = i
  52747. }
  52748. ,
  52749. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52750. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52751. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52752. var t = Ci.ShapeUtils.b2;
  52753. 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))
  52754. }
  52755. ,
  52756. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52757. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52758. 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()
  52759. }
  52760. ,
  52761. Ci.CubicBezierCurve = function(e, t, i, n) {
  52762. this.v0 = e,
  52763. this.v1 = t,
  52764. this.v2 = i,
  52765. this.v3 = n
  52766. }
  52767. ,
  52768. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52769. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52770. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52771. var t = Ci.ShapeUtils.b3;
  52772. 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))
  52773. }
  52774. ,
  52775. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52776. var t = Ci.CurveUtils.tangentCubicBezier;
  52777. 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()
  52778. }
  52779. ,
  52780. Ci.SplineCurve = function(e) {
  52781. this.points = null == e ? [] : e
  52782. }
  52783. ,
  52784. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52785. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52786. Ci.SplineCurve.prototype.getPoint = function(e) {
  52787. var t = this.points
  52788. , i = (t.length - 1) * e
  52789. , n = Math.floor(i)
  52790. , r = i - n
  52791. , o = t[0 === n ? n : n - 1]
  52792. , a = t[n]
  52793. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52794. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52795. , c = Ci.CurveUtils.interpolate;
  52796. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52797. }
  52798. ,
  52799. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52800. this.aX = e,
  52801. this.aY = t,
  52802. this.xRadius = i,
  52803. this.yRadius = n,
  52804. this.aStartAngle = r,
  52805. this.aEndAngle = o,
  52806. this.aClockwise = a,
  52807. this.aRotation = s || 0
  52808. }
  52809. ,
  52810. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52811. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52812. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52813. var t, i = this.aEndAngle - this.aStartAngle;
  52814. i < 0 && (i += 2 * Math.PI),
  52815. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52816. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52817. var n = this.aX + this.xRadius * Math.cos(t)
  52818. , r = this.aY + this.yRadius * Math.sin(t);
  52819. if (0 !== this.aRotation) {
  52820. var o = Math.cos(this.aRotation)
  52821. , a = Math.sin(this.aRotation)
  52822. , s = n
  52823. , l = r;
  52824. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52825. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52826. }
  52827. return new Ci.Vector2(n,r)
  52828. }
  52829. ,
  52830. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52831. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52832. }
  52833. ,
  52834. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52835. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52836. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52837. this.v1 = e,
  52838. this.v2 = t
  52839. }, function(e) {
  52840. var t = new Ci.Vector3;
  52841. return t.subVectors(this.v2, this.v1),
  52842. t.multiplyScalar(e),
  52843. t.add(this.v1),
  52844. t
  52845. }),
  52846. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52847. this.v0 = e,
  52848. this.v1 = t,
  52849. this.v2 = i
  52850. }, function(e) {
  52851. var t = Ci.ShapeUtils.b2;
  52852. 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))
  52853. }),
  52854. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52855. this.v0 = e,
  52856. this.v1 = t,
  52857. this.v2 = i,
  52858. this.v3 = n
  52859. }, function(e) {
  52860. var t = Ci.ShapeUtils.b3;
  52861. 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))
  52862. }),
  52863. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52864. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52865. this.points = null == e ? [] : e
  52866. }, function(e) {
  52867. var t = this.points
  52868. , i = (t.length - 1) * e
  52869. , n = Math.floor(i)
  52870. , r = i - n
  52871. , o = t[0 == n ? n : n - 1]
  52872. , a = t[n]
  52873. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52874. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52875. , c = Ci.CurveUtils.interpolate;
  52876. 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))
  52877. }),
  52878. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52879. Xt = new xi,
  52880. Zt = new xi,
  52881. Kt = new xi,
  52882. xi.prototype.init = function(e, t, i, n) {
  52883. this.c0 = e,
  52884. this.c1 = i,
  52885. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52886. this.c3 = 2 * e - 2 * t + i + n
  52887. }
  52888. ,
  52889. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52890. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52891. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52892. s *= o,
  52893. l *= o,
  52894. this.init(t, i, s, l)
  52895. }
  52896. ,
  52897. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52898. this.init(t, i, r * (i - e), r * (n - t))
  52899. }
  52900. ,
  52901. xi.prototype.calc = function(e) {
  52902. var t = e * e
  52903. , i = t * e;
  52904. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52905. }
  52906. ,
  52907. Ci.Curve.create(function(e) {
  52908. this.points = e || [],
  52909. this.closed = !1
  52910. }, function(e) {
  52911. var t, i, n, r, o, a, s, l, c = this.points;
  52912. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52913. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52914. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52915. n = 1),
  52916. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52917. qt),
  52918. a = c[i % r],
  52919. s = c[(i + 1) % r],
  52920. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52921. qt),
  52922. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52923. var h = "chordal" === this.type ? .5 : .25
  52924. , u = Math.pow(o.distanceToSquared(a), h)
  52925. , d = Math.pow(a.distanceToSquared(s), h)
  52926. , p = Math.pow(s.distanceToSquared(l), h);
  52927. d < 1e-4 && (d = 1),
  52928. u < 1e-4 && (u = d),
  52929. p < 1e-4 && (p = d),
  52930. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52931. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52932. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52933. } else if ("catmullrom" === this.type) {
  52934. var f = void 0 !== this.tension ? this.tension : .5;
  52935. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52936. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52937. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52938. }
  52939. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52940. })),
  52941. Ci.ClosedSplineCurve3 = function(e) {
  52942. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52943. Ci.CatmullRomCurve3.call(this, e),
  52944. this.type = "catmullrom",
  52945. this.closed = !0
  52946. }
  52947. ,
  52948. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52949. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52950. Ci.Geometry.call(this),
  52951. this.type = "BoxGeometry",
  52952. this.parameters = {
  52953. width: e,
  52954. height: t,
  52955. depth: i,
  52956. widthSegments: n,
  52957. heightSegments: r,
  52958. depthSegments: o
  52959. },
  52960. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52961. this.mergeVertices()
  52962. }
  52963. ,
  52964. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52965. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52966. Ci.CubeGeometry = Ci.BoxGeometry,
  52967. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52968. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52969. 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++)
  52970. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52971. var b = _ * u - p;
  52972. C[e] = b * n,
  52973. C[t] = E * r,
  52974. C[i] = g,
  52975. P[D] = C.x,
  52976. P[D + 1] = C.y,
  52977. P[D + 2] = C.z,
  52978. C[e] = 0,
  52979. C[t] = 0,
  52980. C[i] = 0 < s ? 1 : -1,
  52981. O[D] = C.x,
  52982. O[D + 1] = C.y,
  52983. O[D + 2] = C.z,
  52984. L[N] = _ / l,
  52985. L[N + 1] = 1 - I / c,
  52986. D += 3,
  52987. N += 2,
  52988. y += 1
  52989. }
  52990. for (I = 0; I < c; I++)
  52991. for (_ = 0; _ < l; _++) {
  52992. var w = B + _ + m * I
  52993. , T = B + _ + m * (I + 1)
  52994. , x = B + (_ + 1) + m * (I + 1)
  52995. , S = B + (_ + 1) + m * I;
  52996. R[F] = w,
  52997. R[F + 1] = T,
  52998. R[F + 2] = S,
  52999. R[F + 3] = T,
  53000. R[F + 4] = x,
  53001. R[F + 5] = S,
  53002. F += 6,
  53003. A += 6
  53004. }
  53005. M.addGroup(V, A, h),
  53006. V += A,
  53007. B += y
  53008. }
  53009. Ci.BufferGeometry.call(this),
  53010. this.type = "BoxBufferGeometry",
  53011. this.parameters = {
  53012. width: e,
  53013. height: t,
  53014. depth: i,
  53015. widthSegments: n,
  53016. heightSegments: r,
  53017. depthSegments: o
  53018. };
  53019. var M = this;
  53020. n = Math.floor(n) || 1,
  53021. r = Math.floor(r) || 1,
  53022. o = Math.floor(o) || 1;
  53023. var s, l, c, h, u = (h = 0,
  53024. h += (s = n) * (l = r) * 2,
  53025. h += s * (c = o) * 2,
  53026. 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;
  53027. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53028. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53029. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53030. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53031. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53032. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53033. this.setIndex(new Ci.BufferAttribute(R,1)),
  53034. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53035. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53036. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53037. }
  53038. ,
  53039. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53040. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53041. Ci.CircleGeometry = function(e, t, i, n) {
  53042. Ci.Geometry.call(this),
  53043. this.type = "CircleGeometry",
  53044. this.parameters = {
  53045. radius: e,
  53046. segments: t,
  53047. thetaStart: i,
  53048. thetaLength: n
  53049. },
  53050. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53051. }
  53052. ,
  53053. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53054. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53055. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53056. Ci.BufferGeometry.call(this),
  53057. this.type = "CircleBufferGeometry",
  53058. this.parameters = {
  53059. radius: e,
  53060. segments: t,
  53061. thetaStart: i,
  53062. thetaLength: n
  53063. },
  53064. e = e || 50,
  53065. t = void 0 !== t ? Math.max(3, t) : 8,
  53066. i = void 0 !== i ? i : 0,
  53067. n = void 0 !== n ? n : 2 * Math.PI;
  53068. var r = t + 2
  53069. , o = new Float32Array(3 * r)
  53070. , a = new Float32Array(3 * r)
  53071. , s = new Float32Array(2 * r);
  53072. a[2] = 1,
  53073. s[0] = .5,
  53074. s[1] = .5;
  53075. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53076. c += 3,
  53077. h += 2) {
  53078. var u = i + l / t * n;
  53079. o[c] = e * Math.cos(u),
  53080. o[c + 1] = e * Math.sin(u),
  53081. a[c + 2] = 1,
  53082. s[h] = (o[c] / e + 1) / 2,
  53083. s[h + 1] = (o[c + 1] / e + 1) / 2
  53084. }
  53085. var d = [];
  53086. for (c = 1; c <= t; c++)
  53087. d.push(c, c + 1, 0);
  53088. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53089. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53090. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53091. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53092. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53093. }
  53094. ,
  53095. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53096. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53097. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53098. function t(e) {
  53099. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53100. for (i = b,
  53101. t = 1; t <= m; t++)
  53102. I.setXYZ(b, 0, x * s, 0),
  53103. E.setXYZ(b, 0, s, 0),
  53104. !0 === e ? (r.x = t / m,
  53105. r.y = 0) : (r.x = (t - 1) / m,
  53106. r.y = 1),
  53107. _.setXY(b, r.x, r.y),
  53108. b++;
  53109. for (n = b,
  53110. t = 0; t <= m; t++) {
  53111. var l = t / m;
  53112. o.x = a * Math.sin(l * A + y),
  53113. o.y = x * s,
  53114. o.z = a * Math.cos(l * A + y),
  53115. I.setXYZ(b, o.x, o.y, o.z),
  53116. E.setXYZ(b, 0, s, 0),
  53117. _.setXY(b, l, !0 === e ? 1 : 0),
  53118. b++
  53119. }
  53120. for (t = 0; t < m; t++) {
  53121. var c = i + t
  53122. , h = n + t;
  53123. !0 === e ? (C.setX(w, h),
  53124. w++,
  53125. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53126. w++,
  53127. C.setX(w, h)),
  53128. w++,
  53129. C.setX(w, c),
  53130. w++
  53131. }
  53132. }
  53133. Ci.BufferGeometry.call(this),
  53134. this.type = "CylinderBufferGeometry",
  53135. this.parameters = {
  53136. radiusTop: p,
  53137. radiusBottom: f,
  53138. height: g,
  53139. radialSegments: m,
  53140. heightSegments: v,
  53141. openEnded: e,
  53142. thetaStart: y,
  53143. thetaLength: A
  53144. },
  53145. p = void 0 !== p ? p : 20,
  53146. f = void 0 !== f ? f : 20,
  53147. g = void 0 !== g ? g : 100,
  53148. m = Math.floor(m) || 8,
  53149. v = Math.floor(v) || 1,
  53150. e = void 0 !== e && e,
  53151. y = void 0 !== y ? y : 0,
  53152. A = void 0 !== A ? A : 2 * Math.PI;
  53153. var i, n, r = (n = (m + 1) * (v + 1),
  53154. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53155. n), o = (i = m * v * 2 * 3,
  53156. !1 === e && (i += 2 * m * 3),
  53157. 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;
  53158. (function() {
  53159. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53160. for (t = 0; t <= v; t++) {
  53161. var o = []
  53162. , a = t / v
  53163. , s = a * (f - p) + p;
  53164. for (e = 0; e <= m; e++) {
  53165. var l = e / m;
  53166. n.x = s * Math.sin(l * A + y),
  53167. n.y = -a * g + x,
  53168. n.z = s * Math.cos(l * A + y),
  53169. I.setXYZ(b, n.x, n.y, n.z),
  53170. i.copy(n),
  53171. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53172. i.z = Math.cos(l * A + y)),
  53173. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53174. E.setXYZ(b, i.x, i.y, i.z),
  53175. _.setXY(b, l, 1 - a),
  53176. o.push(b),
  53177. b++
  53178. }
  53179. T.push(o)
  53180. }
  53181. for (e = 0; e < m; e++)
  53182. for (t = 0; t < v; t++) {
  53183. var c = T[t][e]
  53184. , h = T[t + 1][e]
  53185. , u = T[t + 1][e + 1]
  53186. , d = T[t][e + 1];
  53187. C.setX(w, c),
  53188. w++,
  53189. C.setX(w, h),
  53190. w++,
  53191. C.setX(w, d),
  53192. w++,
  53193. C.setX(w, h),
  53194. w++,
  53195. C.setX(w, u),
  53196. w++,
  53197. C.setX(w, d),
  53198. w++
  53199. }
  53200. }
  53201. )(),
  53202. !1 === e && (0 < p && t(!0),
  53203. 0 < f && t(!1)),
  53204. this.setIndex(C),
  53205. this.addAttribute("position", I),
  53206. this.addAttribute("normal", E),
  53207. this.addAttribute("uv", _)
  53208. }
  53209. ,
  53210. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53211. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53212. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53213. Ci.Geometry.call(this),
  53214. this.type = "CylinderGeometry",
  53215. this.parameters = {
  53216. radiusTop: e,
  53217. radiusBottom: t,
  53218. height: i,
  53219. radialSegments: n,
  53220. heightSegments: r,
  53221. openEnded: o,
  53222. thetaStart: a,
  53223. thetaLength: s
  53224. },
  53225. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53226. this.mergeVertices()
  53227. }
  53228. ,
  53229. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53230. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53231. Ci.EdgesGeometry = function(e, t) {
  53232. function i(e, t) {
  53233. return e - t
  53234. }
  53235. Ci.BufferGeometry.call(this),
  53236. t = void 0 !== t ? t : 1;
  53237. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53238. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53239. n.mergeVertices(),
  53240. n.computeFaceNormals();
  53241. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53242. for (var d = c[h], p = 0; p < 3; p++) {
  53243. o[0] = d[s[p]],
  53244. o[1] = d[s[(p + 1) % 3]],
  53245. o.sort(i),
  53246. void 0 === a[g = o.toString()] ? a[g] = {
  53247. vert1: o[0],
  53248. vert2: o[1],
  53249. face1: h,
  53250. face2: void 0
  53251. } : a[g].face2 = h
  53252. }
  53253. var f = [];
  53254. for (var g in a) {
  53255. var m = a[g];
  53256. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53257. var v = l[m.vert1];
  53258. f.push(v.x),
  53259. f.push(v.y),
  53260. f.push(v.z),
  53261. v = l[m.vert2],
  53262. f.push(v.x),
  53263. f.push(v.y),
  53264. f.push(v.z)
  53265. }
  53266. }
  53267. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53268. }
  53269. ,
  53270. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53271. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53272. Ci.ExtrudeGeometry = function(e, t) {
  53273. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53274. this.type = "ExtrudeGeometry",
  53275. e = Array.isArray(e) ? e : [e],
  53276. this.addShapeList(e, t),
  53277. void this.computeFaceNormals())
  53278. }
  53279. ;
  53280. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53281. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53282. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53283. for (var i = e.length, n = 0; n < i; n++) {
  53284. var r = e[n];
  53285. this.addShape(r, t)
  53286. }
  53287. }
  53288. ,
  53289. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53290. function i(e, t, i) {
  53291. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53292. t.clone().multiplyScalar(i).add(e)
  53293. }
  53294. function n(e, t, i) {
  53295. 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;
  53296. if (Math.abs(u) > Number.EPSILON) {
  53297. var d = Math.sqrt(h)
  53298. , p = Math.sqrt(l * l + c * c)
  53299. , f = t.x - s / d
  53300. , g = t.y + a / d
  53301. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53302. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53303. if (v <= 2)
  53304. return new Ci.Vector2(n,r);
  53305. o = Math.sqrt(v / 2)
  53306. } else {
  53307. var y = !1;
  53308. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53309. o = y ? (n = -s,
  53310. r = a,
  53311. Math.sqrt(h)) : (n = a,
  53312. r = s,
  53313. Math.sqrt(h / 2))
  53314. }
  53315. return new Ci.Vector2(n / o,r / o)
  53316. }
  53317. function r(e, t) {
  53318. var i, n;
  53319. for (G = e.length; 0 <= --G; ) {
  53320. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53321. var r = 0
  53322. , o = A + 2 * m;
  53323. for (r = 0; r < o; r++) {
  53324. var a = U * r
  53325. , s = U * (r + 1);
  53326. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53327. }
  53328. }
  53329. }
  53330. function o(e, t, i) {
  53331. T.vertices.push(new Ci.Vector3(e,t,i))
  53332. }
  53333. function a(e, t, i) {
  53334. e += x,
  53335. t += x,
  53336. i += x,
  53337. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53338. var n = E.generateTopUV(T, e, t, i);
  53339. T.faceVertexUvs[0].push(n)
  53340. }
  53341. function l(e, t, i, n) {
  53342. e += x,
  53343. t += x,
  53344. i += x,
  53345. n += x,
  53346. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53347. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53348. var r = E.generateSideWallUV(T, e, t, i, n);
  53349. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53350. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53351. }
  53352. 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;
  53353. C && (s = C.getSpacedPoints(A),
  53354. v = !(I = !0),
  53355. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53356. h = new Ci.Vector3,
  53357. u = new Ci.Vector3,
  53358. d = new Ci.Vector3),
  53359. v || (g = f = m = 0);
  53360. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53361. if (P) {
  53362. for (M = M.reverse(),
  53363. b = 0,
  53364. w = R.length; b < w; b++)
  53365. _ = R[b],
  53366. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53367. P = !1
  53368. }
  53369. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53370. , L = M;
  53371. for (b = 0,
  53372. w = R.length; b < w; b++)
  53373. _ = R[b],
  53374. M = M.concat(_);
  53375. 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++,
  53376. j++,
  53377. Y++)
  53378. j === W && (j = 0),
  53379. Y === W && (Y = 0),
  53380. z[G] = n(L[G], L[j], L[Y]);
  53381. var q, X, Z = [], K = z.concat();
  53382. for (b = 0,
  53383. w = R.length; b < w; b++) {
  53384. for (_ = R[b],
  53385. q = [],
  53386. G = 0,
  53387. j = (W = _.length) - 1,
  53388. Y = G + 1; G < W; G++,
  53389. j++,
  53390. Y++)
  53391. j === W && (j = 0),
  53392. Y === W && (Y = 0),
  53393. q[G] = n(_[G], _[j], _[Y]);
  53394. Z.push(q),
  53395. K = K.concat(q)
  53396. }
  53397. for (D = 0; D < m; D++) {
  53398. for (B = f * (1 - (F = D / m)),
  53399. N = g * Math.sin(F * Math.PI / 2),
  53400. G = 0,
  53401. W = L.length; G < W; G++)
  53402. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53403. for (b = 0,
  53404. w = R.length; b < w; b++)
  53405. for (_ = R[b],
  53406. q = Z[b],
  53407. G = 0,
  53408. W = _.length; G < W; G++)
  53409. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53410. }
  53411. for (N = g,
  53412. G = 0; G < U; G++)
  53413. V = v ? i(M[G], K[G], N) : M[G],
  53414. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53415. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53416. d.copy(s[0]).add(u).add(h),
  53417. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53418. for (X = 1; X <= A; X++)
  53419. for (G = 0; G < U; G++)
  53420. V = v ? i(M[G], K[G], N) : M[G],
  53421. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53422. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53423. d.copy(s[X]).add(u).add(h),
  53424. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53425. for (D = m - 1; 0 <= D; D--) {
  53426. for (B = f * (1 - (F = D / m)),
  53427. N = g * Math.sin(F * Math.PI / 2),
  53428. G = 0,
  53429. W = L.length; G < W; G++)
  53430. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53431. for (b = 0,
  53432. w = R.length; b < w; b++)
  53433. for (_ = R[b],
  53434. q = Z[b],
  53435. G = 0,
  53436. W = _.length; G < W; G++)
  53437. V = i(_[G], q[G], N),
  53438. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53439. }
  53440. (function() {
  53441. if (v) {
  53442. var e = 0
  53443. , t = U * e;
  53444. for (G = 0; G < H; G++)
  53445. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53446. for (t = U * (e = A + 2 * m),
  53447. G = 0; G < H; G++)
  53448. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53449. } else {
  53450. for (G = 0; G < H; G++)
  53451. a((k = O[G])[2], k[1], k[0]);
  53452. for (G = 0; G < H; G++)
  53453. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53454. }
  53455. }
  53456. )(),
  53457. function() {
  53458. var e = 0;
  53459. for (r(L, e),
  53460. e += L.length,
  53461. b = 0,
  53462. w = R.length; b < w; b++)
  53463. r(_ = R[b], e),
  53464. e += _.length
  53465. }()
  53466. }
  53467. ,
  53468. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53469. generateTopUV: function(e, t, i, n) {
  53470. var r = e.vertices
  53471. , o = r[t]
  53472. , a = r[i]
  53473. , s = r[n];
  53474. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53475. },
  53476. generateSideWallUV: function(e, t, i, n, r) {
  53477. var o = e.vertices
  53478. , a = o[t]
  53479. , s = o[i]
  53480. , l = o[n]
  53481. , c = o[r];
  53482. 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)]
  53483. }
  53484. },
  53485. Ci.ShapeGeometry = function(e, t) {
  53486. Ci.Geometry.call(this),
  53487. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53488. this.addShapeList(e, t),
  53489. this.computeFaceNormals()
  53490. }
  53491. ,
  53492. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53493. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53494. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53495. for (var i = 0, n = e.length; i < n; i++)
  53496. this.addShape(e[i], t);
  53497. return this
  53498. }
  53499. ,
  53500. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53501. void 0 === t && (t = {});
  53502. 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);
  53503. if (d) {
  53504. for (h = h.reverse(),
  53505. i = 0,
  53506. n = u.length; i < n; i++)
  53507. r = u[i],
  53508. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53509. d = !1
  53510. }
  53511. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53512. for (i = 0,
  53513. n = u.length; i < n; i++)
  53514. r = u[i],
  53515. h = h.concat(r);
  53516. var f, g, m = h.length, v = p.length;
  53517. for (i = 0; i < m; i++)
  53518. f = h[i],
  53519. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53520. for (i = 0; i < v; i++) {
  53521. var y = (g = p[i])[0] + l
  53522. , A = g[1] + l
  53523. , C = g[2] + l;
  53524. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53525. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53526. }
  53527. }
  53528. ,
  53529. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53530. Ci.BufferGeometry.call(this),
  53531. this.type = "LatheBufferGeometry",
  53532. this.parameters = {
  53533. points: e,
  53534. segments: t,
  53535. phiStart: i,
  53536. phiLength: n
  53537. },
  53538. t = Math.floor(t) || 12,
  53539. i = i || 0,
  53540. n = n || 2 * Math.PI,
  53541. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53542. 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,
  53543. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53544. for (o = 0; o <= t; o++) {
  53545. var v = i + o * f * n
  53546. , y = Math.sin(v)
  53547. , A = Math.cos(v);
  53548. for (a = 0; a <= e.length - 1; a++)
  53549. g.x = e[a].x * y,
  53550. g.y = e[a].y,
  53551. g.z = e[a].x * A,
  53552. h.setXYZ(d, g.x, g.y, g.z),
  53553. m.x = o / t,
  53554. m.y = a / (e.length - 1),
  53555. u.setXY(d, m.x, m.y),
  53556. d++
  53557. }
  53558. for (o = 0; o < t; o++)
  53559. for (a = 0; a < e.length - 1; a++) {
  53560. var C = r = a + o * e.length
  53561. , I = r + e.length
  53562. , E = r + e.length + 1
  53563. , _ = r + 1;
  53564. c.setX(p, C),
  53565. p++,
  53566. c.setX(p, I),
  53567. p++,
  53568. c.setX(p, _),
  53569. p++,
  53570. c.setX(p, I),
  53571. p++,
  53572. c.setX(p, E),
  53573. p++,
  53574. c.setX(p, _),
  53575. p++
  53576. }
  53577. if (this.setIndex(c),
  53578. this.addAttribute("position", h),
  53579. this.addAttribute("uv", u),
  53580. this.computeVertexNormals(),
  53581. n === 2 * Math.PI) {
  53582. var b = this.attributes.normal.array
  53583. , w = new Ci.Vector3
  53584. , T = new Ci.Vector3
  53585. , x = new Ci.Vector3;
  53586. for (r = t * e.length * 3,
  53587. a = o = 0; o < e.length; o++,
  53588. a += 3)
  53589. w.x = b[a + 0],
  53590. w.y = b[a + 1],
  53591. w.z = b[a + 2],
  53592. T.x = b[r + a + 0],
  53593. T.y = b[r + a + 1],
  53594. T.z = b[r + a + 2],
  53595. x.addVectors(w, T).normalize(),
  53596. b[a + 0] = b[r + a + 0] = x.x,
  53597. b[a + 1] = b[r + a + 1] = x.y,
  53598. b[a + 2] = b[r + a + 2] = x.z
  53599. }
  53600. }
  53601. ,
  53602. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53603. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53604. Ci.LatheGeometry = function(e, t, i, n) {
  53605. Ci.Geometry.call(this),
  53606. this.type = "LatheGeometry",
  53607. this.parameters = {
  53608. points: e,
  53609. segments: t,
  53610. phiStart: i,
  53611. phiLength: n
  53612. },
  53613. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53614. this.mergeVertices()
  53615. }
  53616. ,
  53617. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53618. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53619. Ci.PlaneGeometry = function(e, t, i, n) {
  53620. Ci.Geometry.call(this),
  53621. this.type = "PlaneGeometry",
  53622. this.parameters = {
  53623. width: e,
  53624. height: t,
  53625. widthSegments: i,
  53626. heightSegments: n
  53627. },
  53628. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53629. }
  53630. ,
  53631. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53632. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53633. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53634. Ci.BufferGeometry.call(this),
  53635. this.type = "PlaneBufferGeometry",
  53636. this.parameters = {
  53637. width: e,
  53638. height: t,
  53639. widthSegments: i,
  53640. heightSegments: n
  53641. };
  53642. 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++)
  53643. for (var y = v * u - o, A = 0; A < l; A++) {
  53644. var C = A * h - r;
  53645. d[g] = C,
  53646. d[g + 1] = -y,
  53647. p[g + 2] = 1,
  53648. f[m] = A / a,
  53649. f[m + 1] = 1 - v / s,
  53650. g += 3,
  53651. m += 2
  53652. }
  53653. g = 0;
  53654. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53655. for (v = 0; v < s; v++)
  53656. for (A = 0; A < a; A++) {
  53657. var E = A + l * v
  53658. , _ = A + l * (v + 1)
  53659. , b = A + 1 + l * (v + 1)
  53660. , w = A + 1 + l * v;
  53661. I[g] = E,
  53662. I[g + 1] = _,
  53663. I[g + 2] = w,
  53664. I[g + 3] = _,
  53665. I[g + 4] = b,
  53666. I[g + 5] = w,
  53667. g += 6
  53668. }
  53669. this.setIndex(new Ci.BufferAttribute(I,1)),
  53670. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53671. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53672. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53673. }
  53674. ,
  53675. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53676. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53677. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53678. Ci.BufferGeometry.call(this),
  53679. this.type = "RingBufferGeometry",
  53680. this.parameters = {
  53681. innerRadius: e,
  53682. outerRadius: t,
  53683. thetaSegments: i,
  53684. phiSegments: n,
  53685. thetaStart: r,
  53686. thetaLength: o
  53687. },
  53688. e = e || 20,
  53689. t = t || 50,
  53690. r = void 0 !== r ? r : 0,
  53691. o = void 0 !== o ? o : 2 * Math.PI;
  53692. 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;
  53693. for (s = 0; s <= n; s++) {
  53694. for (l = 0; l <= i; l++)
  53695. a = r + l / i * o,
  53696. A.x = v * Math.cos(a),
  53697. A.y = v * Math.sin(a),
  53698. d.setXYZ(g, A.x, A.y, A.z),
  53699. p.setXYZ(g, 0, 0, 1),
  53700. C.x = (A.x / t + 1) / 2,
  53701. C.y = (A.y / t + 1) / 2,
  53702. f.setXY(g, C.x, C.y),
  53703. g++;
  53704. v += y
  53705. }
  53706. for (s = 0; s < n; s++) {
  53707. var I = s * (i + 1);
  53708. for (l = 0; l < i; l++) {
  53709. var E = a = l + I
  53710. , _ = a + i + 1
  53711. , b = a + i + 2
  53712. , w = a + 1;
  53713. u.setX(m, E),
  53714. m++,
  53715. u.setX(m, _),
  53716. m++,
  53717. u.setX(m, b),
  53718. m++,
  53719. u.setX(m, E),
  53720. m++,
  53721. u.setX(m, b),
  53722. m++,
  53723. u.setX(m, w),
  53724. m++
  53725. }
  53726. }
  53727. this.setIndex(u),
  53728. this.addAttribute("position", d),
  53729. this.addAttribute("normal", p),
  53730. this.addAttribute("uv", f)
  53731. }
  53732. ,
  53733. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53734. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53735. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53736. Ci.Geometry.call(this),
  53737. this.type = "RingGeometry",
  53738. this.parameters = {
  53739. innerRadius: e,
  53740. outerRadius: t,
  53741. thetaSegments: i,
  53742. phiSegments: n,
  53743. thetaStart: r,
  53744. thetaLength: o
  53745. },
  53746. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53747. }
  53748. ,
  53749. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53750. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53751. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53752. Ci.Geometry.call(this),
  53753. this.type = "SphereGeometry",
  53754. this.parameters = {
  53755. radius: e,
  53756. widthSegments: t,
  53757. heightSegments: i,
  53758. phiStart: n,
  53759. phiLength: r,
  53760. thetaStart: o,
  53761. thetaLength: a
  53762. },
  53763. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53764. }
  53765. ,
  53766. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53767. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53768. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53769. Ci.BufferGeometry.call(this),
  53770. this.type = "SphereBufferGeometry",
  53771. this.parameters = {
  53772. radius: e,
  53773. widthSegments: t,
  53774. heightSegments: i,
  53775. phiStart: n,
  53776. phiLength: r,
  53777. thetaStart: o,
  53778. thetaLength: a
  53779. },
  53780. e = e || 50,
  53781. t = Math.max(3, Math.floor(t) || 8),
  53782. i = Math.max(2, Math.floor(i) || 6),
  53783. n = void 0 !== n ? n : 0,
  53784. r = void 0 !== r ? r : 2 * Math.PI;
  53785. 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++) {
  53786. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53787. var A = y / t
  53788. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53789. , I = e * Math.cos(o + v * a)
  53790. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53791. f.set(C, I, E).normalize(),
  53792. c.setXYZ(d, C, I, E),
  53793. h.setXYZ(d, f.x, f.y, f.z),
  53794. u.setXY(d, A, 1 - v),
  53795. m.push(d),
  53796. d++
  53797. }
  53798. p.push(m)
  53799. }
  53800. var _ = [];
  53801. for (g = 0; g < i; g++)
  53802. for (y = 0; y < t; y++) {
  53803. var b = p[g][y + 1]
  53804. , w = p[g][y]
  53805. , T = p[g + 1][y]
  53806. , x = p[g + 1][y + 1];
  53807. (0 !== g || 0 < o) && _.push(b, w, x),
  53808. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53809. }
  53810. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53811. this.addAttribute("position", c),
  53812. this.addAttribute("normal", h),
  53813. this.addAttribute("uv", u),
  53814. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53815. }
  53816. ,
  53817. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53818. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53819. Ci.TextGeometry = function(e, t) {
  53820. var i = (t = t || {}).font;
  53821. if (i instanceof Ci.Font == 0)
  53822. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53823. new Ci.Geometry;
  53824. var n = i.generateShapes(e, t.size, t.curveSegments);
  53825. t.amount = void 0 !== t.height ? t.height : 50,
  53826. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53827. void 0 === t.bevelSize && (t.bevelSize = 8),
  53828. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53829. Ci.ExtrudeGeometry.call(this, n, t),
  53830. this.type = "TextGeometry"
  53831. }
  53832. ,
  53833. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53834. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53835. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53836. Ci.BufferGeometry.call(this),
  53837. this.type = "TorusBufferGeometry",
  53838. this.parameters = {
  53839. radius: e,
  53840. tube: t,
  53841. radialSegments: i,
  53842. tubularSegments: n,
  53843. arc: r
  53844. },
  53845. e = e || 100,
  53846. t = t || 40,
  53847. i = Math.floor(i) || 8,
  53848. n = Math.floor(n) || 6,
  53849. r = r || 2 * Math.PI;
  53850. 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;
  53851. for (o = 0; o <= i; o++)
  53852. for (a = 0; a <= n; a++) {
  53853. var A = a / n * r
  53854. , C = o / i * Math.PI * 2;
  53855. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53856. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53857. v.z = t * Math.sin(C),
  53858. h[p] = v.x,
  53859. h[p + 1] = v.y,
  53860. h[p + 2] = v.z,
  53861. m.x = e * Math.cos(A),
  53862. m.y = e * Math.sin(A),
  53863. y.subVectors(v, m).normalize(),
  53864. u[p] = y.x,
  53865. u[p + 1] = y.y,
  53866. u[p + 2] = y.z,
  53867. d[f] = a / n,
  53868. d[f + 1] = o / i,
  53869. p += 3,
  53870. f += 2
  53871. }
  53872. for (o = 1; o <= i; o++)
  53873. for (a = 1; a <= n; a++) {
  53874. var I = (n + 1) * o + a - 1
  53875. , E = (n + 1) * (o - 1) + a - 1
  53876. , _ = (n + 1) * (o - 1) + a
  53877. , b = (n + 1) * o + a;
  53878. c[g] = I,
  53879. c[g + 1] = E,
  53880. c[g + 2] = b,
  53881. c[g + 3] = E,
  53882. c[g + 4] = _,
  53883. c[g + 5] = b,
  53884. g += 6
  53885. }
  53886. this.setIndex(new Ci.BufferAttribute(c,1)),
  53887. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53888. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53889. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53890. }
  53891. ,
  53892. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53893. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53894. Ci.TorusGeometry = function(e, t, i, n, r) {
  53895. Ci.Geometry.call(this),
  53896. this.type = "TorusGeometry",
  53897. this.parameters = {
  53898. radius: e,
  53899. tube: t,
  53900. radialSegments: i,
  53901. tubularSegments: n,
  53902. arc: r
  53903. },
  53904. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53905. }
  53906. ,
  53907. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53908. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53909. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53910. function a(e, t, i, n, r) {
  53911. var o = Math.cos(e)
  53912. , a = Math.sin(e)
  53913. , s = i / t * e
  53914. , l = Math.cos(s);
  53915. r.x = n * (2 + l) * .5 * o,
  53916. r.y = n * (2 + l) * a * .5,
  53917. r.z = n * Math.sin(s) * .5
  53918. }
  53919. Ci.BufferGeometry.call(this),
  53920. this.type = "TorusKnotBufferGeometry",
  53921. this.parameters = {
  53922. radius: e,
  53923. tube: t,
  53924. tubularSegments: i,
  53925. radialSegments: n,
  53926. p: r,
  53927. q: o
  53928. },
  53929. e = e || 100,
  53930. t = t || 40,
  53931. i = Math.floor(i) || 64,
  53932. r = r || 2,
  53933. o = o || 3;
  53934. 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;
  53935. for (s = 0; s <= i; ++s) {
  53936. var w = s / i * r * Math.PI * 2;
  53937. for (a(w, r, o, e, C),
  53938. a(.01 + w, r, o, e, I),
  53939. _.subVectors(I, C),
  53940. b.addVectors(I, C),
  53941. E.crossVectors(_, b),
  53942. b.crossVectors(E, _),
  53943. E.normalize(),
  53944. b.normalize(),
  53945. l = 0; l <= n; ++l) {
  53946. var T = l / n * Math.PI * 2
  53947. , x = -t * Math.cos(T)
  53948. , S = t * Math.sin(T);
  53949. v.x = C.x + (x * b.x + S * E.x),
  53950. v.y = C.y + (x * b.y + S * E.y),
  53951. v.z = C.z + (x * b.z + S * E.z),
  53952. d.setXYZ(g, v.x, v.y, v.z),
  53953. y.subVectors(v, C).normalize(),
  53954. p.setXYZ(g, y.x, y.y, y.z),
  53955. A.x = s / i,
  53956. A.y = l / n,
  53957. f.setXY(g, A.x, A.y),
  53958. g++
  53959. }
  53960. }
  53961. for (l = 1; l <= i; l++)
  53962. for (s = 1; s <= n; s++) {
  53963. var M = (n + 1) * (l - 1) + (s - 1)
  53964. , R = (n + 1) * l + (s - 1)
  53965. , P = (n + 1) * l + s
  53966. , O = (n + 1) * (l - 1) + s;
  53967. u.setX(m, M),
  53968. m++,
  53969. u.setX(m, R),
  53970. m++,
  53971. u.setX(m, O),
  53972. m++,
  53973. u.setX(m, R),
  53974. m++,
  53975. u.setX(m, P),
  53976. m++,
  53977. u.setX(m, O),
  53978. m++
  53979. }
  53980. this.setIndex(u),
  53981. this.addAttribute("position", d),
  53982. this.addAttribute("normal", p),
  53983. this.addAttribute("uv", f)
  53984. }
  53985. ,
  53986. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53987. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53988. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53989. Ci.Geometry.call(this),
  53990. this.type = "TorusKnotGeometry",
  53991. this.parameters = {
  53992. radius: e,
  53993. tube: t,
  53994. tubularSegments: i,
  53995. radialSegments: n,
  53996. p: r,
  53997. q: o
  53998. },
  53999. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54000. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54001. this.mergeVertices()
  54002. }
  54003. ,
  54004. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54005. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54006. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54007. Ci.Geometry.call(this),
  54008. this.type = "TubeGeometry",
  54009. this.parameters = {
  54010. path: e,
  54011. segments: t,
  54012. radius: i,
  54013. radialSegments: n,
  54014. closed: r,
  54015. taper: o
  54016. },
  54017. t = t || 64,
  54018. i = i || 1,
  54019. n = n || 8,
  54020. r = r || !1,
  54021. o = o || Ci.TubeGeometry.NoTaper;
  54022. 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;
  54023. for (this.tangents = D,
  54024. this.normals = N,
  54025. this.binormals = F,
  54026. f = 0; f < P; f++)
  54027. for (M[f] = [],
  54028. l = f / (P - 1),
  54029. p = e.getPointAt(l),
  54030. D[f],
  54031. a = N[f],
  54032. s = F[f],
  54033. h = i * o(l),
  54034. g = 0; g < n; g++)
  54035. c = g / n * 2 * Math.PI,
  54036. u = -h * Math.cos(c),
  54037. d = h * Math.sin(c),
  54038. O.copy(p),
  54039. O.x += u * a.x + d * s.x,
  54040. O.y += u * a.y + d * s.y,
  54041. O.z += u * a.z + d * s.z,
  54042. M[f][g] = (T = O.x,
  54043. x = O.y,
  54044. S = O.z,
  54045. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54046. for (f = 0; f < t; f++)
  54047. for (g = 0; g < n; g++)
  54048. m = r ? (f + 1) % t : f + 1,
  54049. v = (g + 1) % n,
  54050. y = M[f][g],
  54051. A = M[m][g],
  54052. C = M[m][v],
  54053. I = M[f][v],
  54054. E = new Ci.Vector2(f / t,g / n),
  54055. _ = new Ci.Vector2((f + 1) / t,g / n),
  54056. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54057. w = new Ci.Vector2(f / t,(g + 1) / n),
  54058. this.faces.push(new Ci.Face3(y,A,I)),
  54059. this.faceVertexUvs[0].push([E, _, w]),
  54060. this.faces.push(new Ci.Face3(A,C,I)),
  54061. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54062. this.computeFaceNormals(),
  54063. this.computeVertexNormals()
  54064. }
  54065. ,
  54066. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54067. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54068. Ci.TubeGeometry.NoTaper = function(e) {
  54069. return 1
  54070. }
  54071. ,
  54072. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54073. return Math.sin(Math.PI * e)
  54074. }
  54075. ,
  54076. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54077. 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;
  54078. for (this.tangents = u,
  54079. this.normals = d,
  54080. this.binormals = p,
  54081. l = 0; l < m; l++)
  54082. c = l / (m - 1),
  54083. u[l] = e.getTangentAt(c),
  54084. u[l].normalize();
  54085. for (d[0] = new Ci.Vector3,
  54086. p[0] = new Ci.Vector3,
  54087. r = Number.MAX_VALUE,
  54088. o = Math.abs(u[0].x),
  54089. a = Math.abs(u[0].y),
  54090. s = Math.abs(u[0].z),
  54091. o <= r && (r = o,
  54092. h.set(1, 0, 0)),
  54093. a <= r && (r = a,
  54094. h.set(0, 1, 0)),
  54095. s <= r && h.set(0, 0, 1),
  54096. f.crossVectors(u[0], h).normalize(),
  54097. d[0].crossVectors(u[0], f),
  54098. p[0].crossVectors(u[0], d[0]),
  54099. l = 1; l < m; l++)
  54100. d[l] = d[l - 1].clone(),
  54101. p[l] = p[l - 1].clone(),
  54102. f.crossVectors(u[l - 1], u[l]),
  54103. f.length() > Number.EPSILON && (f.normalize(),
  54104. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54105. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54106. p[l].crossVectors(u[l], d[l]);
  54107. if (i)
  54108. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54109. n /= m - 1,
  54110. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54111. l = 1; l < m; l++)
  54112. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54113. p[l].crossVectors(u[l], d[l])
  54114. }
  54115. ,
  54116. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54117. function f(e) {
  54118. var t = e.normalize().clone();
  54119. t.index = m.vertices.push(t) - 1;
  54120. var i = a(e) / 2 / Math.PI + .5
  54121. , n = function(e) {
  54122. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54123. }(e) / Math.PI + .5;
  54124. return t.uv = new Ci.Vector2(i,1 - n),
  54125. t
  54126. }
  54127. function g(e, t, i, n) {
  54128. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54129. m.faces.push(r),
  54130. y.copy(e).add(t).add(i).divideScalar(3);
  54131. var o = a(y);
  54132. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54133. }
  54134. function r(e, t) {
  54135. 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++) {
  54136. a[l] = [];
  54137. 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++)
  54138. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54139. }
  54140. for (l = 0; l < i; l++)
  54141. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54142. var p = Math.floor(d / 2);
  54143. 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)
  54144. }
  54145. }
  54146. function a(e) {
  54147. return Math.atan2(e.z, -e.x)
  54148. }
  54149. function s(e, t, i) {
  54150. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54151. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54152. e.clone()
  54153. }
  54154. Ci.Geometry.call(this),
  54155. this.type = "PolyhedronGeometry",
  54156. this.parameters = {
  54157. vertices: e,
  54158. indices: t,
  54159. radius: i,
  54160. detail: n
  54161. },
  54162. i = i || 1,
  54163. n = n || 0;
  54164. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54165. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54166. var c = this.vertices
  54167. , h = []
  54168. , u = (o = 0,
  54169. 0);
  54170. for (l = t.length; o < l; o += 3,
  54171. u++) {
  54172. var d = c[t[o]]
  54173. , p = c[t[o + 1]]
  54174. , v = c[t[o + 2]];
  54175. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54176. }
  54177. var y = new Ci.Vector3;
  54178. for (o = 0,
  54179. l = h.length; o < l; o++)
  54180. r(h[o], n);
  54181. for (o = 0,
  54182. l = this.faceVertexUvs[0].length; o < l; o++) {
  54183. var A = this.faceVertexUvs[0][o]
  54184. , C = A[0].x
  54185. , I = A[1].x
  54186. , E = A[2].x
  54187. , _ = Math.max(C, I, E)
  54188. , b = Math.min(C, I, E);
  54189. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54190. I < .2 && (A[1].x += 1),
  54191. E < .2 && (A[2].x += 1))
  54192. }
  54193. for (o = 0,
  54194. l = this.vertices.length; o < l; o++)
  54195. this.vertices[o].multiplyScalar(i);
  54196. this.mergeVertices(),
  54197. this.computeFaceNormals(),
  54198. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54199. }
  54200. ,
  54201. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54202. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54203. Ci.DodecahedronGeometry = function(e, t) {
  54204. var i = (1 + Math.sqrt(5)) / 2
  54205. , n = 1 / i
  54206. , 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];
  54207. 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),
  54208. this.type = "DodecahedronGeometry",
  54209. this.parameters = {
  54210. radius: e,
  54211. detail: t
  54212. }
  54213. }
  54214. ,
  54215. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54216. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54217. Ci.IcosahedronGeometry = function(e, t) {
  54218. var i = (1 + Math.sqrt(5)) / 2
  54219. , 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];
  54220. 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),
  54221. this.type = "IcosahedronGeometry",
  54222. this.parameters = {
  54223. radius: e,
  54224. detail: t
  54225. }
  54226. }
  54227. ,
  54228. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54229. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54230. Ci.OctahedronGeometry = function(e, t) {
  54231. 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),
  54232. this.type = "OctahedronGeometry",
  54233. this.parameters = {
  54234. radius: e,
  54235. detail: t
  54236. }
  54237. }
  54238. ,
  54239. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54240. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54241. Ci.TetrahedronGeometry = function(e, t) {
  54242. 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),
  54243. this.type = "TetrahedronGeometry",
  54244. this.parameters = {
  54245. radius: e,
  54246. detail: t
  54247. }
  54248. }
  54249. ,
  54250. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54251. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54252. Ci.ParametricGeometry = function(e, t, i) {
  54253. Ci.Geometry.call(this),
  54254. this.type = "ParametricGeometry",
  54255. this.parameters = {
  54256. func: e,
  54257. slices: t,
  54258. stacks: i
  54259. };
  54260. 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;
  54261. for (n = 0; n <= i; n++)
  54262. for (a = n / i,
  54263. r = 0; r <= t; r++)
  54264. o = e(r / t, a),
  54265. g.push(o);
  54266. for (n = 0; n < i; n++)
  54267. for (r = 0; r < t; r++)
  54268. l = (s = n * y + r) + 1,
  54269. c = (n + 1) * y + r + 1,
  54270. h = (n + 1) * y + r,
  54271. u = new Ci.Vector2(r / t,n / i),
  54272. d = new Ci.Vector2((r + 1) / t,n / i),
  54273. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54274. f = new Ci.Vector2(r / t,(n + 1) / i),
  54275. m.push(new Ci.Face3(s,l,h)),
  54276. v.push([u, d, f]),
  54277. m.push(new Ci.Face3(l,c,h)),
  54278. v.push([d.clone(), p, f.clone()]);
  54279. this.computeFaceNormals(),
  54280. this.computeVertexNormals()
  54281. }
  54282. ,
  54283. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54284. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54285. Ci.WireframeGeometry = function(e) {
  54286. function t(e, t) {
  54287. return e - t
  54288. }
  54289. Ci.BufferGeometry.call(this);
  54290. var i = [0, 0]
  54291. , n = {}
  54292. , r = ["a", "b", "c"];
  54293. if (e instanceof Ci.Geometry) {
  54294. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54295. for (var u = a[c], d = 0; d < 3; d++) {
  54296. i[0] = u[r[d]],
  54297. i[1] = u[r[(d + 1) % 3]],
  54298. i.sort(t),
  54299. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54300. l[2 * s + 1] = i[1],
  54301. n[E] = !0,
  54302. s++)
  54303. }
  54304. var p = new Float32Array(2 * s * 3);
  54305. for (c = 0,
  54306. h = s; c < h; c++)
  54307. for (d = 0; d < 2; d++) {
  54308. var f = o[l[2 * c + d]];
  54309. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54310. p[_ + 1] = f.y,
  54311. p[_ + 2] = f.z
  54312. }
  54313. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54314. } else if (e instanceof Ci.BufferGeometry)
  54315. if (null !== e.index) {
  54316. var g = e.index.array
  54317. , m = (o = e.attributes.position,
  54318. e.groups);
  54319. s = 0;
  54320. 0 === m.length && e.addGroup(0, g.length);
  54321. l = new Uint32Array(2 * g.length);
  54322. for (var v = 0, y = m.length; v < y; ++v)
  54323. for (var A = m[v], C = A.start, I = (c = C,
  54324. C + A.count); c < I; c += 3)
  54325. for (d = 0; d < 3; d++) {
  54326. var E;
  54327. i[0] = g[c + d],
  54328. i[1] = g[c + (d + 1) % 3],
  54329. i.sort(t),
  54330. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54331. l[2 * s + 1] = i[1],
  54332. n[E] = !0,
  54333. s++)
  54334. }
  54335. for (p = new Float32Array(2 * s * 3),
  54336. c = 0,
  54337. h = s; c < h; c++)
  54338. for (d = 0; d < 2; d++) {
  54339. var _ = 6 * c + 3 * d
  54340. , b = l[2 * c + d];
  54341. p[_ + 0] = o.getX(b),
  54342. p[_ + 1] = o.getY(b),
  54343. p[_ + 2] = o.getZ(b)
  54344. }
  54345. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54346. } else {
  54347. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54348. for (p = new Float32Array(2 * s * 3),
  54349. c = 0,
  54350. h = w; c < h; c++)
  54351. for (d = 0; d < 3; d++) {
  54352. var T = 9 * c + 3 * d;
  54353. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54354. p[_ + 1] = o[1 + T],
  54355. p[_ + 2] = o[2 + T];
  54356. b = 9 * c + (d + 1) % 3 * 3;
  54357. p[_ + 3] = o[b],
  54358. p[_ + 4] = o[b + 1],
  54359. p[_ + 5] = o[b + 2]
  54360. }
  54361. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54362. }
  54363. }
  54364. ,
  54365. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54366. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54367. Ci.AxisHelper = function(e) {
  54368. e = e || 1;
  54369. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54370. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54371. , n = new Ci.BufferGeometry;
  54372. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54373. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54374. var r = new Ci.LineBasicMaterial({
  54375. vertexColors: Ci.VertexColors
  54376. });
  54377. Ci.LineSegments.call(this, n, r)
  54378. }
  54379. ,
  54380. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54381. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54382. Ci.ArrowHelper = function() {
  54383. var a = new Ci.Geometry;
  54384. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54385. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54386. return s.translate(0, -.5, 0),
  54387. function(e, t, i, n, r, o) {
  54388. Ci.Object3D.call(this),
  54389. void 0 === n && (n = 16776960),
  54390. void 0 === i && (i = 1),
  54391. void 0 === r && (r = .2 * i),
  54392. void 0 === o && (o = .2 * r),
  54393. this.position.copy(t),
  54394. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54395. color: n
  54396. })),
  54397. this.line.matrixAutoUpdate = !1,
  54398. this.add(this.line),
  54399. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54400. color: n
  54401. })),
  54402. this.cone.matrixAutoUpdate = !1,
  54403. this.add(this.cone),
  54404. this.setDirection(e),
  54405. this.setLength(i, r, o)
  54406. }
  54407. }(),
  54408. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54409. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54410. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54411. function(e) {
  54412. .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(),
  54413. yi = Math.acos(e.y),
  54414. this.quaternion.setFromAxisAngle(Ai, yi))
  54415. }
  54416. ),
  54417. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54418. void 0 === t && (t = .2 * e),
  54419. void 0 === i && (i = .2 * t),
  54420. this.line.scale.set(1, Math.max(0, e - t), 1),
  54421. this.line.updateMatrix(),
  54422. this.cone.scale.set(i, t, i),
  54423. this.cone.position.y = e,
  54424. this.cone.updateMatrix()
  54425. }
  54426. ,
  54427. Ci.ArrowHelper.prototype.setColor = function(e) {
  54428. this.line.material.color.set(e),
  54429. this.cone.material.color.set(e)
  54430. }
  54431. ,
  54432. Ci.BoxHelper = function(e) {
  54433. 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])
  54434. , i = new Float32Array(24)
  54435. , n = new Ci.BufferGeometry;
  54436. n.setIndex(new Ci.BufferAttribute(t,1)),
  54437. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54438. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54439. color: 16776960
  54440. })),
  54441. void 0 !== e && this.update(e)
  54442. }
  54443. ,
  54444. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54445. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54446. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54447. function(e) {
  54448. if (vi.setFromObject(e),
  54449. !vi.isEmpty()) {
  54450. var t = vi.min
  54451. , i = vi.max
  54452. , n = this.geometry.attributes.position
  54453. , r = n.array;
  54454. r[0] = i.x,
  54455. r[1] = i.y,
  54456. r[2] = i.z,
  54457. r[3] = t.x,
  54458. r[4] = i.y,
  54459. r[5] = i.z,
  54460. r[6] = t.x,
  54461. r[7] = t.y,
  54462. r[8] = i.z,
  54463. r[9] = i.x,
  54464. r[10] = t.y,
  54465. r[11] = i.z,
  54466. r[12] = i.x,
  54467. r[13] = i.y,
  54468. r[14] = t.z,
  54469. r[15] = t.x,
  54470. r[16] = i.y,
  54471. r[17] = t.z,
  54472. r[18] = t.x,
  54473. r[19] = t.y,
  54474. r[20] = t.z,
  54475. r[21] = i.x,
  54476. r[22] = t.y,
  54477. r[23] = t.z,
  54478. n.needsUpdate = !0,
  54479. this.geometry.computeBoundingSphere()
  54480. }
  54481. }
  54482. ),
  54483. Ci.BoundingBoxHelper = function(e, t) {
  54484. var i = void 0 !== t ? t : 8947848;
  54485. this.object = e,
  54486. this.box = new Ci.Box3,
  54487. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54488. color: i,
  54489. wireframe: !0
  54490. }))
  54491. }
  54492. ,
  54493. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54494. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54495. Ci.BoundingBoxHelper.prototype.update = function() {
  54496. this.box.setFromObject(this.object),
  54497. this.box.size(this.scale),
  54498. this.box.center(this.position)
  54499. }
  54500. ,
  54501. Ci.CameraHelper = function(e) {
  54502. function t(e, t, i) {
  54503. n(e, i),
  54504. n(t, i)
  54505. }
  54506. function n(e, t) {
  54507. i.vertices.push(new Ci.Vector3),
  54508. i.colors.push(new Ci.Color(t)),
  54509. void 0 === o[e] && (o[e] = []),
  54510. o[e].push(i.vertices.length - 1)
  54511. }
  54512. var i = new Ci.Geometry
  54513. , r = new Ci.LineBasicMaterial({
  54514. color: 16777215,
  54515. vertexColors: Ci.FaceColors
  54516. })
  54517. , o = {}
  54518. , a = 16755200
  54519. , s = 16711680
  54520. , l = 3355443;
  54521. t("n1", "n2", a),
  54522. t("n2", "n4", a),
  54523. t("n4", "n3", a),
  54524. t("n3", "n1", a),
  54525. t("f1", "f2", a),
  54526. t("f2", "f4", a),
  54527. t("f4", "f3", a),
  54528. t("f3", "f1", a),
  54529. t("n1", "f1", a),
  54530. t("n2", "f2", a),
  54531. t("n3", "f3", a),
  54532. t("n4", "f4", a),
  54533. t("p", "n1", s),
  54534. t("p", "n2", s),
  54535. t("p", "n3", s),
  54536. t("p", "n4", s),
  54537. t("u1", "u2", 43775),
  54538. t("u2", "u3", 43775),
  54539. t("u3", "u1", 43775),
  54540. t("c", "t", 16777215),
  54541. t("p", "c", l),
  54542. t("cn1", "cn2", l),
  54543. t("cn3", "cn4", l),
  54544. t("cf1", "cf2", l),
  54545. t("cf3", "cf4", l),
  54546. Ci.LineSegments.call(this, i, r),
  54547. this.camera = e,
  54548. this.camera.updateProjectionMatrix(),
  54549. this.matrix = e.matrixWorld,
  54550. this.matrixAutoUpdate = !1,
  54551. this.pointMap = o,
  54552. this.update()
  54553. }
  54554. ,
  54555. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54556. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54557. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54558. mi = new Ci.Camera,
  54559. function() {
  54560. pi = this.geometry,
  54561. fi = this.pointMap,
  54562. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54563. Ni("c", 0, 0, -1),
  54564. Ni("t", 0, 0, 1),
  54565. Ni("n1", -1, -1, -1),
  54566. Ni("n2", 1, -1, -1),
  54567. Ni("n3", -1, 1, -1),
  54568. Ni("n4", 1, 1, -1),
  54569. Ni("f1", -1, -1, 1),
  54570. Ni("f2", 1, -1, 1),
  54571. Ni("f3", -1, 1, 1),
  54572. Ni("f4", 1, 1, 1),
  54573. Ni("u1", .7, 1.1, -1),
  54574. Ni("u2", -.7, 1.1, -1),
  54575. Ni("u3", 0, 2, -1),
  54576. Ni("cf1", -1, 0, 1),
  54577. Ni("cf2", 1, 0, 1),
  54578. Ni("cf3", 0, -1, 1),
  54579. Ni("cf4", 0, 1, 1),
  54580. Ni("cn1", -1, 0, -1),
  54581. Ni("cn2", 1, 0, -1),
  54582. Ni("cn3", 0, -1, -1),
  54583. Ni("cn4", 0, 1, -1),
  54584. pi.verticesNeedUpdate = !0
  54585. }
  54586. ),
  54587. Ci.DirectionalLightHelper = function(e, t) {
  54588. Ci.Object3D.call(this),
  54589. this.light = e,
  54590. this.light.updateMatrixWorld(),
  54591. this.matrix = e.matrixWorld,
  54592. this.matrixAutoUpdate = !1,
  54593. t = t || 1;
  54594. var i = new Ci.Geometry;
  54595. 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));
  54596. var n = new Ci.LineBasicMaterial({
  54597. fog: !1
  54598. });
  54599. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54600. this.lightPlane = new Ci.Line(i,n),
  54601. this.add(this.lightPlane),
  54602. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54603. (n = new Ci.LineBasicMaterial({
  54604. fog: !1
  54605. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54606. this.targetLine = new Ci.Line(i,n),
  54607. this.add(this.targetLine),
  54608. this.update()
  54609. }
  54610. ,
  54611. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54612. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54613. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54614. this.lightPlane.geometry.dispose(),
  54615. this.lightPlane.material.dispose(),
  54616. this.targetLine.geometry.dispose(),
  54617. this.targetLine.material.dispose()
  54618. }
  54619. ,
  54620. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54621. ui = new Ci.Vector3,
  54622. di = new Ci.Vector3,
  54623. function() {
  54624. hi.setFromMatrixPosition(this.light.matrixWorld),
  54625. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54626. di.subVectors(ui, hi),
  54627. this.lightPlane.lookAt(di),
  54628. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54629. this.targetLine.geometry.vertices[1].copy(di),
  54630. this.targetLine.geometry.verticesNeedUpdate = !0,
  54631. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54632. }
  54633. ),
  54634. Ci.EdgesHelper = function(e, t, i) {
  54635. var n = void 0 !== t ? t : 16777215;
  54636. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54637. color: n
  54638. })),
  54639. this.matrix = e.matrixWorld,
  54640. this.matrixAutoUpdate = !1
  54641. }
  54642. ,
  54643. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54644. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54645. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54646. this.object = e,
  54647. this.size = void 0 !== t ? t : 1;
  54648. var r = void 0 !== i ? i : 16776960
  54649. , o = void 0 !== n ? n : 1
  54650. , a = 0
  54651. , s = this.object.geometry;
  54652. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54653. var l = new Ci.BufferGeometry
  54654. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54655. l.addAttribute("position", c),
  54656. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54657. color: r,
  54658. linewidth: o
  54659. })),
  54660. this.matrixAutoUpdate = !1,
  54661. this.update()
  54662. }
  54663. ,
  54664. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54665. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54666. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54667. li = new Ci.Vector3,
  54668. ci = new Ci.Matrix3,
  54669. function() {
  54670. this.object.updateMatrixWorld(!0),
  54671. ci.getNormalMatrix(this.object.matrixWorld);
  54672. 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++) {
  54673. var l = r[a]
  54674. , c = l.normal;
  54675. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54676. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54677. t.setXYZ(o, si.x, si.y, si.z),
  54678. o += 1,
  54679. t.setXYZ(o, li.x, li.y, li.z),
  54680. o += 1
  54681. }
  54682. return t.needsUpdate = !0,
  54683. this
  54684. }
  54685. ),
  54686. Ci.GridHelper = function(e, t) {
  54687. var i = new Ci.Geometry
  54688. , n = new Ci.LineBasicMaterial({
  54689. vertexColors: Ci.VertexColors
  54690. });
  54691. this.color1 = new Ci.Color(4473924),
  54692. this.color2 = new Ci.Color(8947848);
  54693. for (var r = -e; r <= e; r += t) {
  54694. 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));
  54695. var o = 0 === r ? this.color1 : this.color2;
  54696. i.colors.push(o, o, o, o)
  54697. }
  54698. Ci.LineSegments.call(this, i, n)
  54699. }
  54700. ,
  54701. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54702. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54703. Ci.GridHelper.prototype.setColors = function(e, t) {
  54704. this.color1.set(e),
  54705. this.color2.set(t),
  54706. this.geometry.colorsNeedUpdate = !0
  54707. }
  54708. ,
  54709. Ci.HemisphereLightHelper = function(e, t) {
  54710. Ci.Object3D.call(this),
  54711. this.light = e,
  54712. this.light.updateMatrixWorld(),
  54713. this.matrix = e.matrixWorld,
  54714. this.matrixAutoUpdate = !1,
  54715. this.colors = [new Ci.Color, new Ci.Color];
  54716. var i = new Ci.SphereGeometry(t,4,2);
  54717. i.rotateX(-Math.PI / 2);
  54718. for (var n = 0; n < 8; n++)
  54719. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54720. var r = new Ci.MeshBasicMaterial({
  54721. vertexColors: Ci.FaceColors,
  54722. wireframe: !0
  54723. });
  54724. this.lightSphere = new Ci.Mesh(i,r),
  54725. this.add(this.lightSphere),
  54726. this.update()
  54727. }
  54728. ,
  54729. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54730. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54731. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54732. this.lightSphere.geometry.dispose(),
  54733. this.lightSphere.material.dispose()
  54734. }
  54735. ,
  54736. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54737. function() {
  54738. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54739. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54740. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54741. this.lightSphere.geometry.colorsNeedUpdate = !0
  54742. }
  54743. ),
  54744. Ci.PointLightHelper = function(e, t) {
  54745. this.light = e,
  54746. this.light.updateMatrixWorld();
  54747. var i = new Ci.SphereGeometry(t,4,2)
  54748. , n = new Ci.MeshBasicMaterial({
  54749. wireframe: !0,
  54750. fog: !1
  54751. });
  54752. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54753. Ci.Mesh.call(this, i, n),
  54754. this.matrix = this.light.matrixWorld,
  54755. this.matrixAutoUpdate = !1
  54756. }
  54757. ,
  54758. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54759. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54760. Ci.PointLightHelper.prototype.dispose = function() {
  54761. this.geometry.dispose(),
  54762. this.material.dispose()
  54763. }
  54764. ,
  54765. Ci.PointLightHelper.prototype.update = function() {
  54766. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54767. }
  54768. ,
  54769. Ci.SkeletonHelper = function(e) {
  54770. this.bones = this.getBoneList(e);
  54771. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54772. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54773. t.vertices.push(new Ci.Vector3),
  54774. t.colors.push(new Ci.Color(0,0,1)),
  54775. t.colors.push(new Ci.Color(0,1,0)))
  54776. }
  54777. t.dynamic = !0;
  54778. var n = new Ci.LineBasicMaterial({
  54779. vertexColors: Ci.VertexColors,
  54780. depthTest: !1,
  54781. depthWrite: !1,
  54782. transparent: !0
  54783. });
  54784. Ci.LineSegments.call(this, t, n),
  54785. this.root = e,
  54786. this.matrix = e.matrixWorld,
  54787. this.matrixAutoUpdate = !1,
  54788. this.update()
  54789. }
  54790. ,
  54791. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54792. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54793. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54794. var t = [];
  54795. e instanceof Ci.Bone && t.push(e);
  54796. for (var i = 0; i < e.children.length; i++)
  54797. t.push.apply(t, this.getBoneList(e.children[i]));
  54798. return t
  54799. }
  54800. ,
  54801. Ci.SkeletonHelper.prototype.update = function() {
  54802. 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++) {
  54803. var o = this.bones[r];
  54804. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54805. e.vertices[n].setFromMatrixPosition(i),
  54806. i.multiplyMatrices(t, o.parent.matrixWorld),
  54807. e.vertices[n + 1].setFromMatrixPosition(i),
  54808. n += 2)
  54809. }
  54810. e.verticesNeedUpdate = !0,
  54811. e.computeBoundingSphere()
  54812. }
  54813. ,
  54814. Ci.SpotLightHelper = function(e) {
  54815. Ci.Object3D.call(this),
  54816. this.light = e,
  54817. this.light.updateMatrixWorld(),
  54818. this.matrix = e.matrixWorld,
  54819. this.matrixAutoUpdate = !1;
  54820. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54821. t.translate(0, -.5, 0),
  54822. t.rotateX(-Math.PI / 2);
  54823. var i = new Ci.MeshBasicMaterial({
  54824. wireframe: !0,
  54825. fog: !1
  54826. });
  54827. this.cone = new Ci.Mesh(t,i),
  54828. this.add(this.cone),
  54829. this.update()
  54830. }
  54831. ,
  54832. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54833. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54834. Ci.SpotLightHelper.prototype.dispose = function() {
  54835. this.cone.geometry.dispose(),
  54836. this.cone.material.dispose()
  54837. }
  54838. ,
  54839. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54840. oi = new Ci.Vector3,
  54841. function() {
  54842. var e = this.light.distance ? this.light.distance : 1e4
  54843. , t = e * Math.tan(this.light.angle);
  54844. this.cone.scale.set(t, t, e),
  54845. ri.setFromMatrixPosition(this.light.matrixWorld),
  54846. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54847. this.cone.lookAt(oi.sub(ri)),
  54848. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54849. }
  54850. ),
  54851. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54852. this.object = e,
  54853. this.size = void 0 !== t ? t : 1;
  54854. var r = void 0 !== i ? i : 16711680
  54855. , o = void 0 !== n ? n : 1
  54856. , a = 0
  54857. , s = this.object.geometry;
  54858. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54859. var l = new Ci.BufferGeometry
  54860. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54861. l.addAttribute("position", c),
  54862. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54863. color: r,
  54864. linewidth: o
  54865. })),
  54866. this.matrixAutoUpdate = !1,
  54867. this.update()
  54868. }
  54869. ,
  54870. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54871. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54872. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54873. ii = new Ci.Vector3,
  54874. ni = new Ci.Matrix3,
  54875. function() {
  54876. var e = ["a", "b", "c"];
  54877. this.object.updateMatrixWorld(!0),
  54878. ni.getNormalMatrix(this.object.matrixWorld);
  54879. var t = this.object.matrixWorld
  54880. , i = this.geometry.attributes.position
  54881. , n = this.object.geometry;
  54882. if (n instanceof Ci.Geometry)
  54883. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54884. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54885. var d = r[c[e[h]]]
  54886. , p = c.vertexNormals[h];
  54887. ti.copy(d).applyMatrix4(t),
  54888. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54889. i.setXYZ(a, ti.x, ti.y, ti.z),
  54890. a += 1,
  54891. i.setXYZ(a, ii.x, ii.y, ii.z),
  54892. a += 1
  54893. }
  54894. else if (n instanceof Ci.BufferGeometry) {
  54895. var f = n.attributes.position
  54896. , g = n.attributes.normal;
  54897. for (h = a = 0,
  54898. u = f.count; h < u; h++)
  54899. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54900. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54901. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54902. i.setXYZ(a, ti.x, ti.y, ti.z),
  54903. a += 1,
  54904. i.setXYZ(a, ii.x, ii.y, ii.z),
  54905. a += 1
  54906. }
  54907. return i.needsUpdate = !0,
  54908. this
  54909. }
  54910. ),
  54911. Ci.WireframeHelper = function(e, t) {
  54912. var i = void 0 !== t ? t : 16777215;
  54913. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54914. color: i
  54915. })),
  54916. this.matrix = e.matrixWorld,
  54917. this.matrixAutoUpdate = !1
  54918. }
  54919. ,
  54920. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54921. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54922. Ci.ImmediateRenderObject = function(e) {
  54923. Ci.Object3D.call(this),
  54924. this.material = e,
  54925. this.render = function(e) {}
  54926. }
  54927. ,
  54928. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54929. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54930. Ci.MorphBlendMesh = function(e, t) {
  54931. Ci.Mesh.call(this, e, t),
  54932. this.animationsMap = {},
  54933. this.animationsList = [];
  54934. var i = this.geometry.morphTargets.length
  54935. , n = i - 1
  54936. , r = i / 1;
  54937. this.createAnimation("__default", 0, n, r),
  54938. this.setAnimationWeight("__default", 1)
  54939. }
  54940. ,
  54941. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54942. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54943. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54944. var r = {
  54945. start: t,
  54946. end: i,
  54947. length: i - t + 1,
  54948. fps: n,
  54949. duration: (i - t) / n,
  54950. lastFrame: 0,
  54951. currentFrame: 0,
  54952. active: !1,
  54953. time: 0,
  54954. direction: 1,
  54955. weight: 1,
  54956. directionBackwards: !1,
  54957. mirroredLoop: !1
  54958. };
  54959. this.animationsMap[e] = r,
  54960. this.animationsList.push(r)
  54961. }
  54962. ,
  54963. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54964. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54965. var s = r.morphTargets[o].name.match(i);
  54966. if (s && 1 < s.length)
  54967. n[l = s[1]] || (n[l] = {
  54968. start: 1 / 0,
  54969. end: -1 / 0
  54970. }),
  54971. o < (c = n[l]).start && (c.start = o),
  54972. o > c.end && (c.end = o),
  54973. t = t || l
  54974. }
  54975. for (var l in n) {
  54976. var c = n[l];
  54977. this.createAnimation(l, c.start, c.end, e)
  54978. }
  54979. this.firstAnimation = t
  54980. }
  54981. ,
  54982. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54983. var t = this.animationsMap[e];
  54984. t && (t.direction = 1,
  54985. t.directionBackwards = !1)
  54986. }
  54987. ,
  54988. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54989. var t = this.animationsMap[e];
  54990. t && (t.direction = -1,
  54991. t.directionBackwards = !0)
  54992. }
  54993. ,
  54994. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54995. var i = this.animationsMap[e];
  54996. i && (i.fps = t,
  54997. i.duration = (i.end - i.start) / i.fps)
  54998. }
  54999. ,
  55000. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55001. var i = this.animationsMap[e];
  55002. i && (i.duration = t,
  55003. i.fps = (i.end - i.start) / i.duration)
  55004. }
  55005. ,
  55006. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55007. var i = this.animationsMap[e];
  55008. i && (i.weight = t)
  55009. }
  55010. ,
  55011. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55012. var i = this.animationsMap[e];
  55013. i && (i.time = t)
  55014. }
  55015. ,
  55016. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55017. var t = 0
  55018. , i = this.animationsMap[e];
  55019. return i && (t = i.time),
  55020. t
  55021. }
  55022. ,
  55023. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55024. var t = -1
  55025. , i = this.animationsMap[e];
  55026. return i && (t = i.duration),
  55027. t
  55028. }
  55029. ,
  55030. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55031. var t = this.animationsMap[e];
  55032. t ? (t.time = 0,
  55033. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55034. }
  55035. ,
  55036. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55037. var t = this.animationsMap[e];
  55038. t && (t.active = !1)
  55039. }
  55040. ,
  55041. Ci.MorphBlendMesh.prototype.update = function(e) {
  55042. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55043. var n = this.animationsList[t];
  55044. if (n.active) {
  55045. var r = n.duration / n.length;
  55046. n.time += n.direction * e,
  55047. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55048. n.time > n.duration && (n.time = n.duration,
  55049. n.directionBackwards = !0),
  55050. n.time < 0 && (n.time = 0,
  55051. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55052. n.time < 0 && (n.time += n.duration));
  55053. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55054. , a = n.weight;
  55055. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55056. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55057. this.morphTargetInfluences[o] = 0,
  55058. n.lastFrame = n.currentFrame,
  55059. n.currentFrame = o);
  55060. var s = n.time % r / r;
  55061. n.directionBackwards && (s = 1 - s),
  55062. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55063. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55064. }
  55065. }
  55066. }
  55067. ,
  55068. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55069. i.THREE = Ci) : this.THREE = Ci
  55070. window.THREE = Ci
  55071. getObjLoader()
  55072. initByTHREE(THREE)
  55073. }
  55074. , {}]
  55075. }, {}, [116]);